gitlab-ctl pg-upgrade can fail with cryptic error messages when PostgreSQL is not running
When PostgreSQL is not running the command sudo gitlab-ctl pg-upgrade
will eventually fail with the following error:
Please hit Ctrl-C now if you want to cancel the upgrade
..............................(eval):221:in `rescue in get_command_output': Omnibus::Ctl::ExecutionError (Omnibus::Ctl::ExecutionError)
from (eval):218:in `get_command_output'
from (eval):261:in `run_query'
from (eval):267:in `fetch_lc_collate'
from (eval):141:in `block in load_file'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.3.6/lib/omnibus-ctl.rb:181:in `block in add_command_under_category'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.3.6/lib/omnibus-ctl.rb:575:in `run'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.3.6/bin/omnibus-ctl:31:in `<top (required)>'
from /opt/gitlab/embedded/bin/omnibus-ctl:22:in `load'
from /opt/gitlab/embedded/bin/omnibus-ctl:22:in `<main>'
This error does not tell the user what's going on at all. I found out this was caused by PostgreSQL not running, but only because I remembered shutting it down explicitly.