Error in `promote-to-primary-node` in `git_user_home`: undefined method `[]` for nil:NilClass (NoMethodError)
Summary
During Disaster Recovery https://docs.gitlab.com/ee/gitlab-geo/disaster-recovery.html#promoting-a-secondary-node, the gitlab-ctl promote-to-primary-node
script fails with an error (see below)
What is the current bug behavior?
root@mike-demo-2a:~# gitlab-ctl promote-to-primary-node
---------------------------------------
WARNING: Make sure your primary is down and also be aware that
this command only works for setups with one secondary.
If you have more of them please follow documentation in https://docs.gitlab.com/ee/gitlab-geo/disaster-recovery.html
---------------------------------------
*** Are you sure? (N/y): y
Promoting the Postgres to primary...
/opt/gitlab/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary.rb:30:in `git_user_home': undefined method `[]' for nil:NilClass (NoMethodError)
from /opt/gitlab/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary.rb:104:in `key_path'
from /opt/gitlab/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary.rb:60:in `remove_ssh_keys'
from /opt/gitlab/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary.rb:18:in `execute'
from /opt/gitlab/embedded/service/omnibus-ctl-ee/promote_to_primary_node.rb:21:in `block in load_file'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:202:in `block in add_command_under_category'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:730:in `run'
from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/bin/omnibus-ctl:31:in `<top (required)>'
from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
What is the expected correct behavior?
Completion of the script with no error.