Gitlab pre-upgrade script ignores `postgresql['user_path']` option
Pre-upgrade script in Debian Omnibus package uses /opt/gitlab/.../pg_dump
instead of using /usr/bin/pg_dump
, even if I configured postgresql['user_path']
to preffer system binaries:
postgresql['enable'] = false
postgresql['user_path'] = "$PATH:/opt/gitlab/embedded/bin:/opt/gitlab/bin"
Then upgrade fails with message:
gitlab preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!)
Dumping database ...
Dumping PostgreSQL database gitlab ... pg_dump: server version: 9.5.2; pg_dump version: 9.2.15
pg_dump: aborting because of server version mismatch
[FAILED]
Backup failed
The 9.5.2 is system installation (native Debian package) and its /usr/bin/pg_dump should be used.
Then I skip auto migrations and run gitlab-ctl reconfigure
manually and everything works.
Fixing this should also fix gitlab-org/gitlab-ce#3399.