-
Notifications
You must be signed in to change notification settings - Fork 579
BQ Data Transfer Auth causes failure in schedule.py #47
Comments
Interesting. I'm going to try to recreate the bug. Did you use the "create new project" option or did you use a pre-existing project? |
I ran it a couple times, one using a pre-existing project and one with a new project. So far unable to recreate. What system are you using? And to confirm, this does work when you run it manually?
|
I used a pre-existing project, but I believe the issue was that is was a new account that had never used data transfers before. Once I had created my first scheduled query manually and approved the "BigQuery Data Transfer Service" to do things on my behalf through the popup, the script worked as indented. There was no difference in running the full |
Thank you for that! I don't think there is a way to enable this automatically, but I'm going to look into forcing the prompt to pop-up before running the rest of the setup script. |
I'm experiencing this problem consistently (even after manually creating a transfer and doing the OAuth dance as part of that process). One thing that I just thought of which might be relevant: my dev environment is a remote SSH connection (in VSCode) to a cloud instance. I wonder if there's something happening where the BigQuery auth prompt is trying to launch, but because the process is actually running remotely, it's not triggering my computer to launch a browser.(???) |
Interesting. Can you try this from Cloud Shell? |
So, it seems we're not the only ones having trouble with BigQuery+Python+Auth. Anyway, Cloud Shell didn't fix it for me but I was able to push through it: I found a workaround, using
...there are two things I'd like to work through before opening a PR: 1) it requires |
The difference between the |
Hi Tim, I believe we're doing that here: https://github.com/GoogleCloudPlatform/fourkeys/blob/main/queries/schedule.py#L39 This works for me and many other users. But I believe the key difference is that when I first ran the script, I had to go to my browser and allow the BQ service to use my account. This is also what the user reports above. However, Dave isn't getting that prompt or pop-up and thus is having trouble authenticating with his access-token. |
This should be solved via the switch to a bash script: #68. Closing for now. |
Running the
python3 schedule.py --query_file=changes.sql --table=changes --access_token=${token}
part ofsetup.sh
initially fails with the following exception.This was from running it with an auth token from my personal account, which had the Owner role in the project.
There are probably better solutions, but I managed to get around it by first creating a similar scheduled query manually to there get option to grant access to the needed scope.
The text was updated successfully, but these errors were encountered: