Sidekiq not starting (with solution)
Created by: WilHall
System Information:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
Similar issue: https://github.com/gitlabhq/gitlabhq/issues/2535 I stumbled upon the above issue, but it appears to be for an older version.
When following the tutorial exactly as written, running
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
produces the following error:
wil@calcifer:/home/gitlab/gitlab$ sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
gitlab user is in git group? ... yes
Has no "-e" in ~git/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking Gitolite ...
Using recommended version ... yes
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by git:git ... yes
Config directory access is drwxr-x---? ... yes
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwsrws---? ... yes
Can clone gitolite-admin? ... yes
Can commit to gitolite-admin? ... yes
post-receive hook exists? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... can't check, you have no projects
Git config in repos: ... can't check, you have no projects
Checking Gitolite ... Finished
Checking Sidekiq ...
Running? ... no
Try fixing it:
sudo -u gitlab -H bundle exec rake sidekiq:start
For more information see:
doc/install/installation.md in section "Install Init Script"
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ... can't check, you have no projects
Checking GitLab ... Finished
Following the recommendation I ran
sudo -u gitlab -H bundle exec rake sidekiq:start
which returns another error:
wil@calcifer:/home/gitlab/gitlab$ sudo -u gitlab -H bundle exec rake sidekiq:startrake aborted!
cannot load such file -- rb-inotify
/home/gitlab/gitlab/config/application.rb:9:in `<top (required)>'
/home/gitlab/gitlab/Rakefile:5:in `require'
/home/gitlab/gitlab/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Specifying the environment fixes this:
wil@calcifer:/home/gitlab/gitlab$ sudo -u gitlab -H bundle exec rake sidekiq:start RAILS_ENV=production
wil@calcifer:/home/gitlab/gitlab$
However, running sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
still fails with the same error.
The sidekiq.log
file reveals another error:
wil@calcifer:/home/gitlab/gitlab$ cat log/sidekiq.log
No such file or directory - /home/gitlab/gitlab/tmp/pids/sidekiq.pid
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `initialize'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `open'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:239:in `write_pid'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/lib/sidekiq/cli.rb:73:in `parse'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.4/bin/sidekiq:7:in `<top (required)>' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/sidekiq:23:in `load'
/home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bin/sidekiq:23:in `<main>'
It is important to note that this is NOT a permissions issue:
wil@calcifer:/home/gitlab/gitlab$ ls -l
. . .
drwxr-xr-x 3 gitlab gitlab 4096 Feb 14 21:02 tmp
. . .
It turns out the /home/gitlab/gitlab/tmp/pids/
directory was never created. So I created it and set the appropriate permissions:
sudo mkdir tmp/pids/
sudo chown -R gitlab tmp/pids/
sudo chmod -R u+rwX tmp/pids/
Then I re-ran
wil@calcifer:/home/gitlab/gitlab$ sudo -u gitlab -H bundle exec rake sidekiq:start RAILS_ENV=production
wil@calcifer:/home/gitlab/gitlab$
And a sucessful check:
wil@calcifer:/home/gitlab/gitlab$ sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
gitlab user is in git group? ... yes
Has no "-e" in ~git/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking Gitolite ...
Using recommended version ... yes
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by git:git ... yes
Config directory access is drwxr-x---? ... yes
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwsrws---? ... yes
Can clone gitolite-admin? ... yes
Can commit to gitolite-admin? ... yes
post-receive hook exists? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... can't check, you have no projects
Git config in repos: ... can't check, you have no projects
Checking Gitolite ... Finished
Checking Sidekiq ...
Running? ... yes
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ... can't check, you have no projects
Checking GitLab ... Finished
wil@calcifer:/home/gitlab/gitlab$