question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intermittent error 400 when calling bigquery API

See original GitHub issue

I’m experiencing a cryptic error message while running a long bigquery job:

  File "/usr/local/lib/python3.6/site-packages/googleapiclient/http.py", line 851, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/bigquery/v2/projects/<project-name>/queries/job_<id>?pageToken=<page_token>&alt=json returned "{0}">

The point of attention is the returned "{0}" part of the message where the reason was supposed to be. When looking at the job history with the bq --format=prettyjson show -j <jobid> command it also doesn’t show the reason field, so that may be the root cause.

Environment details

  • Python version: 3.6.5
  • google-api-python-client: 1.7.8
  • google-cloud-bigquery: 1.11.2
  • google-cloud-storage: 1.15.0

Steps to reproduce

This error occurs somewhat randomly while processing a long running bigquery job.

After retrying a few times the job usually succeeds. I wonder if this is related with cause resourcesExceeded documented in https://cloud.google.com/bigquery/troubleshooting-errors. The other possible causes doesn’t seem to be related.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shollymancommented, Jul 8, 2019

Checked this morning, it looks like the backend changes to address the malformed response have been deployed to tasks in all regions. Cases where requests were getting the 400 response and the {0} body were representative of a backend component where error propagation was not being handled correctly. Now such conditions should yield an appropriate retryable HTTP error, and a properly formatted response.

@danicat Thanks again for reporting this, the additional details you were able to provide about specific requests were helpful in tracking this down.

1reaction
shollymancommented, Jun 12, 2019

@danicat It looks like the BigQuery engineering team has identified a situation in the tabledata backend that can trigger the unusual 400 response with the poorly formatted response. No details/ETA on resolution yet, but thanks for the report helping to identify this. I’ll keep this issue open until the internal issue is resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bigquery API Intermittently returns http error 400 "Bad Request"
The error seems to occur only if the live_seconds_viewed calculations are included in the query. If any part of the live_seconds_viewed ...
Read more >
Error messages | BigQuery - Google Cloud
invalid, 400, This error returns when there is any type of invalid input other than an invalid query, such as missing required fields...
Read more >
Incidents - Google Cloud Service Health
Cloud Build ListBuild HTTP calls having increased latency and timeouts, 31 May 2022 ... BigQuery is experiencing issues with streaming API in US...
Read more >
Google BigQuery V2: [ERROR] The following error occurred ...
​To resolve this issue, please provide the Dataset Name in “Dataset Name for Custom Query” field in the connection properties of the Google ......
Read more >
Live Stream: Intermittent 503 and 409 errors
If the connection is lost, the client should wait ~60 seconds (to allow the load balancer and API to recognize the severed connection)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found