Skip to content

GitLab upgrade fails due to pg_dump version mismatch using external PostGRES

Summary

gitlab-ee-17.0.0-ee omnibus RPMs ship with an embedded pg_dump (v14.11) which doesn't work with PGSQL server versions >=15

Steps to reproduce

Upgrading from gitlab-ee-17.0.0-ee to gitlab-ee-17.0.1-ee

What is the current bug behavior?

# dnf update -y
gitlab_gitlab-ee                                                                        1.9 kB/s | 1.0 kB     00:00
gitlab_gitlab-ee-source                                                                 1.9 kB/s | 951  B     00:00
Dependencies resolved.
========================================================================================================================
 Package                 Architecture         Version                              Repository                      Size
========================================================================================================================
Upgrading:
 gitlab-ee               x86_64               17.0.1-ee.0.amazon2023               gitlab_gitlab-ee               1.0 G

Transaction Summary
========================================================================================================================
Upgrade  1 Package

Total download size: 1.0 G
Is this ok [y/N]: y
Downloading Packages:
gitlab-ee-17.0.1-ee.0.amazon2023.x86_64.rpm                                             101 MB/s | 1.0 GB     00:10
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   101 MB/s | 1.0 GB     00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                1/1
  Running scriptlet: gitlab-ee-17.0.1-ee.0.amazon2023.x86_64                                                        1/2
gitlab preinstall:
gitlab preinstall: This node does not appear to be running a database
gitlab preinstall: Skipping version check, if you think this is an error exit now
gitlab preinstall:
gitlab preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!)
2024-05-23 03:18:13 UTC -- Dumping database ...
2024-05-23 03:18:13 UTC -- Dumping PostgreSQL database gitlabhq_production ...
pg_dump: error: server version: 15.4; pg_dump version: 14.11
pg_dump: error: aborting because of server version mismatch
2024-05-23 03:18:13 UTC -- Dumping database failed: Failed to create compressed file '/gitlab/backups/db/database.sql.gz' when trying to backup the main database:
 - host: '<redacted>.us-gov-west-1.rds.amazonaws.com'
 - port: '5432'
 - database: 'gitlabhq_production'
2024-05-23 03:18:13 UTC -- Dumping repositories ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping uploads ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping builds ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping artifacts ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping pages ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping lfs objects ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping terraform states ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping container registry images ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping packages ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Dumping ci secure files ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Creating backup archive: 1716434292_2024_05_23_17.0.0-ee_gitlab_backup.tar ...
2024-05-23 03:18:13 UTC -- Creating backup archive: 1716434292_2024_05_23_17.0.0-ee_gitlab_backup.tar ... done
2024-05-23 03:18:13 UTC -- Uploading backup archive to remote storage  ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Deleting old backups ... [SKIPPED]
2024-05-23 03:18:13 UTC -- Deleting tar staging files ...
2024-05-23 03:18:13 UTC -- Cleaning up /mnt/efs/fs1/gitlab/backups/backup_information.yml
2024-05-23 03:18:13 UTC -- Cleaning up /mnt/efs/fs1/gitlab/backups/db
2024-05-23 03:18:13 UTC -- Deleting tar staging files ... done
2024-05-23 03:18:13 UTC -- Deleting backups/tmp ...
2024-05-23 03:18:13 UTC -- Deleting backups/tmp ... done
2024-05-23 03:18:13 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.
2024-05-23 03:18:13 UTC -- Backup 1716434292_2024_05_23_17.0.0-ee is done.
2024-05-23 03:18:13 UTC -- Deleting backup and restore PID file ... done
gitlab preinstall:
gitlab preinstall: Database backup failed! If you want to skip this backup, run the following command and try again:
gitlab preinstall:
gitlab preinstall:  sudo touch /etc/gitlab/skip-auto-backup
gitlab preinstall:
error: %prein(gitlab-ee-17.0.1-ee.0.amazon2023.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package gitlab-ee
  Verifying        : gitlab-ee-17.0.1-ee.0.amazon2023.x86_64                                                        1/2
  Verifying        : gitlab-ee-17.0.0-ee.0.amazon2023.x86_64                                                        2/2

Failed:
  gitlab-ee-17.0.0-ee.0.amazon2023.x86_64                    gitlab-ee-17.0.1-ee.0.amazon2023.x86_64

Error: Transaction failed

What is the expected correct behavior?

gitlab-ee omnibus packages (RPMs, DEBs) should ship with database management tools that support all of the currently supported database versions as outlined in the PostgreSQL Requirements

Relevant logs

Relevant logs

Details of package version

Provide the package version installation details