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

Google Sheets: Must have a tty or interactive mode for web flow error solely when running in production (google cloud run jobs) #572

Open
Thommel-nl opened this issue Oct 2, 2024 · 0 comments

Comments

@Thommel-nl
Copy link

dlt version

1.0.0

Source name

google_sheets

Describe the problem

I use this google sheets verified source to get data to bigquery. Basically I have a small CI/CD pipeline which bundles my code in a Docker image in Artifact Registry, makes Cloud Run Jobs accordingly for each pipeline and then run them periodically.

With this source I get an error stating: "Must have a tty or interactive mode for web flow". This is referring to the GcpOAuthCredentials, but I'm using GcpServiceAccountCredentials so I wouldn't need tty or interactive mode.

Possible fix that I found is swapping around the credentials typing from:

    credentials: Union[
        GcpOAuthCredentials, GcpServiceAccountCredentials
    ] = dlt.secrets.value,

To:

    credentials: Union[
        GcpServiceAccountCredentials, GcpOAuthCredentials
    ] = dlt.secrets.value,

I'm not too sure why this fix worked, but ultimately it worked fine for me so I'm keeping it like this. Also not sure whether this also fixes issues for other production environments than Google Cloud Run Jobs obviously.

Another issue that Alena provided was commenting out this part:

    if isinstance(credentials, GcpOAuthCredentials):
        credentials.auth("https://www.googleapis.com/auth/spreadsheets.readonly")

Expected behavior

No response

Steps to reproduce

Setup a google_sheets pipeline, bundle code in a docker image hosted in artifact registry, make a cloud run job based on this docker image and correctly add command, arg and secrets at runtime.

How you are using the source?

I run this source in production.

Operating system

Linux

Runtime environment

Other

Python version

3.12

dlt destination

Bigquery

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Planned
Development

No branches or pull requests

1 participant