0

I am using gitlab version 7.10.4 and I am trying to upgrade the installation. But I am getting this when I tried to create back up

gitlab-rake gitlab:backup:create

Errno::EPERM: Operation not permitted @ chmod_internal - db
Errno::EPERM: Operation not permitted @ chmod_internal - db
/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:1354:in `chmod'
/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:1354:in `chmod'
/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:997:in `block in chmod'
/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:996:in `each'
/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:996:in `chmod'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:19:in `block in pack'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:13:in `chdir'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:13:in `pack'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:16:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/rake:23:in `load'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => gitlab:backup:create

Please help me on this.

3
+150

Firstly, the gitlab documentation seems to think you should be running that command with sudo:

https://github.com/gitlabhq/gitlabhq/blob/7-10-stable/doc/raketasks/backup_restore.md

Based on the code:

https://github.com/gitlabhq/gitlabhq/blob/7-10-stable/lib/backup/manager.rb

It looks like it's running chmod 700 on 3 directories (repositories, db, uploads) (and failing on db) in your config's backup directory (Gitlab.config.backup.path). Based on the documentation, that Gitlab.config.backup.path variable is pulled from config/gitlab.yml. If you cant find that config file, you could temporarily add a line above /opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:19 to print out the backup dir:

puts("Backup dir is: #{Gitlab.config.backup.path}")

You might also be able to get that same information using the strace command instead:

$ strace -f gitlab-rake gitlab:backup:create 2>&1 | grep "^chdir\|^fchdir"

Once you find the backup directory, look at the db directory inside it. Standard linux permissions troubleshooting should be applied. What user are you running the command as vs what permission set does the directory have? Sudo chmod/chown as necessary.

  • I am running this command as root, and in the back up directory db, uploads have 755 permissions and repositories has 700 permission. – user9744 Jan 9 '17 at 4:30
  • I have changed the ownership of db folder, now I can take the back up. Thank you very much. – user9744 Jan 10 '17 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.