fritteli / gentoo-overlay

https://gittr.ch/linux/gentoo-overlay
GNU General Public License v2.0
24 stars 7 forks source link

No such file or directory @ realpath_rec - /home/git #46

Closed stephan-- closed 7 years ago

stephan-- commented 7 years ago

Hi guys,

trying to install first time gitlab. Followed all steps in emerge info for a fresh install and now im stuck at emerging the config...There is indeed no /home/git directory.... Anyone a idea whats wrong here?

emerge --config "=www-apps/gitlab-ce-9.0.2"

Configuring pkg...

 * Checking configuration files
 * Migrating database ...
   /usr/bin/ruby /usr/bin/bundle exec rake db:migrate RAILS_ENV=production NODE_ENV=production
D, [2017-04-01T16:42:23.521652 #14156] DEBUG -- sentry: ** [Raven] No such file or directory @ realpath_rec - /home/git excluded from capture due to environment or should_capture callback
rake aborted!
Errno::ENOENT: No such file or directory @ realpath_rec - /home/git
/opt/gitlab/config/initializers/6_validations.rb:6:in `realpath'
/opt/gitlab/config/initializers/6_validations.rb:6:in `realpath'
/opt/gitlab/config/initializers/6_validations.rb:6:in `find_parent_path'
/opt/gitlab/config/initializers/6_validations.rb:34:in `block in validate_storages'
/opt/gitlab/config/initializers/6_validations.rb:19:in `each'
/opt/gitlab/config/initializers/6_validations.rb:19:in `validate_storages'
/opt/gitlab/config/initializers/6_validations.rb:41:in `<top (required)>'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `load'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `block in load'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `load'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:652:in `block in load_config_initializer'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:166:in `instrument'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:651:in `load_config_initializer'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:615:in `each'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/engine.rb:615:in `block in <class:Engine>'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `run'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:44:in `each'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:44:in `tsort_each_child'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:352:in `initialize!'
/opt/gitlab/config/environment.rb:5:in `<top (required)>'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:328:in `require_environment!'
/opt/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:457:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
 * ERROR: www-apps/gitlab-ce-9.0.2::fritteli failed (config phase):
 *   failed to run rake db:migrate
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called pkg_config
 *   environment, line 4262:  Called exec_rake 'db:migrate'
 *   environment, line 1860:  Called die
 * The specific snippet of code:
 *          ${command}" || die "failed to run rake $@"
 * 
 * If you need support, post the output of `emerge --info '=www-apps/gitlab-ce-9.0.2::fritteli'`,
 * the complete build log and the output of `emerge -pqv '=www-apps/gitlab-ce-9.0.2::fritteli'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =gitlab-ce-9.0.2
 * The complete build log is located at '/var/tmp/portage/www-apps/gitlab-ce-9.0.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apps/gitlab-ce-9.0.2/temp/environment'.
 * Working directory: '/var/tmp/portage/www-apps/gitlab-ce-9.0.2/homedir'
 * S: '/var/tmp/portage/www-apps/gitlab-ce-9.0.2/work/gitlab-ce-9.0.2'
fritteli commented 7 years ago

That's indeed wrong. In Gentoo (at least with this ebuild), Gitlab is installed in /opt/gitlab and there should be no references to /home/git, the default location for source-based installs.

Since I've installed Gitlab for the first time a few years ago, I haven't tested the fresh install since then. I'll see if I can find the error from the logs you provided. Thanks for reporting, I'll comment again later!

stephan-- commented 7 years ago

Not sure of course if this was right (just want to make it work asap) but i removed the former created git user (userdel) and re-created according to the howto in the gitlab gentoo wiki

useradd -m -s /bin/bash -c 'Git Version Control' -d /home/git git
echo 'export PATH=$(ruby -rubygems -e "puts Gem.user_dir")/bin:/usr/local/bin:$PATH' >> /home/git/.bashrc

Next the config told me that there is no "repositories" directory in /home/git which i then just created manually. Had also some permission problems here and there plus needed to create the pg_trgm extension in my psql gitlab db but now it seems to ok....at least the config step is done now without reporting any further error.

fritteli commented 7 years ago

Ah, no, that's wrong :) The home dir of the "git" user should be /var/lib/git. That user is created by the dev-vcs/gitlab-shell ebuild.

If you can, try to delete the user "git" and re-emerge dev-vcs/gitlab-shell and www-apps/gitlab-ce.I hope this should initialize everything correctly.

stephan-- commented 7 years ago

Ok removed the git user and re-emerged dev-vcs/gitlab-shell. Starting gitlab produces the follwing error in the unicorn.stderr.log

I, [2017-04-01T18:58:14.837144 #7565]  INFO -- : Refreshing Gem list
WARNING: This version of GitLab depends on gitlab-shell 5.0.0, but you're running Unknown. Please update gitlab-shell.
/opt/gitlab/config/initializers/6_validations.rb:6:in `realpath': No such file or directory @ realpath_rec - /home/git (Errno::ENOENT)
        from /opt/gitlab/config/initializers/6_validations.rb:6:in `realpath'
        from /opt/gitlab/config/initializers/6_validations.rb:6:in `find_parent_path'
        from /opt/gitlab/config/initializers/6_validations.rb:34:in `block in validate_storages'
        from /opt/gitlab/config/initializers/6_validations.rb:19:in `each'
        from /opt/gitlab/config/initializers/6_validations.rb:19:in `validate_storages'
        from /opt/gitlab/config/initializers/6_validations.rb:41:in `<top (required)>'

Output in the console is:

 * Starting GitLab - Unicorn servers ...
master failed to start, check stderr log for details
 * start-stop-daemon: failed to start `/usr/bin/bundle'                                                                                                                                                                            [ !! ]
 * Starting GitLab - Sidekiq 

My passwd:

apache:x:81:81:added by portage for apache:/var/www:/sbin/nologin
redis:x:75:75:added by portage for redis:/var/lib/redis:/sbin/nologin
nullmail:x:88:88:added by portage for nullmailer:/var/nullmailer:/sbin/nologin
git:x:101:247:added by portage for gitlab-shell:/var/lib/git:/sbin/nologin

Checking the gentoo wiki they write something about a repos_path

/var/lib/gitlab-shell/config.yml

...
#repos_path: "/var/lib/git/repositories"
repos_path: "/home/git/repositories"
...
#auth_file: "/var/lib/git/.ssh/authorized_keys"
auth_file: "/home/git/.ssh/authorized_keys"

Was checking my config.yml (which i just created from the .example file...) and couldn't find this variable...Tried to add this variable for testing: repos_path: "/var/lib/git/repositories" ... but wasn't changing anything...

This gitlab is really a huge beast...

stephan-- commented 7 years ago

More things i noticed: It seems there are some settings which needs to be changed in the /etc/gitlab/gitlab.yml:

This is prob. the reason why it was still searching for the /home/git/...

    storages: # You must have at least a `default` storage path.
      default:
        #path: /home/git/repositories/
        path: /var/lib/git/repositories/

The paths to shell needs to be changed i guess (otherwise /etc/init.d/gitlab check print some warnings/errors):

  ## GitLab Shell settings
  gitlab_shell:
    #path: /usr/share/gitlab-shell/
    path: /var/lib/gitlab-shell/
    #hooks_path: /usr/share/gitlab-shell/hooks/
    hooks_path: /var/lib/gitlab-shell/hooks/

(Hopefully) last problems im trying to fix now (/etc/init.d/gitlab check):

Check GitLab API access: OK
Access to /var/lib/git/.ssh/authorized_keys: OK
Send ping to redis server: /usr/lib64/ruby/2.3.0/socket.rb:1207:in `__connect_nonblock': No such file or directory - connect(2) for /var/run/redis/redis.sock (Errno::ENOENT)
    from /usr/lib64/ruby/2.3.0/socket.rb:1207:in `connect_nonblock'
stephan-- commented 7 years ago

Ok...all problems now solved i hope.

Problem was that redis was (default) configured for tcp. Switched it to sockets according to the example here. Additionally i changed the path to /var/run/redis/redis,sock with 777 permission. After these changes the /etc/init.d/gitlab check was passed (regards gitlab-shell) but next problem was sidekiq was now searching for redit via tcp what was of course working before.

Solution: Using a resque.yml in /etc/gitlab/. I just copied the example file, re-ran the gitlab check and finally all tests are passing.

uff...