Trying to install gitlab with NAS and getting error "Failed asserting that mode permissions on “/nas/data/gitlabrepo/” is 0700"

Hi All

Trying to install and trial gitlab-ee on RHEL with NAS for storage.
I have updated gitlab.rb file with NAS path. NAS has 0770 permissions set.
I am using gitlabdev user and group.
Below changes in gitlab.rb file has been made.

user[‘username’] = “gitlabdev”
user[‘group’] = “gitlabdev”
gitlab_rails[‘manage_backup_path’] = false
git_data_dirs({
“default” => { “path” => “/nas/data/gitlabrepo/” }
})

When I executed “sudo gitlab-ctl reconfigure”, I get below error. gitlab is expecting 0700, whereas 0770 is set for NAS.
I have asked NAS team to check and meanwhile is there any config file where I can change the mode.Why will gitlab hardcode the mode to 0700?

System Info:

chef_version=15.14.0
platform=redhat
platform_version=7.9
ruby=ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [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[/nas/data/gitlabrepo/] (gitlab::gitlab-rails line 47) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /nas/data/gitlabrepo/] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Failed asserting that mode permissions on “/nas/data/gitlabrepo/” is 0700
---- Begin output of set -x && [ “$(stat --printf=‘%04a’ $(readlink -f /nas/data/gitlabrepo/) | grep -o ‘…$’)” = ‘0700’ ] ----
STDOUT:
STDERR: ++ grep -o ‘…$’
+++ readlink -f /nas/data/gitlabrepo/
++ stat --printf=%04a /nas/data/gitlabrepo

  • ‘[’ 0770 = 0700 ‘]’
    ---- End output of set -x && [ “$(stat --printf=‘%04a’ $(readlink -f /nas/data/gitlabrepo/) | grep -o ‘…$’)” = ‘0700’ ] ----
    Ran set -x && [ “$(stat --printf=‘%04a’ $(readlink -f /nas/data/gitlabrepo/) | grep -o ‘…$’)” = ‘0700’ ] returned 1

Hi, are you attempting to access via NFS or SMB? Please note samba or SMB support won’t work because it cannot set the permissions. If NFS, this won’t be supported in the future, so I recommend that you choose a method supported by Gitlab:

See the docs for more info on this:

https://docs.gitlab.com/ee/administration/nfs.html

technically you could put it on your NAS using iSCSI though since this would be seen as a normal partition. But if NFS or similar, it’s not going to be possible in the very near future.

https://docs.gitlab.com/ee/administration/gitaly/index.html#nfs-deprecation-notice

last link explains the deprecation and to use Gitaly Cluster instead.

1 Like

Thanks @iwalker . I just went through the link
So it seems like I can use NAS as storage to Gitaly and then Gitaly to Gitlab.

Do I get a sample Gitaly config file anywhere? Like a demo config.
I read that Gitaly is configured for default omnibus installations.I set below values incuding auth token and it doesn’t seem to work.

git_data_dirs({
‘default’ => { ‘gitaly_address’ => ‘tcp://127.0.0.1:8075’ },
})

gitaly[‘auth_token’]

Gitlab docs has all the info how to set up Gitaly:

https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html

your alternative, is as I said, use iSCSI to your NAS provided the connection will be reliable. Set up a normal partition on it with ext4 for example. Mount this to /var/opt/gitlab. Then install Gitlab and use it as a default install without making a separate Gitaly install.