juju remove-application vault stuck at unresolvable hook error for secrets-relation-departed

Bug #1821187 reported by John George
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
vault-charm
Triaged
Medium
Unassigned

Bug Description

Removed vault with: juju remove-application vault

Two of the three units were removed without issues. The final unit went into an error state for the secrets-relation-departed hook. juju resolved with and without --no-retry did not allow the removal to proceed. In the end the workaround was to use juju remove-machine --force to clean up the model.

The vault unit log has this traceback:

2019-03-21 13:37:08 DEBUG secrets-relation-departed Traceback (most recent call last):
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/charm/hooks/secrets-relation-departed", line 22, in <module>
2019-03-21 13:37:08 DEBUG secrets-relation-departed main()
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/.venv/lib/python3.5/site-packages/charms/reactive/__init__.py", line 73, in main
2019-03-21 13:37:08 DEBUG secrets-relation-departed bus.dispatch(restricted=restricted_mode)
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 390, in dispatch
2019-03-21 13:37:08 DEBUG secrets-relation-departed _invoke(other_handlers)
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 359, in _invoke
2019-03-21 13:37:08 DEBUG secrets-relation-departed handler.invoke()
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 181, in invoke
2019-03-21 13:37:08 DEBUG secrets-relation-departed self._action(*args)
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/charm/reactive/vault_handlers.py", line 221, in configure_vault_mysql
2019-03-21 13:37:08 DEBUG secrets-relation-departed configure_vault(context)
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/charm/reactive/vault_handlers.py", line 169, in configure_vault
2019-03-21 13:37:08 DEBUG secrets-relation-departed ca=context['etcd_tls_ca_file'])
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/charm/reactive/vault_handlers.py", line 109, in save_etcd_client_credentials
2019-03-21 13:37:08 DEBUG secrets-relation-departed write_file(key, credentials['client_key'], perms=0o600)
2019-03-21 13:37:08 DEBUG secrets-relation-departed File "/var/lib/juju/agents/unit-vault-1/.venv/lib/python3.5/site-packages/charmhelpers/core/host.py", line 560, in write_file
2019-03-21 13:37:08 DEBUG secrets-relation-departed target.write(content)
2019-03-21 13:37:08 DEBUG secrets-relation-departed TypeError: a bytes-like object is required, not 'NoneType'
2019-03-21 13:37:08 ERROR juju.worker.uniter.operation runhook.go:132 hook "secrets-relation-departed" failed: exit status 1

John George (jog)
tags: added: cpe-onsite
Ryan Beisner (1chb1n)
summary: - juju remove-appllication vault stuck at unresolvable hook error for
+ juju remove-application vault stuck at unresolvable hook error for
secrets-relation-departed
Changed in vault-charm:
milestone: none → 19.04
importance: Undecided → Medium
tags: added: scaleback
Revision history for this message
Cory Johns (johnsca) wrote :

I think the issue actually lies in the etcd interface layer. The Vault code already has the failing code behind a check for the etcd.tls.available flag, which shouldn't be set if any of those values are None.

It looks like there need to be some else conditions added to the following to remove the flag if any of the fields are cleared before the relation is broken: https://github.com/juju-solutions/interface-etcd/blob/master/requires.py#L30-L36

David Ames (thedac)
Changed in vault-charm:
milestone: 19.04 → 19.07
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

I raised the above issue on the interface-etcd repo to track this issue there as well

Changed in vault-charm:
status: New → Triaged
David Ames (thedac)
Changed in vault-charm:
milestone: 19.07 → 19.10
David Ames (thedac)
Changed in vault-charm:
milestone: 19.10 → 20.01
James Page (james-page)
Changed in vault-charm:
milestone: 20.01 → 20.05
David Ames (thedac)
Changed in vault-charm:
milestone: 20.05 → 20.08
James Page (james-page)
Changed in vault-charm:
milestone: 20.08 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.