Gitlab Unable to view submitted file Errno::enomem (cannot allocate memory-/opt/gitlab/embedded/bin/git):

Source: Internet
Author: User

Gitlab can successfully clone and push, but the submitted file cannot be viewed. Only 500 errors are displayed when viewed from the page.

    

Checked the Gitlab's log.

Tail -f/var/log/gitlab/gitlab-rails/production.log

The following exception is displayed:

Started GET"/gitlab/root/test/commit/e83228ea1bbf183a0f3199f11f995731b23bc1f7"  for 14.23.93.99At .- --Geneva  -: the: ,+0800processing by Projects::commitcontroller#show as HTML Parameters: {"namespace_id"="Root","project_id"="Test","ID"="E83228ea1bbf183a0f3199f11f995731b23bc1f7"}completed $Okinch224ms (Views:156.4ms | ActiveRecord: -. 7ms) Started GET"/gitlab/root/test/commit/e83228ea1bbf183a0f3199f11f995731b23bc1f7/branches"  for 14.23.93.99At .- --Geneva  -: the: the+0800processing by Projects::commitcontroller#branches as HTML Parameters: {"namespace_id"="Root","project_id"="Test","ID"="E83228ea1bbf183a0f3199f11f995731b23bc1f7"}completed -Internal Server Errorinch291ms (ActiveRecord:3. 1ms) Errno::enomem (Cannot allocate memory-/opt/gitlab/embedded/bin/git): Lib/GITLAB/POPEN.RB: at:inch' Popen'APP/MODELS/REPOSITORY.RB:648:inch' Refs_contains_sha'APP/MODELS/REPOSITORY.RB:664:inch' Branch_names_contains'APP/CONTROLLERS/PROJECTS/COMMIT_CONTROLLER.RB: -:inch' Branches'LIB/GITLAB/MIDDLEWARE/GO.RB: -:inch' Call'Started GET"/gitlab/root/test/autocomplete_sources?type=commit&type_id=e83228ea1bbf183a0f3199f11f995731b23bc1f7 "  for 14.23.93.99At .- --Geneva  -: the:Ten+0800processing by Projectscontroller#autocomplete_sources as JSON Parameters: {"type"="Commit","type_id"="E83228ea1bbf183a0f3199f11f995731b23bc1f7","namespace_id"="Root","ID"="Test"}completed $Okinch170ms (Views: the.8ms | ActiveRecord:9. 9ms) Started GET"/gitlab/root/test/notes?target_id=e83228ea1bbf183a0f3199f11f995731b23bc1f7&target_type=commit&last _fetched_at=1467625748"  for 14.23.93.99At .- --Geneva  -: the: -+0800processing by Projects::notescontroller#index as JSON Parameters: {"target_id"="E83228ea1bbf183a0f3199f11f995731b23bc1f7","Target_type"="Commit","Last_fetched_at"="1467625748","namespace_id"="Root","project_id"="Test"}completed $Okinch47ms (Views:0.3ms | ActiveRecord:3.6ms)

Check the memory for 2G, has met the Gitlab minimum memory 1G requirements.

 free-h             total       used       free     shared    buffers     Cachedmem:           1. 8G       1. 7G        63M        43M       9.7M       140M-/+ buffers/ Cache:       1. 6G       213MSwap:           0B         0B         0B

But it is very strange that the swap is 0, found on the internet and some people encounter the corresponding problem. Then change the size of the swap

[Email protected] ~]# Free-h Total Used Freeshared buffers Cachedmem:1.8G1.7G 63M 43M9.7M140M-/+ Buffers/cache:1. 6G 213mswap:0b 0B 0b[[email protected]~]#mkdir/Swapfile[[email protected]~]# CD/Swapfile[[email protected] swapfile]#sudo DD if=/dev/zero Of=swap bs=1024x768Count=20000002000000+0Recordsinch2000000+0Records out2048000000Bytes (2.0GB) Copied,39.1198S52.4MB/S[[email protected] swapfile]#sudoMkswap-F swapsetting up Swapspace version1, size =1999996kibno label, UUID=75b00bde-7aed-48f3-b373-126a2054ad26[[email protected] swapfile]#sudoswapon swapswapon:/swapfile/swap:insecure Permissions0644,0600suggested. [Email protected] swapfile]# Free-h Total Used Freeshared buffers Cachedmem:1.8G1.7G 93M 43M1.2M23M-/+ Buffers/cache:1. 7G 118MSwap:1.9G 0B1. 9g[[email protected] swapfile]#

After the change, look again, decisively out, recorded here.

Gitlab Unable to view submitted file Errno::enomem (cannot allocate memory-/opt/gitlab/embedded/bin/git):

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.