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

Random Auth Errors with BigQuery #2139

Closed
MarkHerhold opened this issue Mar 27, 2017 · 9 comments
Closed

Random Auth Errors with BigQuery #2139

MarkHerhold opened this issue Mar 27, 2017 · 9 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@MarkHerhold
Copy link

MarkHerhold commented Mar 27, 2017

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.

@stephenplusplus stephenplusplus added the api: bigquery Issues related to the BigQuery API. label Mar 27, 2017
@lukesneeringer
Copy link
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?

@lukesneeringer lukesneeringer added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 27, 2017
@stephenplusplus
Copy link
Contributor

stephenplusplus commented Mar 27, 2017

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)

@stephenplusplus
Copy link
Contributor

@ofrobots wdyt?

@stephenplusplus
Copy link
Contributor

Friendly re-ping.

@stephenplusplus
Copy link
Contributor

This issue was moved to googleapis/google-auth-library-nodejs#133

@stephenplusplus
Copy link
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

@MarkHerhold
Copy link
Author

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

@stephenplusplus
Copy link
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.

@ghost
Copy link

ghost commented Aug 2, 2017

I have similar problem with the auth-library.
Set up a google cloud function to monitor a bucket with frequent file changes every hour.
The error: Could not load the default credentials. Broswer to https://developers..... randomly showed up once a while.

Not sure what the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants