Restoring backup from source installation to the omnibus installation does not update hooks directories symlinks
I decided it is time to switch VM running my GitLab installation to CentOS 7 and use omnibus. My current installation was done from the sources in version 4 or 5 of GitLab, so it seen a lot of things :)
In any case, I created backup, converted mysql backup into postgress, restored backup and... run into issue while running rake job gitlab:check
.
...
hooks directories in repos are links: ...
3/1 ... rake aborted!
Errno::ENOENT: No such file or directory @ realpath_rec - /var/opt/gitlab/git-data/repositories/mine/configs.git/hooks
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:488:in `realpath'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:488:in `block in check_repos_hooks_directory_is_link'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/relation/batches.rb:52:in `block (2 levels) in find_each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/relation/batches.rb:52:in `each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/relation/batches.rb:52:in `block in find_each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/relation/batches.rb:126:in `find_in_batches'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/relation/batches.rb:51:in `find_each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.11/lib/active_record/querying.rb:9:in `find_each'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:482:in `check_repos_hooks_directory_is_link'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:343:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:check => gitlab:gitlab_shell:check
(See full trace by running task with --trace)
And yes, that link was pointing to the old location (/home/git/gitlab-shell/hooks
).
Expected
I expected that gitlab restore will recognize that gitlab-shell's hooks dir moved into new location and will update hooks symlinks with the proper path (i.e. /opt/gitlab/embedded/service/gitlab-shell/hooks
).
References
- #2152 (moved) - Write documentation to upgrade from source installation to omnibus packages