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 ...
 
随机推荐
- 负margin小记
			
static元素 margin-top/left负值,元素向指定方向移动, margin-bottom/right负值,元素不动,后续元素前移 float元素 左浮, ...
 - 一些分享微博,qq啥的js
			
<div class="bdsharebuttonbox" style="float:right"><a href="#" ...
 - mobile touch事件
			
touch.js 众所周知,mobile与pc 前端开发的不同中,有一点就是事件的不同,mobile上有touchstart,touchmove,touchend等,而pc上用最多的应该还是我们的cl ...
 - MySQL的Order By Rand()的效率问题
			
MySQL很多时候需要获取随机数据,举个例子,要从tablename表中随机提取一条记录,大家一般的写法就是: 但是,后来我查了一下MYSQL的官方手册,里面针对RAND()的提示大概意思就是,在OR ...
 - 统计学 nested_design 嵌套设计
			
nested_design 嵌套设计 li_volleyball ,邓邦良 2016年3月6日 嵌套设计 一.基本概念 嵌套设计(nested design)又称为窝设计和套设计,与析因设计的处理不同 ...
 - Eclipse常见配置及常用插件
			
tomcat为能同时运行多个项目而不崩溃,需要配置一下jvm设置 -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
 - wordpress自动清理评论回收站
			
有时wordpress的垃圾评论实在让人心烦,杂草难除根,footprint吹又生.如果你有心情的话会一个个把垃圾评论放入回收站,但是时间一长,回收站里的东西越堆越多,你可以点击回收站,然后再点一下e ...
 - cf#306D. Regular Bridge(图论,构图)
			
D. Regular Bridge time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
 - 2015baidu复赛 矩形面积(包凸 && ps:附quickhull模板)
			
矩形面积 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
 - BZOJ4519——[cqoi2016]不同的最小割
			
0.题意:求两点之间的最小割的不同的总量 1.分析:裸的分治+最小割,也叫最小割树或GH树,最后用set搞一下就好 #include <set> #include <queue> ...