This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
"unsupported operand type" error during unit teardown caused by stale certificates.server.cert.available flag #22
Comments
To give a little more precise context, here is a snippet of juju unit logs during a dispatch loop just before the error started to occur:
And once 2 of the 3 vault units went away, including the one holding the cert info for the related unit where this error occurred, here's what I saw instead:
|
While this may not work for everyone, in my particular case I was able to work around this issue and unblock unit removal by running the following SQL against the /.unit-state.db sqlite3 DB: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If, during removal of a unit using layer:tls-client and interface:tls-certificate, if layer:tls-client's store_server handler gets queued to run before interface:tls-certificate's TlsRequires.joined() method, it can result in errors during teardown under certain circumstances.
This can trigger the following failure:
I have a few units which have hit this issue, which I was attempting to remove from the model when this occurred. They're related to vault, and were formerly related to 3 units, but only one unit remains related. This unit does not have the <unit>.server.cert nor <unit>.server.key values for the unit in question, nor are there any <unit>.processed_requests fields present in the relation either for that unit, and thus TlsRequires.get_server_cert() will return (None, None).
This wouldn't be a problem if layer:tls-client's store_server handler wasn't called. And it shouldn't be called... except that it fires on certificates.server.cert.available, which should be cleared when TlsRequires.joined() is called, except that it won't be called until after store_server is.
Thus, store_server is called, thinking it has a cert to store, when in fact it does not. It pulls get_server_cert, gets a bunch of nothing back, and things blow up as described in the above traceback.
The text was updated successfully, but these errors were encountered: