public_docs/vault_secrets_storage_relation_departed_workaround.md

1.4 KiB

  1. Get to the relation's details:

    juju run --unit ceph-osd/4 'relation-ids secrets-storage'
    

    will get you the relation id.

    juju run --unit ceph-osd/4 'relation-get -r 311 - vault/0'
    juju run --unit ceph-osd/4 'relation-get -r 311 - vault/1'
    juju run --unit ceph-osd/4 'relation-get -r 311 - vault/2'
    

    You need to query all the units (maybe just the leader is enough), to see which relation stores the ceph-osd/4_role_id and 4_token_id variables.

  2. you have the token, need to find the last-token.

    Install sqlite3 to be able to browse the unit's KV store (apt install sqlite3, not necessarily on the node, if that's not allowed).

    then fetch the last-token:

    juju ssh ceph-osd/4 sudo -i
    apt install sqlite3
    sqlite3 /var/lib/juju/agents/unit-ceph-osd-4/charm/.unit-state.db 'select data from kv where key="last-token";'
    

    Probably there are easier ways to get this data, but this works for sure.

  3. Match and update the last token id with the current one:

    juju run --unit vault/2 -- 'relation-set -r 311 ceph-osd/4_token="WHAT you got from the DB"'
    

    e.g.:

    juju run --unit vault/2 -- relation-set -r 311 ceph-osd/4_token='"s.bk3GMbPxKwgGXyODysVjihuA"'
    

    Pay attention to the escape characters and dots, etc.

  4. make sure you got the correct relation data updated.

    juju run --unit ceph-osd/4 'relation-get -r 311 - vault/2'