canonical / postgresql-operator

A Charmed Operator for running PostgreSQL on machines
https://charmhub.io/postgresql
Apache License 2.0
8 stars 19 forks source link

When wrongly configuring s3-integrator Postgresql charm will get stuck in error state and needs to be redeployed #661

Open gustavosr98 opened 1 hour ago

gustavosr98 commented 1 hour ago

Steps to reproduce

Deploy postgresql charm Follow backup and restore tutorial I forgot to set up tls-ca-chain config that was required in this case And now postgresql charm gets stuck in error state not being able to get out of it wihout hacking inside charm hooks or redeploying it

Expected behavior

Not to get stuck in error state if the user makes a configuration mistake but to get into blocked state

Actual behavior

# juju status
[..]
postgresql/0                 active    idle   0        192.168.30.106  5432/tcp
postgresql/1*                error     idle   1        192.168.30.138  5432/tcp  hook failed: "s3-parameters-relation-changed"
postgresql/2                 active    idle   2        192.168.30.152  5432/tcp

You can NOT get out of this state even

Versions

Operating system: Ubuntu 22.04 Juju: 3.5.4 Charm revision: 14/stable rev468

Log output

Did not collect it at the moment

Additional context

You could hackily get out of this situation wihout redeploying by skipping the hook and then removing the relation

  1. On a terminal "A"

    juju debug-hooks postgresql/1
    # Now you are on a tmux session waiting for a hook to get triggered
  2. On a terminal "B"

    juju resolved postgresql/1
    # Trigget the hook to re-run
  3. On terminal "A"

    # tmux session is waiting for you to manually execute the reaction to the s3-parameters-relation-changed hook
    exit 0
    # to make juju belive the hook was run okay
    exit
    # to exit the juju-debug session

Now the hook has been skipped and you can remove the relation Update the config And re-add the relation with the proper configuration

syncronize-issues-to-jira[bot] commented 1 hour ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5713.

This message was autogenerated