-
What am I trying to do? Something similar to:
https://forum.cloudron.io/topic/5704/gitlab-how-to-restore-migrate-a-non-cloudron-gitlabBut I need to migrate the Cloudron Gitlab away to a dedicated Server due to resource issues and customer wishes.
Error:
root@26622ff4-eec8-4ac4-be62-55703ffff82c:~/gitlab# sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production `/home/git` is not writable. Bundler will use `/tmp/bundler20220623-490-1xzsyv7490' as your home directory temporarily. 2022-06-23 07:59:32 +0000 -- Dumping database ... Dumping PostgreSQL database db26622ff4eec84ac4be6255703ffff82c ... [DONE] 2022-06-23 07:59:37 +0000 -- Dumping database ... done 2022-06-23 07:59:37 +0000 -- Dumping repositories ... rake aborted! Backup::Error: gitaly-backup binary not found and gitaly_backup_path is not configured /home/git/gitlab/lib/backup/gitaly_backup.rb:109:in `bin_path' /home/git/gitlab/lib/backup/gitaly_backup.rb:46:in `start' /home/git/gitlab/lib/backup/repositories.rb:18:in `dump' /home/git/gitlab/lib/backup/manager.rb:90:in `run_create_task' /home/git/gitlab/lib/backup/manager.rb:54:in `block in create' /home/git/gitlab/lib/backup/manager.rb:53:in `each' /home/git/gitlab/lib/backup/manager.rb:53:in `create' /home/git/gitlab/lib/tasks/gitlab/backup.rake:12:in `block (3 levels) in <top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/sentry-ruby-core-5.1.1/lib/sentry/rake.rb:26:in `execute' /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>' Tasks: TOP => gitlab:backup:create (See full trace by running task with --trace)
note:
Ddefining thegitaly_backup_path
in the/app/data/gitlab.yml
did not solve the problem. -
-
Good catch! The gitaly-backup binary's path changed recently. The config has to be fixed.
- gitaly_backup_path: /home/git/gitaly/gitaly-backup + gitaly_backup_path: /home/git/gitaly/bin/gitaly-backup
I am making a new package. For existing packages, just change the path in
/app/data/gitlab.yml
as above. -
Hi @BrutalBirdie,
speaks about specifying the option directly in one of the ruby files, did you try that out as well already?
-
@BrutalBirdie in the past I had to adjust $PATH for a few things within the Cloudron app container, so I thought that may be the case here as well.
In general
gitaly-backup
can be found in the container I assume? -
@fbartels said in Gitlab App - Can't create backup within the app:
In general gitaly-backup can be found in the container I assume?
I am not sure what exactly you mean to be found. The config variable or the file?
Will tinker around a bit. -
eh what?
Now if I configure thegitaly_backup_path: "/app/data/gitaly_backups"
and restart the app I get this error.root@682bad9d-d3a7-4cc4-ae7e-d580c33a95b0:~/gitlab# sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production `/home/git` is not writable. Bundler will use `/tmp/bundler20220623-372-1k6ylrl372' as your home directory temporarily. 2022-06-23 14:34:55 +0000 -- Dumping database ... Dumping PostgreSQL database db682bad9dd3a74cc4ae7ed580c33a95b0 ... [DONE] 2022-06-23 14:35:00 +0000 -- Dumping database ... done 2022-06-23 14:35:00 +0000 -- Dumping repositories ... rake aborted! Errno::EACCES: Permission denied - /app/data/gitaly_backups/ /home/git/gitlab/lib/backup/gitaly_backup.rb:46:in `start' /home/git/gitlab/lib/backup/repositories.rb:18:in `dump' /home/git/gitlab/lib/backup/manager.rb:90:in `run_create_task' /home/git/gitlab/lib/backup/manager.rb:54:in `block in create' /home/git/gitlab/lib/backup/manager.rb:53:in `each' /home/git/gitlab/lib/backup/manager.rb:53:in `create' /home/git/gitlab/lib/tasks/gitlab/backup.rake:12:in `block (3 levels) in <top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/sentry-ruby-core-5.1.1/lib/sentry/rake.rb:26:in `execute' /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>' Tasks: TOP => gitlab:backup:create (See full trace by running task with --trace)
But the permissions for that folder are for the user
git
and even777
-
@BrutalBirdie the way i am reading the documentation gitaly-backup is a "binary"/executable, not the path the backup is written to.
-
-
Good catch! The gitaly-backup binary's path changed recently. The config has to be fixed.
- gitaly_backup_path: /home/git/gitaly/gitaly-backup + gitaly_backup_path: /home/git/gitaly/bin/gitaly-backup
I am making a new package. For existing packages, just change the path in
/app/data/gitlab.yml
as above. -
Works after fixing the path .
root@34645fd4-1a6a-4d03-9dfb-9123208954aa:~/gitlab# sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production `/home/git` is not writable. Bundler will use `/tmp/bundler20220623-326-4sq0sl326' as your home directory temporarily. 2022-06-23 17:38:30 +0000 -- Dumping database ... Dumping PostgreSQL database db34645fd41a6a4d039dfb9123208954aa ... [DONE] 2022-06-23 17:38:39 +0000 -- Dumping database ... done 2022-06-23 17:38:39 +0000 -- Dumping repositories ... {"command":"create","gl_project_path":"gitlab-instance-7c84d838/Monitoring","level":"info","msg":"started create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git","storage_name":"default","time":"2022-06-23T17:38:40.750Z"} {"command":"create","error":"manager: repository empty: repository skipped","gl_project_path":"gitlab-instance-7c84d838/Monitoring","level":"warning","msg":"skipped create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git","storage_name":"default","time":"2022-06-23T17:38:40.776Z"} {"command":"create","gl_project_path":"gitlab-instance-7c84d838/Monitoring.wiki","level":"info","msg":"started create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki.git","storage_name":"default","time":"2022-06-23T17:38:41.125Z"} {"command":"create","gl_project_path":"gitlab-instance-7c84d838/Monitoring","level":"info","msg":"started create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.design.git","storage_name":"default","time":"2022-06-23T17:38:41.129Z"} {"command":"create","error":"manager: repository empty: repository skipped","gl_project_path":"gitlab-instance-7c84d838/Monitoring","level":"warning","msg":"skipped create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.design.git","storage_name":"default","time":"2022-06-23T17:38:41.133Z"} {"command":"create","error":"manager: repository empty: repository skipped","gl_project_path":"gitlab-instance-7c84d838/Monitoring.wiki","level":"warning","msg":"skipped create","relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.wiki.git","storage_name":"default","time":"2022-06-23T17:38:41.145Z"} 2022-06-23 17:38:41 +0000 -- Dumping repositories ... done 2022-06-23 17:38:41 +0000 -- Dumping uploads ... 2022-06-23 17:38:41 +0000 -- Dumping uploads ... done 2022-06-23 17:38:41 +0000 -- Dumping builds ... 2022-06-23 17:38:41 +0000 -- Dumping builds ... done 2022-06-23 17:38:41 +0000 -- Dumping artifacts ... 2022-06-23 17:38:41 +0000 -- Dumping artifacts ... done 2022-06-23 17:38:41 +0000 -- Dumping pages ... 2022-06-23 17:38:41 +0000 -- Dumping pages ... done 2022-06-23 17:38:41 +0000 -- Dumping lfs objects ... 2022-06-23 17:38:41 +0000 -- Dumping lfs objects ... done 2022-06-23 17:38:41 +0000 -- Dumping terraform states ... 2022-06-23 17:38:41 +0000 -- Dumping terraform states ... done 2022-06-23 17:38:41 +0000 -- Dumping container registry images ... [DISABLED] 2022-06-23 17:38:41 +0000 -- Dumping packages ... 2022-06-23 17:38:41 +0000 -- Dumping packages ... done 2022-06-23 17:38:41 +0000 -- Creating backup archive: 1656005910_2022_06_23_15.0.3_gitlab_backup.tar ... 2022-06-23 17:38:41 +0000 -- Creating backup archive: 1656005910_2022_06_23_15.0.3_gitlab_backup.tar ... done 2022-06-23 17:38:41 +0000 -- Uploading backup archive to remote storage ... [SKIPPED] 2022-06-23 17:38:41 +0000 -- Deleting tar staging files ... 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/backup_information.yml 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/db 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/uploads.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/builds.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/artifacts.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/pages.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/lfs.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/terraform_state.tar.gz 2022-06-23 17:38:41 +0000 -- Cleaning up /app/data/backups/packages.tar.gz 2022-06-23 17:38:41 +0000 -- Deleting tar staging files ... done 2022-06-23 17:38:41 +0000 -- Deleting old backups ... [SKIPPED] 2022-06-23 17:38:41 +0000 -- Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data and are not included in this backup. You will need these files to restore a backup. Please back them up manually. 2022-06-23 17:38:41 +0000 -- Backup 1656005910_2022_06_23_15.0.3 is done.
-