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

GCloud Authentication Bug #72

Closed
msj121 opened this issue Jan 3, 2018 · 4 comments
Closed

GCloud Authentication Bug #72

msj121 opened this issue Jan 3, 2018 · 4 comments

Comments

@msj121
Copy link

msj121 commented Jan 3, 2018

I have run edx2bigquery testbq

I get an error:

Authentication error! You have specified USE_GCLOUD_AUTH in the configuration, but do not have gcloud authentication available.
Please authenticate using 'gcloud auth login' before running this.

I have run the authentication as described. According to https://github.com/mitodl/edx2bigquery/blob/master/edx2bigquery/auth.py#L58

It is expecting a file in:
'~/.config/gcloud/credentials'
however what does exist:
~/.config/gcloud/credentials.db
~/.config/gcloud/legacy_credentials/

Am I missing something? Does the code need to be updated? Or do I need to change the method of logging in to gcloud (I ran gcloud auth login)

@maxliu
Copy link

maxliu commented Jan 3, 2018

Part of PR #54 (review) addressed this issue if you are using newer google cloud sdk (>=178).

@msj121
Copy link
Author

msj121 commented Jan 3, 2018

@maxliu I am using the newest code from master, which seems like it should work (I don't see the difference between this and the PR for my issue), I am also using google cloud sdk 183.0.0.

I can in fact login, but it isn't creating the correct file?

@msj121
Copy link
Author

msj121 commented Jan 5, 2018

For anyone interested in a workaround to this issue:
https://console.cloud.google.com/apis/credentials/serviceaccountkey

If you download the json, you can copy that file and add it as a file on your server/computer where edx2bigquery is. After doing that in edx2bigquery_config.py you can save the file location in "auth_key_file" as a link to that file.

Worked like a charm.

@msj121
Copy link
Author

msj121 commented Mar 18, 2018

Sadly the solution above leads to issues with access using oauth2 which seem necessary for bigquery access and table creation. I get a 403 error which states that the user doesn't have access to bigquery, but of course the main role is the administrator, I assume it doesn't have access because using .json or .p12 stops access.

gcloud auth login does not create a credentials file, only credentials.db, but that doesn't work either as it is not json

@msj121 msj121 closed this as completed Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants