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.

table.load() fails to find its own job when location is not specified in v5.x API

See original GitHub issue

Environment details

  • OS: appengine-standard environment, local MacOS
  • Node.js version: 12.x, 14.x
  • npm version: 6.13.8
  • @google-cloud/bigquery version: 5.x (tested 5.0.0, 5.4.0). Works in v4.x

Steps to reproduce

  1. Create a dataset that is not in US (e.g. australia-southeast-1)
  2. Use the sample code to perform a load from https://github.com/googleapis/nodejs-bigquery/blob/master/samples/loadJSONFromGCS.js and omit the location option in metadata.
  3. The following error occurs
Error: Not found: Job my-test-project:396748ce-c4ec-449b-975d-1234567abb15

As mentioned this was working in v4. Not great if the api can internally create a job and lose track of it. This is not a huge priority because the workaround is to be explicit about specifying the location, however this is an undocumented change in v5 that may catch people unaware (I found root cause while documenting this issue).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
laljikanjareeyacommented, Dec 3, 2020

@laljikanjareeya do we set job.location after creating a Job instance in our code somewhere or document that we support that?

Yes we are setting job location at below: https://github.com/googleapis/nodejs-bigquery/blob/6bac26fefa0ef3fb8326ec129457babd01a6a1f8/src/bigquery.ts#L1550

1reaction
laljikanjareeyacommented, Dec 3, 2020

@mbyrne00 Thanks for the clarification. There is an issue in job’s getMetadata where location is not getting updated in query string after creating the Job instance.

This works fine:

const bigquery = new BigQuery();
const job = new Job(bigquery, 'jobId', {
    location: 'australia-southeast1'
});

job.getMetadata((err, metadata, apiResponse) => { });

This is doesn’t work

const bigquery = new BigQuery();
const job = new Job(bigquery, 'jobId');
job.location = 'australia-southeast1';
job.getMetadata((err, metadata, apiResponse) => { });

The linked PR will fix the above issue. Thanks!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jobs API - GitLab Docs
Get a list of jobs in a project. Jobs are sorted in descending order of their IDs. By default, this request returns 20...
Read more >
Emulator's Location simulation not working - Stack Overflow
I try to use location simulation with the official Google Android Emulator. (x86). I have made a 4.4 Emulator and is working fine,...
Read more >
Error conditions in Databricks
This is a list of common, named error conditions returned by Databricks. In this article: Databricks Runtime and Databricks SQL; Delta Lake ...
Read more >
Configuring and Running a Job - Spring
Ideally, all jobs should be able to start up where they left off, but there are scenarios where this is not possible. In...
Read more >
5.x API - Express.js
The method, app.all() , is not derived from any HTTP method and loads middleware at the specified path for all HTTP request methods....
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