gitlab-ctl reconfigure fails with stat: missing operand
Hi,
Summary
When I change the backup_path variable in gitlab.rb and try to reconfigure, I get the following error:
There was an error running gitlab-ctl reconfigure:
storage_directory[/var/backup/gitlab] (gitlab::gitlab-rails line 116) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /var/backup/gitlab] (/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 /var/backup/gitlab) ----
STDOUT:
STDERR: stat: missing operand
Try 'stat --help' for more information.
---- End output of stat --printf='%U' $(readlink -f /var/backup/gitlab) ----
Ran stat --printf='%U' $(readlink -f /var/backup/gitlab) returned 1
Steps to reproduce
- Uncomment
gitlab_rails['backup_path'] = "/var/backup/gitlab"and change the proposed path. - Launch a
gitlab-ctl reconfigure - Get the mentioned error
What is the expected correct behavior?
gitlab-ctl reconfigure should works fine and don't throw an error here.
Relevant logs and/or screenshots
$ sudo ls -lah /var/backup/gitlab
total 8.0K
drwx------ 2 git root 4.0K Apr 9 10:06 .
drwx------ 5 backuppc backuppc 4.0K Apr 9 10:06 ..
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 10 Current User: git Using RVM: no Ruby Version: 2.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.24.1 Sidekiq Version:5.2.7 Go Version: unknown GitLab information Version: 12.9.2 Revision: ac5568eb5d8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.12 URL: https://labs.clic2000.fr HTTP Clone URL: https://labs.clic2000.fr/some-group/some-project.git SSH Clone URL: git@labs.clic2000.fr:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: github, gitlab, google_oauth2, bitbucket GitLab Shell Version: 12.0.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
$ sudo gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 12.0.0 ? ... OK (12.0.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Checking Reply by email ...
IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/2 ... yes 2/9 ... yes 3/13 ... yes 3/14 ... yes 3/15 ... yes 3/16 ... yes 3/17 ... yes 5/19 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.24.1) Git user has default SSH configuration? ... yes Active users: ... 2 Is authorized keys file accessible? ... yes
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
Looks like a stat problem, if I try the command under my admin user I get the same error:
$ sudo stat --printf='%U' $(readlink -f /var/backup/gitlab)
stat: missing operand
Try 'stat --help' for more information.
Thanks in advance for your help. Best,