Reputation: 164
I am having problems in the authentication of an account in Google Cloud. I had an account ([email protected]) which I used to make different tests with Google Storage. Now that I learnt, I want to do different things with another account ([email protected]).
I changed the active account with gcloud config set account `[email protected]`
and I removed the old account with gcloud auth revoke [email protected]
. When I check the active accounts I get:
>gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* [email protected]
I login with the command gcloud auth login
and I get no problems.
That's why I suppose that everything is right. But when I execute the code that I wanted I get an error saying that the old account ([email protected]) has not access to a specific bucket that I am using. That's correct because I removed the access for that old account to the bucket, but I don't understand why I'm still operating with that account after all the changes I made.
This is the exact error I'm getting:
"code": 403,\n "message": "[email protected] does not have storage.objects.get access to the Google Cloud Storage object.",\n "errors": [\n {\n "message": "[email protected] does not have storage.objects.get access to the Google Cloud Storage object."
Does anyone encounter the same error? I don't know what else to do. I also checked this as google cloud documentation recommends:
>gsutil version -l
gsutil version: 5.6
boto version: 2.49.0
python version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
OS: Windows 10
multiprocessing available: False
using cloud sdk: True
pass cloud sdk credentials to gsutil: True
config path(s): C:\Users\user\AppData\Roaming\gcloud\legacy_credentials\[email protected]\.boto
gsutil path: C:\Users\user\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gsutil
compiled crcmod: True
installed via package manager: False
editable install: False
And there is no signs of the old account anywhere. Hope someone can help me identifying where the error is, or why the command gsutil
is saving the old account somewhere so I can erase it.
Thanks!
Upvotes: 0
Views: 1221
Reputation: 440
Have you specified a separate credential file in your code or are you using the default application credentials provided by the Cloud SDK? If the later it is possible that your old account is still used as a default in the file ~/.config/gcloud/application_default_credentials.json
.
You can change this with the following command:
gcloud auth application-default login
https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
Upvotes: 2