I have installed GitLab on CentOS7 server and it is working fine.
But due to increasing size of repositories, I want to change the Storage path of GitLab repositories to other Hard Drive which is connected to my system at /media/DATA_DIRIVE
Modifications done in gitlab.rb file:
git_data_dirs({
“default” => {
“path” => “/media/DATA_DRIVE/GitLab_Data/”
}
})
As mentioned in GitLab Docs :
- The target directories and any of its subpaths must not be a symlink.
Due to this I guess I am getting this error, this is the log:
+ sudo gitlab-ctl reconfigure Starting Chef Client, version 14.13.11 resolving cookbooks for run list: ["gitlab"] Synchronizing Cookbooks: - gitlab (0.0.1) - package (0.1.0) - postgresql (0.1.0) - redis (0.1.0) - monitoring (0.1.0) - registry (0.1.0) - mattermost (0.1.0) - consul (0.1.0) - gitaly (0.1.0) - letsencrypt (0.1.0) - nginx (0.1.0) - runit (4.3.0) - acme (4.0.0) - crond (0.1.0) Installing Cookbook Gems: Compiling Cookbooks... Recipe: gitlab::default * directory[/etc/gitlab] action create (up to date) Converging 265 resources * directory[/etc/gitlab] action create (up to date) * directory[Create /var/opt/gitlab] action create (up to date) * directory[Create /var/log/gitlab] action create (up to date) * directory[/opt/gitlab/embedded/etc] action create (up to date) * template[/opt/gitlab/embedded/etc/gitconfig] action create (up to date) Recipe: gitlab::web-server * account[Webserver user and group] action create * group[Webserver user and group] action create (up to date) * linux_user[Webserver user and group] action create (up to date) (up to date) Recipe: gitlab::users * directory[/var/opt/gitlab] action create (up to date) * account[GitLab user and group] action create * group[GitLab user and group] action create (up to date) * linux_user[GitLab user and group] action create (up to date) (up to date) * template[/var/opt/gitlab/.gitconfig] action create (up to date) * directory[/var/opt/gitlab/.bundle] action create (up to date) Recipe: gitlab::gitlab-shell * storage_directory[/var/opt/gitlab/.ssh] action create * ruby_block[directory resource: /var/opt/gitlab/.ssh] action run (skipped due to not_if) (up to date) * directory[/var/log/gitlab/gitlab-shell/] action create (up to date) * directory[/var/opt/gitlab/gitlab-shell] action create (up to date) * templatesymlink[Create a config.yml and create a symlink to Rails root] action create * template[/var/opt/gitlab/gitlab-shell/config.yml] action create (up to date) * link[Link /opt/gitlab/embedded/service/gitlab-shell/config.yml to /var/opt/gitlab/gitlab-shell/config.yml] action create (up to date) (up to date) * link[/opt/gitlab/embedded/service/gitlab-shell/.gitlab_shell_secret] action create (up to date) * file[/var/opt/gitlab/.ssh/authorized_keys] action create_if_missing (up to date) * bash[Set proper security context on ssh files for selinux] action run (skipped due to only_if) Recipe: gitlab::gitlab-rails * storage_directory[/media/DATA_DRIVE/GitLab_Data/] action create * ruby_block[directory resource: /media/DATA_DRIVE/GitLab_Data/] action run ================================================================================ Error executing action `run` on resource 'ruby_block[directory resource: /media/DATA_DRIVE/GitLab_Data/]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Failed asserting that ownership of "/media/DATA_DRIVE/GitLab_Data/" was git ---- Begin output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- STDOUT: STDERR: + readlink -f /media/DATA_DRIVE/GitLab_Data/ + stat --printf=%U /media/DATA_DRIVE/GitLab_Data + [ root = git ] ---- End output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- Ran set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] returned 1 Cookbook Trace: --------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:43:in `block (3 levels) in class_from_file' Resource Declaration: --------------------- # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb 34: ruby_block "directory resource: #{new_resource.path}" do 35: block do 36: # Ensure the directory exists 37: storage_helper.ensure_directory_exists(new_resource.path) 38: 39: # Ensure the permissions are set 40: storage_helper.ensure_permissions_set(new_resource.path) 41: 42: # Error out if we have not achieved the target permissions 43: storage_helper.validate!(new_resource.path) 44: end 45: not_if { storage_helper.validate(new_resource.path) } 46: end 47: end Compiled Resource: ------------------ # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:34:in `block in class_from_file' ruby_block("directory resource: /media/DATA_DRIVE/GitLab_Data/") do action [:run] default_guard_interpreter :default declared_type :ruby_block cookbook_name "gitlab" block #<Proc:0x0000000005849c48@/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:35> block_name "directory resource: /media/DATA_DRIVE/GitLab_Data/" not_if { #code block } end System Info: ------------ chef_version=14.13.11 platform=ubuntu platform_version=16.04 ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] program_name=/opt/gitlab/embedded/bin/chef-client executable=/opt/gitlab/embedded/bin/chef-client ================================================================================ Error executing action `create` on resource 'storage_directory[/media/DATA_DRIVE/GitLab_Data/]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ ruby_block[directory resource: /media/DATA_DRIVE/GitLab_Data/] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that ownership of "/media/DATA_DRIVE/GitLab_Data/" was git ---- Begin output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- STDOUT: STDERR: + readlink -f /media/DATA_DRIVE/GitLab_Data/ + stat --printf=%U /media/DATA_DRIVE/GitLab_Data + [ root = git ] ---- End output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- Ran set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] returned 1 Cookbook Trace: --------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:43:in `block (3 levels) in class_from_file' Resource Declaration: --------------------- # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb 46: storage_directory git_data_directory['path'] do 47: owner gitlab_user 48: mode "0700" 49: end 50: end Compiled Resource: ------------------ # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:46:in `block in from_file' storage_directory("/media/DATA_DRIVE/GitLab_Data/") do action [:create] default_guard_interpreter :default declared_type :storage_directory cookbook_name "gitlab" recipe_name "gitlab-rails" owner "git" mode "0700" path "/media/DATA_DRIVE/GitLab_Data/" end System Info: ------------ chef_version=14.13.11 platform=ubuntu platform_version=16.04 ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] program_name=/opt/gitlab/embedded/bin/chef-client executable=/opt/gitlab/embedded/bin/chef-client Running handlers: There was an error running gitlab-ctl reconfigure: storage_directory[/media/DATA_DRIVE/GitLab_Data/] (gitlab::gitlab-rails line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /media/DATA_DRIVE/GitLab_Data/] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that ownership of "/media/DATA_DRIVE/GitLab_Data/" was git ---- Begin output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- STDOUT: STDERR: + readlink -f /media/DATA_DRIVE/GitLab_Data/ + stat --printf=%U /media/DATA_DRIVE/GitLab_Data + [ root = git ] ---- End output of set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] ---- Ran set -x && [ "$(stat --printf='%U' $(readlink -f /media/DATA_DRIVE/GitLab_Data/))" = 'git' ] returned 1 Running handlers complete Chef Client failed. 0 resources updated in 04 seconds
Please kindly inform if there is any solution to this problem.
Thank You