wrong email usage even after changing email account on gcloud init

hello.

I have 2 emails. one is personal X@gmail.com, the other is a part of a large group project Y@team.com. the last have access to the bigquery resources of the project, while the first do not.

At the first time I Discovered the issue, the code failed (Request failed with status: 500) I believe that the algorithm stopped since the default email was my personal email while the data was on the the team's email:

HttpError: <HttpError 403 when requesting https://www.googleapis.com/bigquery/v2/projects/proj/queries?alt=json returned "Access Denied: Project proj: The user X@gmail.com does not have bigquery.jobs.create permission in project proj.">
INFO     2019-01-06 21:02:15,329 module.py:861] default: "GET /crons/system_states HTTP/1.1" 500 2505

my initial reaction was to reconfigure my email and project on the sdk init:

google-cloud-sdk/bin/gcloud init

however pychram insists on using the outdated email,X@gmail.com, and outputs the same ERROR.

closing the computer, reinstalling Pycharm also failed to help.

 

any support will be welcome

 

1 comment

Hi Alon,

Unfortunately I couldn't reproduce your issue - I've tested with two different projects in different accounts, and issuing `gcloud init` and completing authentication correctly switched the account.

Moreover, supposedly auth credentials are stored by Google's SDK, so IDE might not be the cause of the issue.

Please try issuing some gcloud commands from outside of PyCharm to confirm if the correct Google account is used. For example you can try `gcloud projects list` or something more specific to your project.

0

Please sign in to leave a comment.