Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Gitlab App - Can't create backup within the app

    GitLab
    3
    9
    534
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BrutalBirdie
      BrutalBirdie Staff last edited by

      What am I trying to do? Something similar to:
      https://forum.cloudron.io/topic/5704/gitlab-how-to-restore-migrate-a-non-cloudron-gitlab

      But 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 the gitaly_backup_path in the /app/data/gitlab.yml did not solve the problem.

      Like my work? Consider donating a beer 🍻 Cheers!

      fbartels 1 Reply Last reply Reply Quote 0
      • Topic has been marked as a question  BrutalBirdie BrutalBirdie 
      • girish
        girish Staff last edited by girish

        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.

        1 Reply Last reply Reply Quote 1
        • fbartels
          fbartels App Dev @BrutalBirdie last edited by

          Hi @BrutalBirdie,

          https://docs.gitlab.com/ee/raketasks/backup_restore.html#gitaly-backup-for-repository-backup-and-restore

          speaks about specifying the option directly in one of the ruby files, did you try that out as well already?

          BrutalBirdie 1 Reply Last reply Reply Quote 0
          • BrutalBirdie
            BrutalBirdie Staff @fbartels last edited by

            @fbartels did not try that but also what's the point when he also can't find the binary as well.

            Like my work? Consider donating a beer 🍻 Cheers!

            fbartels 1 Reply Last reply Reply Quote 0
            • fbartels
              fbartels App Dev @BrutalBirdie last edited by

              @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?

              BrutalBirdie 1 Reply Last reply Reply Quote 0
              • BrutalBirdie
                BrutalBirdie Staff @fbartels last edited by BrutalBirdie

                @fbartels

                @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.

                Like my work? Consider donating a beer 🍻 Cheers!

                BrutalBirdie 1 Reply Last reply Reply Quote 0
                • BrutalBirdie
                  BrutalBirdie Staff @BrutalBirdie last edited by BrutalBirdie

                  eh what?
                  Now if I configure the gitaly_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 even 777

                  Like my work? Consider donating a beer 🍻 Cheers!

                  fbartels 1 Reply Last reply Reply Quote 0
                  • fbartels
                    fbartels App Dev @BrutalBirdie last edited by

                    @BrutalBirdie the way i am reading the documentation gitaly-backup is a "binary"/executable, not the path the backup is written to.

                    1 Reply Last reply Reply Quote 0
                    • Moved from Support by  girish girish 
                    • girish
                      girish Staff last edited by girish

                      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.

                      1 Reply Last reply Reply Quote 1
                      • girish
                        girish Staff last edited by

                        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.
                        
                        1 Reply Last reply Reply Quote 1
                        • Topic has been marked as solved  BrutalBirdie BrutalBirdie 
                        • First post
                          Last post
                        Powered by NodeBB