Sorry if this has been asked many times, but I do have a problem moving data paths to an nfs share, I followed the documentation but got stuck.
Here’s what I have:
- Installed gitlab with omnibus on Debian 10 system, latest version as of August 2020.
- Backups work, gitlab checks are fine, and gitlab-ctl gives no errors
- NFS mount on /gitlab-nfs with nfs4.1, ownership set as original directories
I have tried mounting the nfs share directly to the original path ( /var/opt/gitlab/backups), gitlab-cfg reconfigure gives an error.
I have tried mounting to /gitlab-nfs and changing the path settings /etc/gitlab/gitlab.rb, gitlab-ctl reconfigure gives an error.
I have tried mounting to /gitlab-nfs and mounting it to the original path using the bind option, same thing.
This is the error I get:
There was an error running gitlab-ctl reconfigure:
storage_directory[/gitlab-nfs/gitlab-data/backups] (gitlab::gitlab-rails line 117) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /gitlab-nfs/gitlab-data/backups] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of stat --printf=’%U’ (readlink -f /gitlab-nfs/gitlab-data/backups) ----
STDOUT:
STDERR: stat: missing operand
Try 'stat --help' for more information.
---- End output of stat --printf='%U' (readlink -f /gitlab-nfs/gitlab-data/backups) ----
Ran stat --printf=’%U’ $(readlink -f /gitlab-nfs/gitlab-data/backups) returned 1
Weirdly enough, when I run the stat command by hand (as root) it works fine.
I can set the option to manage the backup path to false, then gitlab-ctl reconfigure works, but the actual backup command still doesn’t:
root@gitlab:/etc/gitlab# /usr/bin/gitlab-backup create CRON=1
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - /gitlab-nfs/gitlab-data
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/database.rb:18:in dump' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:127:in
block (4 levels) in <top (required)>’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:10:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Tasks: TOP => gitlab:backup:db:create
(See full trace by running task with --trace)
As soon as I use the path on the original filesystem, it works fine.
I also want to move the repository directory to the nfs share, but I hit the same problem as above.
I have found more people with the error, but never found the fix. Is this actually possible, or am I on a wild goose chase.
Many thanks in advance,
Albert