Add commands to clear Praefect state in Geo Troubleshooting doc
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
Resetting Geo secondary node replication does not mention that it's necessary to clear Praefect state
Further details
While working on internal ZD ticket we have performed a Geo secondary node replication reset, however at step 4, when running gitlab-rake geo:db:setup, we got an error:
Failed to open config/database_geo.yml. Consult the documentation on how to set up GitLab Geo.
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:191:in `set_db_env'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:187:in `ensure in with_geo_db'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:187:in `with_geo_db'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:13:in `method_missing'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/geo.rake:82:in `block (4 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
SystemExit: Failed to open config/database_geo.yml. Consult the documentation on how to set up GitLab Geo.
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:56:in `abort'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:56:in `abort_if_no_geo_config!'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:174:in `with_geo_db'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/geo/database_tasks.rb:13:in `method_missing'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/geo.rake:82:in `block (4 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => geo:db:setup => geo:db:schema:load
(See full trace by running task with --trace)
Further troubleshooting (thank you @cat) showed that another step (clearing Praefect state) is necessary
Proposal
Add commands to clear Praefect state to the document, explain when it has to be used
Who can address the issue
Geo expert
Other links/references
Edited by 🤖 GitLab Bot 🤖