Updating gitlab to 8.17.0-rc3 fails with postgresql v. 9.2.18
Running apt-get update and apt-get upgrade with gitlab still running on posgresql v9.2.18 will fail due to missconfigured postgresql.
sudo apt-get update
sudo apt-get upgrade
Setting up gitlab-ce (8.17.0-rc3.ce.1) ...
*. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:
sudo gitlab-ctl reconfigure
gitlab: GitLab should be reachable at https://git.1manprojects.de
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
gitlab: GitLab now ships with a newer version of PostgreSQL (9.6.1), and will be used
gitlab: as the default in the next major release. To upgrade, RUN THE FOLLOWING COMMANDS:
sudo gitlab-ctl pg-upgrade
gitlab: For more details, please see:
gitlab: https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server
gitlab:
Shutting down all GitLab services except those needed for migrations
ok: down: gitlab-workhorse: 2362s, normally up
ok: down: logrotate: 0s, normally up
ok: down: postgresql: 0s, normally up, want up
ok: down: redis: 0s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 2361s, normally up
Checking PostgreSQL executables:Starting Chef Client, version 12.12.15
resolving cookbooks for run list: ["gitlab::postgresql-bin"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- package (0.0.0)
- runit (0.14.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: gitlab::postgresql-bin
* ruby_block[Link postgresql bin files to the correct version] action run (skipped due to only_
Running handlers:
Running handlers complete
Chef Client finished, 0/1 resources updated in 08 seconds
Checking PostgreSQL executables: OK
timeout: down: postgresql: 1s, normally up, want up
ok: run: redis: (pid 6132) 1s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3385s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3386s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3387s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3388s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3389s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3390s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3391s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3392s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3393s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3394s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3395s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3396s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3397s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3398s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3399s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3400s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3401s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3402s
down: postgresql: 1s, normally up, want up; run: log: (pid 537) 3403s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3404s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3405s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3406s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3407s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3408s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3409s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3410s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3411s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3412s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3413s
down: postgresql: 0s, normally up, want up; run: log: (pid 537) 3414s
Failed to start postgresql for migrations
dpkg: error processing package gitlab-ce (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
gitlab-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
After this failed update Gitlab is unreachable and running gitlab-ctl reconfigure will also fail with postgrsql errors
PG::Error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket
The PostgreSQL log contains the follwowing Information
unrecognized configuration parameter "max_replication_slots" in file "/var/opt/gitlab/postgresql/data/postgresql.conf" line 210
2017-02-16_12:21:07.61285 FATAL: configuration file "/var/opt/gitlab/postgresql/data/postgresql.conf" contains errors
Removing the "max_replications_slots = 0" line from /var/opt/gitlab/postgresql/data/postgresql.conf and Gitlab-ctl will now startup normaly.
sudo gitlab-ctl start
ok: run: gitlab-workhorse: (pid 6367) 1s
ok: run: logrotate: (pid 6374) 0s
ok: run: postgresql: (pid 6347) 8s
ok: run: redis: (pid 6132) 160s
ok: run: sidekiq: (pid 6382) 0s
ok: run: unicorn: (pid 6385) 1s
sudo gitlab-ctl status
run: gitlab-workhorse: (pid 6367) 27s; run: log: (pid 541) 3570s
run: logrotate: (pid 6374) 26s; run: log: (pid 542) 3570s
run: postgresql: (pid 6347) 34s; run: log: (pid 537) 3570s
run: redis: (pid 6132) 186s; run: log: (pid 538) 3570s
run: sidekiq: (pid 6382) 26s; run: log: (pid 539) 3570s
run: unicorn: (pid 6385) 26s; run: log: (pid 540) 3570s
Gitlab is now reachable again per webbroswer however still is running older postgresql version
Gitlab shows the components as following
GitLab 8.17.0-rc3
GitLab Shell 4.1.1
GitLab Workhorse 1.3.0
GitLab API v4
Git 2.10.2
Ruby 2.3.3p222
Rails 4.2.7.1
postgresql 9.2.18
running gitlab-ctl reconfigure will insert "max_replications_slots = 0" again and fail with
timeout: down: postgresql: 1s, normally up, want up
Also running apt-get update and apt-get upgrade again will break postgresql again as the upgrade will run again inserting max_replications_slots = 0 to the config file again.
To Fix the "max_replication_slots" needs to be removed and then the postgresql needs to be upgraded with
sudo gitlab-ctl pg-upgrade
running gitlab-ctl pg-upgrade without removing the line in the config will result in a failure again. The database upgrad schould be run bevor inserting a unrecognized configuration parameter into the postgresql settings.
Gitlab running on a RaspberryPi Model 3, Debian 8.0 with Apache 2.4