Skip to content

Random Auth Errors with BigQuery #2139

Description

@MarkHerhold

Insert calls to BigQuery randomly result in auth errors.

I have a job that is responsible for sending data in bulk to BigQuery by using .insert([ 'lots', 'of', 'items' ]) repeatedly in synchronous fashion. This process goes on for hours at a time, calling insert after the prior operation finishes.

After a few hours, my calls to BigQuery abruptly fail. I'm not sure if this issue is time-related or the call itself randomly fails. It does seem to occur after a few hours. This happens repeatedly.

Error:

Unhandled promise rejection (rejection id: 1): ApiError: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Environment details

  • OS: OSX El Capitan
  • Node.js version: 7.7.3
  • npm version: 4.1.2
  • @google-cloud/bigquery version: 0.8.0

Steps to reproduce

The above description tells it all, but I'm working on a script. I'll update this if I can find a way to reproduce in a more predictable manner.

Activity

  1. lukesneeringer commented on Mar 27, 2017

    @lukesneeringer
    Contributor

    @stephenplusplus This smells like a rate limit to me, other than the error message. Might this be a case where we are clobbering an error?

  2. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Mar 27, 2017
  3. stephenplusplus commented on Mar 27, 2017

    @stephenplusplus
    Contributor

    I don't think we're clobbering it, just judging by the error message not being one that we've written. Before every request, we do a token grab, refreshing if necessary (that work is done by google-auth-library).

    With this large amount of requests, maybe we need a larger safety window around the expiration timestamp for when the auth client makes the grab. @jmdobry does that sound possible? (please re-tag if someone else is closer to the auth library code)

  4. stephenplusplus commented on Mar 29, 2017

    @stephenplusplus
    Contributor

    @ofrobots wdyt?

  5. stephenplusplus commented on Apr 7, 2017

    @stephenplusplus
    Contributor

    Friendly re-ping.

  6. stephenplusplus commented on Apr 13, 2017

    @stephenplusplus
    Contributor
  7. stephenplusplus commented on Apr 13, 2017

    @stephenplusplus
    Contributor

    We haven't been able to attract the right attention over here, so I've moved the issue to the source of the error (I think). googleapis/google-auth-library-nodejs#133

  8. MarkHerhold commented on Apr 13, 2017

    @MarkHerhold
    Author

    Can please we keep this open so I can easily track it?

  9. stephenplusplus commented on Apr 13, 2017

    @stephenplusplus
    Contributor

    For tracking, just subscribe to the new issue with the button in the right column: googleapis/google-auth-library-nodejs#133 -- I assumed you'd be automatically subscribed because of the @ mention of your name over there, but it wouldn't hurt to confirm.

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

Metadata

Metadata

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions