Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #6064

Closed
Open
Created Jan 15, 2014 by Administrator@rootOwner

Backup restore not setting correct permissions on /home/git/repositories/

Created by: d1

I'm using an internally developed Chef cookbook to build gitlab v6.4.3 and I'm seeing the backup restore process not set the correct permissions on /home/git/repositories/.

Steps To Reproduce:

# Build a fresh instance
$ vagrant destroy && vagrant up && vagrant ssh
$ cd /home/git/gitlab

# Run gitlab:check, all checks should pass
$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

# Copy a backup into place and restore
$ sudo -u git -H cp /vagrant/<timestamp>_gitlab_backup.tar /home/git/gitlab/tmp/backups/
$ sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production

# Re-run gitlab:check, the check of permissions on /home/git/gitlab should fail
$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

After the restore, the permissions look like this:

$ ls -l /home/git/
...
drwxrwxr-x  5 git git     4096 Jan 15 11:12 repositories
drwxrws---  3 git git     4096 Jan 15 11:01 repositories.old.1389805956

Running the commands suggested by the check, or re-converging the node via Chef, will fix the permissions.

I'm assuming this is because the restore moves the current /home/git/repositories/ to /home/git/repositories.old.<timestamp>/ and then creates a new /home/git/repositories/. It also could be that the backup creation should be capturing the permissions acurately.

I'll look deeper and submit a PR unless someone can tell me I'm crazy or doing something wrong.

Assignee
Assign to
Time tracking