Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud crashed (TokenRevokeError): invalid_request

I'm currently experiencing inconsistency when trying to revoke my gcloud credentials after I'm done using my service account.

gcloud auth activate-service-account --key-file=mykey.json
{commands...}
gcloud auth revoke

At times the revoke command does work, but sometimes it (randomly?) fails with this error:

ERROR: gcloud crashed (TokenRevokeError): invalid_request

If you would like to report this issue, please run the following command: gcloud feedback

To check gcloud for common problems, please run the following command: gcloud info --run-diagnostics

When this happens, I can see that running gcloud auth list afterwards still lists the account, though it isn't marked as active. While after a successful revoke, the account is not listed at all (makes sense, as it has been revoked and removed).

Did anybody experience this issue?

like image 263
yar_win Avatar asked Dec 28 '25 11:12

yar_win


1 Answers

You should upgrade to the latest version of gcloud per @john-hanley's suggestion.

Please see the documentation for gcloud auth revoke.

It is not possible to revoke service account tokens.

The message you're receiving is unhelpful (although accurate, it is an invalid request) but you should not see the credentials listed after issuing the command and this may be addressed by upgrading.

like image 174
DazWilkin Avatar answered Dec 31 '25 18:12

DazWilkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!