Gitlab 500 error when adding / removing SSH key

When I try to add an SSH key to Gitlab 7.3.1 on Ubuntu 14.04, it does not work. I get an internal server 500 error, and the site is extremely slow.

When updating, nothing is added, and when I try again to repeat the same problem again and again.

Attempt to read magazines:

# tail -f /var/log/gitlab/gitlab-rails/production.log 

Parameters: {"utf8" => "✓", "authenticity_token" => "nKCheVvcyuhTrKUTrWbin9VOYpVPJEWk6lAJO63Lu9o =", "key" => ....................... ..............

.................................................. ..

.................................................. .......................... "}} 500 internal server errors in 137 ms completed

Errno :: ENOMEM (cannot allocate memory - ssh-keygen): lib / gitlab / popen.rb: 23: in popen' app/models/key.rb:78:in block in generate_fingerpint app / models / key.rb: 75: in generate_fingerpint' app/controllers/profiles/keys_controller.rb:20:in create

How to fix it?

+5
source share
1 answer

Probably because Gitlab cannot allocate enough memory,

You need to create a page file. Try the following:

 #dd if=/dev/zero of=/swapfile bs=2048k count=1000 #mkswap /swapfile #swapon /swapfile #swapon -s #chown root:root /swapfile #chmod 0600 /swapfile #echo 10 | sudo tee /proc/sys/vm/swappiness #echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf 

If this works, you can make it permanent by editing the following file: # nano / etc / fstab

add this line:

 /swapfile none swap sw 0 0 

Hope this helps

+13
source

Source: https://habr.com/ru/post/1206335/


All Articles