Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

503 ServiceUnavailable Error in BigQuery during load job, but job is successful in console

Hi all,

Recently we have been experiencing a 503 Error (google.api_core.exceptions.ServiceUnavailable) when running a BigQuery load job through the Python Client for BQ.

The error appears when we create a load_job and call load_job.result(). However, in the BQ console if I go to the project history the job appears as a success.

Any explanation why this is happening? Please let me know if more details are needed.

Solved Solved
2 3 10.1K
1 ACCEPTED SOLUTION

The mismatch between the Python error and the successful job status in BigQuery is likely due to the transient nature of the 503 Service Unavailable error. As mentioned previously, this error can occur when the BigQuery service is overloaded or unavailable. In this case, the Python client was unable to successfully get the job status due to the error. However, the job itself was still able to complete successfully.

The retry mechanism that you implemented was able to successfully get the job status after the 503 error had resolved. This is why you were able to see the successful load in the BigQuery console.

In general, it is a good idea to implement retries when using APIs that can return transient errors. This will help to ensure that your code is able to handle these errors gracefully.

View solution in original post

3 REPLIES 3