Skip to content

Dataform CLI Error: request to https://oauth2.googleapis.com/token failed #2040

Open

Description

@BenJackGill

The Dataform CLI is throwing errors like this:

Dataform encountered an error: request to https://oauth2.googleapis.com/token failed, reason: 
FetchError: request to https://oauth2.googleapis.com/token failed, reason: 
    at ClientRequest.<anonymous> (/Users/BenJackGill/.nvm/versions/node/v22.17.0/lib/node_modules/@dataform/cli/node_modules/node-fetch/lib/index.js:1501:11)
    at ClientRequest.emit (node:events:518:28)
    at emitErrorEvent (node:_http_client:104:11)
    at TLSSocket.socketErrorListener (node:_http_client:518:5)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:90:21)
    at runNextTicks (node:internal/process/task_queues:69:3)
    at listOnTimeout (node:internal/timers:549:9)

Each time I do gcloud auth application-default login and it works for one or two more commands before showing the same error again.

I am using the latest @dataform/cli@3.0.36

Activity

  1. BenJackGill commented on Nov 4, 2025

    @BenJackGill
    Author

    Just noticed that when I see this error I can ignore it sometimes and re-run the same command (i.e. dataform run) and it works.

    So the error is a false positive. Something else is wrong here.

  2. kolina commented on Nov 5, 2025

    @kolina
    Contributor

    How frequently do you see this error? It may be a transient issue to call this API to generate tokens

  3. BenJackGill commented on Nov 6, 2025

    @BenJackGill
    Author

    It happens daily. Some days worse than others but it's always showing up.

    Noting that other Google product CLI's (firebase, etc) don't have this problem. The ADC is always respected.

  4. kolina commented on Nov 7, 2025

    @kolina
    Contributor

    We don't do anything special except for the fact that the CLI needs to make a lot of calls to the BigQuery API to poll jobs status.

    One way for a fix is to customize retry predicate of the BQ client for this specific error: we construct this client here

    You can send this PR if you feel doing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions