Daniel Zrust
Daniel Zrust

Reputation: 67

Error: GoogleJsonResponseException: API call to bigquery.jobs.get failed with error: Not found: Job YXZ

We've built a Google Sheets extension which allows users to upload sheets to BigQuery. It's based on Gapps Scripts. Fairly Simple. The extension "sends" sheets to BigQuery as BigQuery tables. It's called BigQuery Uploader for Google Sheets, you can check it out in the Chrome store.

The uploader creates jobs to create tables in BQ, then we wait and ask for the job status. It works in 99% instances - the upload goes in and we get "success message" back from BQ API. The extension is doing thousands of uploads every day and the fail rate is below 5% (including human input errors).

However, we are getting random complaints from users who are getting an error of this type: Error: GoogleJsonResponseException: API call to bigquery.jobs.get failed with error: Not found: Job project_id:job_id where project_id and job_id are variables. The upload itself works OK, it's just the status message from the BQ API which is showing an error while it should show "success" and that makes our users confused.

We've been banging our heads against the wall and we have not been able to figure out why this message is coming up so randomly. This issue just comes and goes.

Has anyone been coping with the same issue?

DZ

Upvotes: 1

Views: 1224

Answers (1)

Eka
Eka

Reputation: 26

Try adding location like this:

while (queryResults.pageToken) {
queryResults = BigQuery.Jobs.getQueryResults(projectId, jobId, {
  pageToken: queryResults.pageToken,
  location: bigQuerySettings.location
});
rows = rows.concat(queryResults.rows);}

This works for me. Hope it will for you too.

Upvotes: 1

Related Questions