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

Retry did not occurred #707

Closed
nitishxp opened this issue Jun 15, 2021 · 8 comments
Closed

Retry did not occurred #707

nitishxp opened this issue Jun 15, 2021 · 8 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: question Request for information or clarification. Not an issue.

Comments

@nitishxp
Copy link

Hi,

I got the following error in one of my Cloud function

, in reraise raise self.last_attempt.result()
File "/opt/python3.8/lib/python3.8/concurrent/futures/_base.py", line 437, in result return self.__get_result()
File "/opt/python3.8/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result raise self._exception
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/tenacity/__init__.py", line 426, in __call__ result = fn(*args, **kwargs)
File "/workspace/cf/functions.py", line 602, in execute_query return self.gbq.query(query).result()
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/bigquery/job/query.py", line 1172, in result super(QueryJob, self).result(retry=retry, timeout=timeout)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/bigquery/job/base.py", line 679, in result return super(_AsyncJob, self).result(timeout=timeout, **kwargs)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/api_core/future/polling.py", line 134, in result raise
  self._exception google.api_core.exceptions.InternalServerError: 500 Job failed because streaming data from one of the tables referenced in the query is temporarily unavailable. Retrying the job may solve the problem
@parthea
Copy link
Contributor

parthea commented Jun 18, 2021

@tseaver Please could you take a look?

@tseaver
Copy link
Contributor

tseaver commented Jun 18, 2021

@nitishxp Although google-api-core is involved in your traceback (which I reformatted for clarity), this issue seems to be specific to google-cloud-bigquery. I am moving the issue there, where you can get better support for your question.

@tseaver tseaver transferred this issue from googleapis/python-api-core Jun 18, 2021
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Jun 18, 2021
@tseaver tseaver added the type: question Request for information or clarification. Not an issue. label Jun 18, 2021
@tseaver
Copy link
Contributor

tseaver commented Jun 18, 2021

@plamut, @tswast PTAL.

@plamut
Copy link
Contributor

plamut commented Jun 22, 2021

@nitishxp By default, InternalServerError is is listed among the retriable errors. Ditto if the exception instance contains a reason sent by the backend, "internalError" is one of them.

Does the error occur often, or was it just a one-time event_

Is your code perhaps using a custom Retry object? (a sample would be great) And which package versions do you have installed? Is there anything else in the logs that might lead to the eventual error posted here?

Any additional info would be useful, thanks!

@nitishxp
Copy link
Author

@plamut It was a one time exception that occurred in Cloud Function.

Yes I am also using tenacity retry module.

Below are installed packages

google-cloud-bigquery==2.15.0
google-auth==1.30.0
google-cloud-pubsub==2.2.0
google-cloud-scheduler==2.1.0
google-cloud-storage==1.38.0
google-cloud-kms==2.2.0
google-cloud-secret-manager==2.1.0
google-api-python-client==2.7.0

@tswast
Copy link
Contributor

tswast commented Jun 28, 2021

From your stacktrace "500 Job failed because streaming data from one of the tables referenced in the query is temporarily unavailable. Retrying the job may solve the problem"

Retrying the API request won't help. You actually have to re-issue the query.

Closing as a duplicate of #539

@tswast tswast closed this as completed Jun 28, 2021
@nitishxp
Copy link
Author

@tswast will the sdk take care of it in the future releases?

@tswast
Copy link
Contributor

tswast commented Jun 29, 2021

@nitishxp It's a really hard problem to solve. I don't expect the "query" method to handle this anytime soon.

It may be a bit easier to implement in wrapper libraries with a simpler interface like the DB-API, SQLAlchemy, and/or pandas-gbq.

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 googleapis/python-bigquery API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants