yar_win
yar_win

Reputation: 61

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?

Upvotes: 3

Views: 908

Answers (1)

DazWilkin
DazWilkin

Reputation: 40336

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.

Upvotes: 1

Related Questions