Bug in 12.x PostgreSQL upgrade process
In an HA test environment I was installing a nightly EE package to test the service discovery stuff we recently merged. In the process, I encountered a bug in the PostgreSQL upgrade process.
Running handlers:
Running handlers complete
Chef Client finished, 8/477 resources updated in 07 seconds
gitlab Reconfigured!
Checking for an omnibus managed postgresql: OK
Checking for a newer version of PostgreSQL to install
Upgrading PostgreSQL to 10.7
Checking if we already upgraded: NOT OK
Checking if PostgreSQL bin files are symlinked to the expecChecking if PostgreSQL bin files are symlinked to the expected location: OK
Detected an HA cluster.
Traceback (most recent call last):
9: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
8: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
7: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
6: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
5: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:204:in `block in add_command_under_category'
4: from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:142:in `block in load_file'
3: from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:142:in `new'
2: from /opt/gitlab/embedded/service/omnibus-ctl-ee/lib/repmgr.rb:236:in `initialize'
1: from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:71:in `get_public_node_attributes'
/opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:52:in `parse_json_file': Attributes not found in /var/opt/gitlab/public_attributes.json, has reconfigure been run yet? (GitlabCtl::Errors::NodeError)
Ensuring PostgreSQL is updated: NOT OK
Error ensuring PostgreSQL is updated. Please check the logs
dpkg: error processing package gitlab-ee (--install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
gitlab-ee
The above error is encountered during the package install process, and happens immediately after the automatic reconfigure.
I looked at this briefly with @balasankarc via Slack. He thinks it's a bug because it's checking /var/opt/gitlab/public_attributes.json
, which does not have the normal
attribute level that Omnibus is expecting. This may have been introduced as part of !3302 (merged)