Thursday, August 27, 2015

gitlab install::ENOENT (No such file or directory - ssh-keygen)

I'm installing gitlab on RedHat 6, when I posted the ssh key, I got a 500 html error.

In the /var/log/gitlab/gitlab-rails/production.log file, it shows

    Completed 500 Internal Server Error in 433ms (ActiveRecord: 40.8ms)

    Errno::ENOENT (No such file or directory - ssh-keygen):
    lib/gitlab/popen.rb:23:in `popen'

After a whole day trial and error, I found my ugly work around. I'm not much a Linux admin, so there must be good solutions, but I need to move-on. If you want try my hack, proceed at your own risk.

How I found out the problem:

run "sudo gitlab-rails c" (c stands for console)
type in: system("which ssh-keygen"), 
You will get a stupid error that says "ssh-keygen" is not available from the path, /usr/bin, etc, However, you can see clearly "ssh-keygen" is under /usr/bin.

Then I tried 
system("whoami"), it tells me the user is "git". 

In the terminal console, I run "sudo su git", now I'm "git" user, then I ran "which ssh-keygen", I got the same error. That tells me, user "git" does not have permission to run "ssh-keygen".

So I just run "sudo chmod a+x /usr/bin/ssh-keygen". That allows me to go past that issue temporarily. If you need a permanent solution, please go check with a true Linux admin guru.

I also noticed that the execute permission is turned off "automatically" by the system after a little while. So each time when i post a key, i have to run the temp fix. It's a pain in the neck!

BTW, I did ran into another issue during the install. I followed this post to "fix" the issue, which essentially is just to bypass the issue, modifying /opt/gitlab/embedded/cookbooks/gitlab/recipes/postgresql.rb file with 
command "/sbin/sysctl -e -p /etc/sysctl.conf"
that additional "-e" just says to ignore the error from sysclt command. 

I initially thought bypassing the error was the cause of my ssh-keygen problem. I finally came to the conclusion it has nothing to do with it. Additionally, I believe it's totally safe to bypass the sysctl error in this case.

My install steps: download rpm, then run
rpm -Uvh --force gitlab-ce-7.14.1-ce.0.el6.x86_64.rpm

No comments:

Post a Comment