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

Update bigquery-profile.md #626

Merged
merged 2 commits into from
Apr 15, 2021
Merged

Update bigquery-profile.md #626

merged 2 commits into from
Apr 15, 2021

Conversation

VasiliiSurov
Copy link
Contributor

Adding https://www.googleapis.com/auth/iam.test scope to gcloud auth application-default login to get rid of the following error

These credentials will be used by any library that requests Application Default Credentials (ADC).
/Users/sova/google-cloud-sdk/lib/third_party/google/auth/_default.py:69: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/
  warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
ERROR: (gcloud.auth.application-default.login) User [*********] does not have permission to access projects instance [********:testIamPermissions] (or it may not exist): Request had insufficient authentication scopes

Adding https://www.googleapis.com/auth/iam.test scope to gcloud auth application-default login to get rid of the following error
```shell
These credentials will be used by any library that requests Application Default Credentials (ADC).
/Users/sova/google-cloud-sdk/lib/third_party/google/auth/_default.py:69: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a "quota exceeded" or "API not enabled" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/
  warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
ERROR: (gcloud.auth.application-default.login) User [*********] does not have permission to access projects instance [********:testIamPermissions] (or it may not exist): Request had insufficient authentication scopes
```
@VasiliiSurov VasiliiSurov requested a review from clrcrl as a code owner April 9, 2021 14:05
@clrcrl clrcrl requested review from jtcohen6 and removed request for clrcrl April 9, 2021 14:14
@jtcohen6
Copy link
Collaborator

@VasiliiSurov I don't see iam.test listed among the auth scopes here. Could you say a bit more about why this is required in your case? I see the error message mentions ********:testIamPermissions, that's not a method I was familiar with.

@VasiliiSurov
Copy link
Contributor Author

VasiliiSurov commented Apr 12, 2021

@jtcohen6
I have a standard use case: authanticating dbt via oauth. Even it's not mandatory and application got authenticated but I want to avoid this frightening message.
Please check the following page https://cloud.google.com/resource-manager/reference/rest/v1/projects/testIamPermissions

Am I the only one who's getting this notification? Just updated SDK and got the same message.

(dbt) sova@sova dbt % gcloud --version        
Google Cloud SDK 335.0.0
bq 2.0.66
core 2021.04.02
gsutil 4.60
kubectl 1.17.17
(dbt) sova@sova dbt % 

@jtcohen6
Copy link
Collaborator

jtcohen6 commented Apr 12, 2021

Ah you're right, I was using an old version of gcloud. I just upgraded and now see the error message you saw.

When I try to run with the new scopes, however, I get this error:

$ gcloud --version
Google Cloud SDK 335.0.0
bq 2.0.66
core 2021.04.02
gsutil 4.60

$ gcloud auth application-default login   --scopes=https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/iam.test
ERROR: (gcloud.auth.application-default.login) unrecognized arguments: https://www.googleapis.com/auth/iam.test

To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS

That's definitely the scope listed on this page, but I can't find it anywhere on the main page for OAuth2 scopes.

@VasiliiSurov
Copy link
Contributor Author

@jtcohen6
you need to remove space before https://www.googleapis.com/auth/iam.test
All scopes have to be passed as a single parameter

Copy link
Collaborator

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Ok, that worked for me. Let's remove the space from the copy-paste code, and then this LGTM

Copy link
Collaborator

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @VasiliiSurov!

@jtcohen6 jtcohen6 merged commit a36e4f0 into dbt-labs:current Apr 15, 2021
mirnawong1 pushed a commit that referenced this pull request Sep 30, 2024
REPO SYNC - Public to Private
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

Successfully merging this pull request may close these issues.

2 participants