Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix panic when connection to controller fails #1415

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

SimoneDutto
Copy link
Contributor

Description

This pr fixes a bug that causes Jimm to panic when it is issued juju status on a not-existing model.

I think this bug is even bigger because Jimm will crash on a failing controller's connection generally.

How to reproduce the bug

  • set a qa environment with make qa-microk8s
  • remove from the database the model (ex. make dev-env-cleanup and make dev-env again)
  • juju status

Jimm will panic. It can't find the model in the database, so it is not able to create the connection. Therefore, it will later try to read Json from a nil connection.

This fix returns the error and adds a test for it.

Before the fix

image
and juju status hangs

After the fix

image
juju status will return ERROR model not found (not found)

Fixes JIRA/GitHub issue number

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

Test instructions

Notes for code reviewers

@SimoneDutto SimoneDutto requested a review from a team as a code owner October 23, 2024 15:26
Copy link
Collaborator

@alesstimec alesstimec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good find, thanks!

@SimoneDutto SimoneDutto merged commit f89b63e into canonical:v3 Oct 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants