gitlab 无法查看提交的文件Errno::ENOMEM (Cannot allocate memory - /opt/gitlab/embedded/bin/git):
gitlab可以成功clone和push,但是提交后的文件却无法查看。从页面上看的话只显示出500错误。

查了下gitlab的日志
tail -f /var/log/gitlab/gitlab-rails/production.log
显示如下异常:
Started GET "/gitlab/root/test/commit/e83228ea1bbf183a0f3199f11f995731b23bc1f7" for 14.23.93.99 at -- :: +
Processing by Projects::CommitController#show as HTML
Parameters: {"namespace_id"=>"root", "project_id"=>"test", "id"=>"e83228ea1bbf183a0f3199f11f995731b23bc1f7"}
Completed OK in 224ms (Views: .4ms | ActiveRecord: .7ms)
Started GET "/gitlab/root/test/commit/e83228ea1bbf183a0f3199f11f995731b23bc1f7/branches" for 14.23.93.99 at -- :: +
Processing by Projects::CommitController#branches as HTML
Parameters: {"namespace_id"=>"root", "project_id"=>"test", "id"=>"e83228ea1bbf183a0f3199f11f995731b23bc1f7"}
Completed Internal Server Error in 291ms (ActiveRecord: .1ms) Errno::ENOMEM (Cannot allocate memory - /opt/gitlab/embedded/bin/git):
lib/gitlab/popen.rb::in `popen'
app/models/repository.rb::in `refs_contains_sha'
app/models/repository.rb::in `branch_names_contains'
app/controllers/projects/commit_controller.rb::in `branches'
lib/gitlab/middleware/go.rb::in `call' Started GET "/gitlab/root/test/autocomplete_sources?type=Commit&type_id=e83228ea1bbf183a0f3199f11f995731b23bc1f7" for 14.23.93.99 at -- :: +
Processing by ProjectsController#autocomplete_sources as JSON
Parameters: {"type"=>"Commit", "type_id"=>"e83228ea1bbf183a0f3199f11f995731b23bc1f7", "namespace_id"=>"root", "id"=>"test"}
Completed OK in 170ms (Views: .8ms | ActiveRecord: .9ms)
Started GET "/gitlab/root/test/notes?target_id=e83228ea1bbf183a0f3199f11f995731b23bc1f7&target_type=commit&last_fetched_at=1467625748" for 14.23.93.99 at -- :: +
Processing by Projects::NotesController#index as JSON
Parameters: {"target_id"=>"e83228ea1bbf183a0f3199f11f995731b23bc1f7", "target_type"=>"commit", "last_fetched_at"=>"", "namespace_id"=>"root", "project_id"=>"test"}
Completed OK in 47ms (Views: .3ms | ActiveRecord: .6ms)
查了下内存为2G,已经满足gitlab最小内存1G的要求。
[root@xxxxxx ~]# free -h
total used free shared buffers cached
Mem: .8G .7G 63M 43M 9.7M 140M
-/+ buffers/cache: .6G 213M
Swap: 0B 0B 0B
但是非常诡异的是swap为0,网上找了发现也有人遇到相应的问题。于是修改下swap的大小
[root@xxxx ~]# free -h
total used free shared buffers cached
Mem: .8G .7G 63M 43M 9.7M 140M
-/+ buffers/cache: .6G 213M
Swap: 0B 0B 0B
[root@xxxx ~]# mkdir /swapfile
[root@xxxx ~]# cd /swapfile
[root@xxxx swapfile]# sudo dd if=/dev/zero of=swap bs= count=
+ records in
+ records out
bytes (2.0 GB) copied, 39.1198 s, 52.4 MB/s
[root@xxxx swapfile]# sudo mkswap -f swap
Setting up swapspace version , size = KiB
no label, UUID=75b00bde-7aed-48f3-b373-126a2054ad26
[root@xxxx swapfile]# sudo swapon swap
swapon: /swapfile/swap: insecure permissions , suggested.
[root@xxxx swapfile]# free -h
total used free shared buffers cached
Mem: .8G .7G 93M 43M 1.2M 23M
-/+ buffers/cache: .7G 118M
Swap: .9G 0B .9G
[root@xxx swapfile]#
修改后再次查看,果断地出来了,记录于此。
gitlab 无法查看提交的文件Errno::ENOMEM (Cannot allocate memory - /opt/gitlab/embedded/bin/git):的更多相关文章
- 记一次使用commit提交大文件无法推送到远程库解决问题过程及git rebase使用
记一次使用commit提交大文件无法推送到远程库解决问题过程及git rebase使用 目录 大文件无法push到远程仓库 问题 commit的大文件无法push到远程库解决办法 git filter ...
- 训练DQN,报错:OSError: [Errno 12] Cannot allocate memory
训练DQN,报错:OSError: [Errno 12] Cannot allocate memory 问题介绍: 这两天在做强化学习的作业,使用 DQN 打 Atari 游戏,但在训练过程中,出现了 ...
- mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool
mysql以`systemctl start mysqld.service`的方式启动一段时间后发现突然无法启动,尝试重新启动也不能解决问题,排查问题时,先后通过`systemctl status m ...
- GreenPlum 初始化配置报错:gpadmin-[ERROR]:-[Errno 12] Cannot allocate memory
报错原因:可能swap太小或者没有交换分区 解决方法: (1)查看swap:swapon -s (2)如果什么都没有显示,说明你没有任何可用的swap,此时你可以添加1GB的swap: dd if=/ ...
- 查看当前目录下文件个数: $find ./ | wc -l
2.1. 创建和删除 创建:mkdir 删除:rm 删除非空目录:rm -rf file目录 删除日志 rm *log (等价: $find ./ -name "*log" -ex ...
- git学习------>如何用git log命令来查看某个指定文件的提交历史记录
有时候接手一份新代码时,看到某些文件的改动,但不清楚这个改动的作者和原因,想查看该文件的具体提交历史记录. 今天一个同事是这样做的,直接敲git log命令,然后再使用vim命令的搜索关键字的方法来查 ...
- Git查看某一个文件的历史提交信息
工作中我们有时候想要查看某一个文件的历史提交版本,] 还想看都修改过那些内容,那么这两个简单的命令就会帮到你了, 话不多说,comeBaby...... 1,首先查看一个文件的历史提交信息 git l ...
- git 使用详解(5)-- get log 查看提交历史【转】
转自:http://blog.csdn.net/wh_19910525/article/details/7468549 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 限制 ...
- Git 提交大文件提示 fatal: The remote end hung up unexpectedly
使用gitlab搭建的git server,如果直接使用http的方式去提交的话,提交小文件不会有问题,但是提交大文件时,会出错: fatal: The remote end hung up unex ...
随机推荐
- java中跳出if判断
今天学到的一点儿新东西一个if判断里面有好多东西,紧接着还有其他代码,不能使用return来结束这个if判断这时候,就需要这样: out:if (!"null".equals(re ...
- C# 正则匹配domain
1.带协议表达式 var pattern = @"[(?<=http://)|(?<=https://)]+[\w\.]+[^/?#]"; 2.不带协议表达式 var ...
- 关于标准C语言的预定义宏【转】
标准C语言预处理要求定义某些对象宏,每个预定义宏的名称一两个下划线字符开头和结尾,这些预定义宏不能被取消定义(#undef)或由编程人员重新定义.下面预定义宏表,被我抄了下来. __LINE__ 当 ...
- JQ nextALL() 实现遍历
在我们的 手机端 常常需要 应用到 hide 和 show 的方法 来节省页面的版块 那么我们需要更多的是 需要 show 一个 <li> hide 剩下的 <li> 那么 ...
- firefox的plugin-container.exe进程如何关闭?
为什么要关闭container进程? 查看firefox所消耗的资源: ff本身: cpu一般是0-10%, 内存一般是400MB左右 plugin-container: cpu所占的比例很高, 可达 ...
- CF453B Little Pony and Harmony Chest (状压DP)
CF453B CF454D Codeforces Round #259 (Div. 2) D Codeforces Round #259 (Div. 1) B D. Little Pony and H ...
- thinkphp 完整配置config.php
ThinkPHP的系统配置都采用数组形式,配置文件地址:Bin/Conf/config.php CHECK_FILE_CASE -- windows环境下面的严格检查大小写. /* 项目设定 ...
- oracle唯一索引与普通索引的区别和联系以及using index用法
oracle唯一索引与普通索引的区别和联系 区别:唯一索引unique index和一般索引normal index最大的差异是在索引列上增加一层唯一约束.添加唯一索引的数据列可以为空,但是只要尊在数 ...
- 图解JavaScript 继承
JavaScript作为一个面向对象语言,可以实现继承是必不可少的,但是由于本身并没有类的概念(不知道这样说是否严谨,但在js中一切都类皆是对象模拟)所以在JavaScript中的继承也区别于其他的面 ...
- 江湖救急:webbrowser中js文件丢失问题~
页面中,有一个按钮,点击按钮通过js create 了一个 script标签 ,链接加载一个外部js文件,执行该js文件 $("#a").click(function(){ $.g ...