Jeremy Davis's picture

Just wish that I had something better to report back... I tried again with a fresh GitLab instance (number 5...!) and can now complete all the steps right through to the last - a successful result from "sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production" but unfortunately GitLab still won't start. :(

The error I get is:

Starting Gitlab service: master failed to start, check stderr log for details
unicorn.

The contents of log/unicorn.stderr.log are:

I, [2012-10-24T12:25:51.925647 #4279]  INFO -- : listening on addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket fd=5
I, [2012-10-24T12:25:51.937718 #4279]  INFO -- : Refreshing Gem list
I, [2012-10-24T12:26:15.584286 #4279]  INFO -- : master process ready
I, [2012-10-24T12:26:15.661607 #4321]  INFO -- : worker=0 ready
I, [2012-10-24T12:26:15.677125 #4324]  INFO -- : worker=1 ready
E, [2012-10-24T21:33:18.737564 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
E, [2012-10-24T21:33:18.737796 #10926] ERROR -- : retrying in 0.5 seconds (4 tries left)
E, [2012-10-24T21:33:19.238471 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
E, [2012-10-24T21:33:19.238562 #10926] ERROR -- : retrying in 0.5 seconds (3 tries left)
E, [2012-10-24T21:33:19.738984 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
E, [2012-10-24T21:33:19.739079 #10926] ERROR -- : retrying in 0.5 seconds (2 tries left)
E, [2012-10-24T21:33:20.239533 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
E, [2012-10-24T21:33:20.241067 #10926] ERROR -- : retrying in 0.5 seconds (1 tries left)
E, [2012-10-24T21:33:20.741482 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
E, [2012-10-24T21:33:20.741582 #10926] ERROR -- : retrying in 0.5 seconds (0 tries left)
E, [2012-10-24T21:33:21.241942 #10926] ERROR -- : adding listener failed addr=/home/gitlab/gitlab//tmp/sockets/gitlab.socket (in use)
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/socket_helper.rb:140:in `initialize': Address already in use - /home/gitlab/gitlab//tmp/sockets/gitlab.socket (Errno::EADDRINUSE)
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/socket_helper.rb:140:in `new'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/socket_helper.rb:140:in `bind_listen'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:224:in `listen'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:741:in `block in inherit_listeners!'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:741:in `each'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:741:in `inherit_listeners!'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:123:in `start'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn_rails:209:in `'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `load'
	from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `'

I haven't had a really close look and so perhaps I'm missing something obvious, but I have no idea what the error is about (I know nothing about Ruby...) and I've had no response so far from my post on the GitLab mailing list. If I get time I may try one more time and if I get the same result and get no reponse from the mailing list, then I think I will try posting it as an 'issue' against GitLab on the GitLab GitHub...

Anyway here is the code that I am using:

service gitlab stop
cd /home/gitlab/gitlab
sudo -u gitlab git init
sudo -u gitlab git remote add origin git://github.com/gitlabhq/gitlabhq.git
sudo -u gitlab git pull origin stable
sudo -u gitlab cp config/gitlab.yml config/gitlab.yml.orig
sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
sudo -u gitlab bundle install --without development test postgres sqlite
sudo -u gitlab bundle exec rake db:migrate RAILS_ENV=production
cp lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
chown git:git /home/git/.gitolite/hooks/common/post-receive
chmod g+rwx /home/git/.gitolite
sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/'\.\*'/g" /home/git/.gitolite.rc
sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production

If anyone else has any bright ideas I'd love to hear...

[update] Just updated the code & comments a little. Nothing major, just realised that the redis-server doesn't need to be stopped, just gitlab...