'gitlab-backup create' runs without error but creates no backup

Hello everybody,

When I attempt to create a backup of my GitLab running in a Docker container using sudo docker exec -t gitlab-gitlab-1 gitlab-backup create, i get the following output:

2025-01-23 12:00:28 UTC -- Dumping database ... 
2025-01-23 12:00:28 UTC -- Dumping PostgreSQL database gitlabhq_production ... 
2025-01-23 12:00:32 UTC -- [DONE]
2025-01-23 12:00:32 UTC -- Dumping database ... done
2025-01-23 12:00:32 UTC -- Dumping repositories ... 
...
2025-01-23 12:00:34 UTC -- Dumping repositories ... done
2025-01-23 12:00:34 UTC -- Dumping uploads ... 
2025-01-23 12:00:34 UTC -- Dumping uploads ... done
2025-01-23 12:00:34 UTC -- Dumping builds ... 
2025-01-23 12:00:34 UTC -- Dumping builds ... done
2025-01-23 12:00:34 UTC -- Dumping artifacts ... 
2025-01-23 12:00:34 UTC -- Dumping artifacts ... done
2025-01-23 12:00:34 UTC -- Dumping pages ... 
2025-01-23 12:00:34 UTC -- Dumping pages ... done
2025-01-23 12:00:34 UTC -- Dumping lfs objects ... 
2025-01-23 12:00:34 UTC -- Dumping lfs objects ... done
2025-01-23 12:00:34 UTC -- Dumping terraform states ... 
2025-01-23 12:00:34 UTC -- Dumping terraform states ... done
2025-01-23 12:00:34 UTC -- Dumping container registry images ... [DISABLED]
2025-01-23 12:00:34 UTC -- Dumping packages ... 
2025-01-23 12:00:34 UTC -- Dumping packages ... done
2025-01-23 12:00:34 UTC -- Dumping ci secure files ... 
2025-01-23 12:00:34 UTC -- Dumping ci secure files ... done
2025-01-23 12:00:34 UTC -- Dumping external diffs ... 
2025-01-23 12:00:34 UTC -- Dumping external diffs ... done
2025-01-23 12:00:34 UTC -- Creating backup archive: 1737633628_2025_01_23_17.7.1_gitlab_backup.tar ... 
2025-01-23 12:00:34 UTC -- Creating backup archive: 1737633628_2025_01_23_17.7.1_gitlab_backup.tar ... done
2025-01-23 12:00:34 UTC -- Uploading backup archive to remote storage  ... [SKIPPED]
2025-01-23 12:00:34 UTC -- Deleting old backups ... [SKIPPED]
2025-01-23 12:00:34 UTC -- Deleting tar staging files ... 
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/backup_information.yml
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/db
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/repositories
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/uploads.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/builds.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/artifacts.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/pages.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/lfs.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/terraform_state.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/packages.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/ci_secure_files.tar.gz
2025-01-23 12:00:34 UTC -- Cleaning up /var/opt/gitlab/backups/external_diffs.tar.gz
2025-01-23 12:00:34 UTC -- Deleting tar staging files ... done
2025-01-23 12:00:34 UTC -- Deleting backups/tmp ... 
2025-01-23 12:00:34 UTC -- Deleting backups/tmp ... done
2025-01-23 12:00:34 UTC -- 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.
2025-01-23 12:00:34 UTC -- Backup 1737633628_2025_01_23_17.7.1 is done.
2025-01-23 12:00:34 UTC -- Deleting backup and restore PID file at [/opt/gitlab/embedded/service/gitlab-rails/tmp/backup_restore.pid] ... done

Afterwards, my GITLAB_HOME/data/backups directory is as empty as before.
I have not changed anything in gitlab.rb, all variables have been set in my docker-compose.yml (located in my GITLAB_HOME directory):

version: '3.6'

services:
  gitlab:
    image: gitlab/gitlab-ce:17.7.1-ce.0
    restart: always
    hostname: <hostname>
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url <url>
        gitlab_rails['gitlab_shell_ssh_port'] = <sshport>
        gitlab_rails['smtp_enable'] = true
        gitlab_rails['smtp_address'] = "mailcowdockerized-postfix-mailcow-1"
        gitlab_rails['smtp_port'] = 587 
        gitlab_rails['smtp_user_name'] =<mail>
        gitlab_rails['smtp_password'] = <pw>
        gitlab_rails['smtp_domain'] = <mail>
        gitlab_rails['smtp_authentication'] = "login"
        gitlab_rails['smtp_enable_starttls_auto'] = true
        gitlab_rails['smtp_tls'] = false
        gitlab_rails['smtp_openssl_verify_mode'] = 'none'
        gitlab_rails['gitlab_email_enabled'] = true
        gitlab_rails['gitlab_email_from'] = <mail>
        nginx['listen_https'] = false
        nginx['listen_port'] = <port>
    ports:
      - '<port>:<port>'
      - '<port>:443'
      - '<port>:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'
    networks:
      - mailcowdockerized_mailcow-network
networks:
  mailcowdockerized_mailcow-network:
    external: true

I have no experience with running GitLab in a docker container, but in omnibus installs the default location for placing backups are /var/opt/gitlab/backups, have you looked there?

1 Like

/var/opt/gitlab/backups in the docker container is mounted to $GITLAB_HOME/data, so everything in /gitlabshould be in /data- however, double checking after your reply made me realize that my $GITLAB_HOME variable had not been set correctly and as a result pointed to /. So thanks a lot, i guess :smiley: