Skip to content

gitlab-ctl patroni: More useful error message when no config is found

What does this MR do?

Resolves #6267 (closed). This addition of an output message appears as the following, when run on a non-Patroni node:

# gitlab-ctl patroni members
Error while running members: This node has no Patroni configuration, which means:
  - either your Omnibus is misconfigured,
  - or you need to run this command on a database node.

Instead of currently:

# gitlab-ctl patroni members
Error while running members: undefined method `[]' for nil:NilClass

See also diff comments for details. I realize that this is a rather extensive change, for a possibly rare user interaction edgecase. However, I suggest that it's important for each error message to provide a useful pointer to proceed.

Related issues

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by DJ Mountney

Merge request reports

Loading