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

Signatory 1.1.0 using GCP HSM don't start anymore when there are destroyed key #383

Closed
Mayeu opened this issue Jun 29, 2023 · 6 comments
Closed
Assignees
Labels
bug Something isn't working gcp

Comments

@Mayeu
Copy link
Contributor

Mayeu commented Jun 29, 2023

Hello,

The last version of Signatory (1.1.0) doesn't start anymore when the first key available in GCP HSM is destroyed.

We are in a situation where our mainnet baking keyring contains two keys:
Screenshot 2023-06-29 at 08 44 02

The first one only contains one version that has been destroyed since we had an issue during our initial key generation ceremony:
Screenshot 2023-06-29 at 08 44 25

The second one contains our current active key:
Screenshot 2023-06-29 at 08 44 36

It seems that some of the changes between 1.0.0-beta3 and 1.1.0 broke the key selection logic. I see that the external library used to interact with cloudKMS has been upgraded, and that the cloudKMSIterator function got changed as well.

When starting signatory we get the following error message:

Jun 29 06:20:34 signatory-WWWW signatory[1186]: {"level":"info","msg":"Initializing vault","time":"2023-06-29T06:20:34Z","vault":"cloudkms","vault_name":"kms"}
Jun 29 06:20:35 signatory-WWWW signatory[1186]: Error: (CloudKMS/projects/XXXXXXXXXX/locations/global/keyRings/YYYYYYY) getPublicKey: rpc error: code = FailedPrecondition desc = projects/XXXXXXXXXX/locations/global/keyRings/YYYYYYY/cryptoKeys/signatory-imported-2ZZZZZZZZZZZZZZZZZZZZ6/cryptoKeyVersions/1 is not enabled, current state is: DESTROYED.
Jun 29 06:20:35 signatory-WWWW signatory[1186]: error details: name = PreconditionFailure type = KEY_DESTROYED subj = projects/XXXXXXXXXX/locations/global/keyRings/YYYYYYY/cryptoKeys/signatory-imported-2ZZZZZZZZZZZZZZZZZZZZ6/cryptoKeyVersions/1 desc =

Beside the upgrade of Signatory, there was no other configuration changes on our side between those two versions.

Happy to provide more details if you need anything else.

@stephengaudet stephengaudet self-assigned this Jun 29, 2023
@stephengaudet
Copy link
Contributor

thank you for taking the time to communicate this issue to us @Mayeu
I'm able to reproduce the issue you describe and a fix should be made soon.

@stephengaudet stephengaudet added bug Something isn't working gcp labels Jun 29, 2023
@Mayeu
Copy link
Contributor Author

Mayeu commented Jul 2, 2023

Thank you @stephengaudet, if you need me to try out the PR before merging just warn me, I can do that on monday.

@stephengaudet
Copy link
Contributor

stephengaudet commented Jul 3, 2023

thank you for the assistance @Mayeu but I went ahead and merged the fix to main. Signatory integration tests now have a key in GCP with only destroyed versions, so, I merged the fix in order to keep our builds passing.

you may want to stay on v1.0.0-beta for another short time while I test the fix for another new issue #379

I expect to make a new release v1.1.1 shortly that will have fixes for both this issue you've raised, and #379

thank you kindly

@stephengaudet
Copy link
Contributor

good day @Mayeu , Signatory v1.1.1 has been released and fixes this issue. thank you for letting us know. please do let me know if v1.1.1 fixes the startup failure.

@Mayeu
Copy link
Contributor Author

Mayeu commented Jul 7, 2023

@stephengaudet thank you for warning me. I won't be able to test it out before the 17th, but I'll definitely warn you as soon as I have tested it 👍

@Mayeu
Copy link
Contributor Author

Mayeu commented Jul 17, 2023

Hello @stephengaudet, I can confirm that the v1.1.1 solves our issue 👍

Thank you ✨

@Mayeu Mayeu closed this as completed Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gcp
Projects
None yet
Development

No branches or pull requests

2 participants