mitodl / edx2bigquery

Tool to convert & load data from edX platform into BigQuery
GNU General Public License v2.0
29 stars 29 forks source link

GCloud Authentication Bug #72

Closed msj121 closed 6 years ago

msj121 commented 6 years ago

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 commented 6 years ago

Part of PR https://github.com/mitodl/edx2bigquery/pull/54#pullrequestreview-65513849 addressed this issue if you are using newer google cloud sdk (>=178).

msj121 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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