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

Queries from the Node.js BigQuery client v2.0.0 and higher are not returning results #463

Closed
d-torres opened this issue May 29, 2019 · 12 comments · Fixed by #465
Closed
Assignees
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@d-torres
Copy link

Running a query in a Node.js 8 environment using the BigQuery Client Library, v3.0.0 results in an empty response returned to the caller.

Reproduction steps and observed behavior:

Sample query: "with foo as (select 'Travis' as name) select count(*) as total from foo"

Expected behavior: The query() method should return COUNT = 1 after running the aggregate query from above.

Actual behavior: It's currently returning empty for bq client 2.0.0 and above.

@sduskis
Copy link

sduskis commented May 29, 2019

@callmehiphop, can you please take a look at this?

@callmehiphop
Copy link
Contributor

@d-torres I just tested this against master and got the following result

[
  {
    "total": 1
  }
]

@stephenplusplus
Copy link
Contributor

I'm not sure how, but the exact version of Node 8 might matter, since we only support 8.10 and up:

"node": ">=8.10.0"
.

@JustinBeckwith
Copy link
Contributor

The only reason that was set to 8.10 was because of HTTP/2 in the APIs that used grpc-js. Shouldn't matter here I don't think, but good to know regardless.

@callmehiphop callmehiphop added the needs more info This issue needs more information from the customer to proceed. label May 29, 2019
@cmath
Copy link

cmath commented May 29, 2019

Same thing happened to us. All of a sudden Select queries stopped working when running from cloud functions. Inserts are fine. When testing locally everything works as it should...

@d-torres
Copy link
Author

@callmehiphop - Could we take a look at this from the context of a cloud function to see if we're able to reproduce?

@JustinBeckwith JustinBeckwith added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 30, 2019
@callmehiphop
Copy link
Contributor

callmehiphop commented May 30, 2019

Confirmed not to be working on GCF, using the query method I started hitting a Maximum call stack size exceeded error when requesting a single page of results. For a temporary workaround users can create a query job like so

bigquery.createQueryJob(`SELECT * FROM foo`, (err, job) => {
  if (err) // error handling omitted
  job.getQueryResults((err, rows) => {
    if (err) // error handling omitted
  });
});

Edit: Here's the error stack trace

RangeError: Maximum call stack size exceeded
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:29:31)
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:40:30)
    at value.map.v (/srv/node_modules/@google-cloud/projectify/build/src/index.js:31:32)
    at Array.map (<anonymous>)
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:31:23)
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:40:30)
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:40:30)
    at value.map.v (/srv/node_modules/@google-cloud/projectify/build/src/index.js:31:32)
    at Array.map (<anonymous>)
    at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:31:23)%  

@callmehiphop callmehiphop removed the needs more info This issue needs more information from the customer to proceed. label May 30, 2019
@callmehiphop
Copy link
Contributor

Looks like the culprit is this line, it causes projectify to be called recursively quite a bit. For a fix I want to suggest not caching a job instance, but rather the job ID which we can use to grab a new job instance.

@melissammbeff
Copy link

I'm using @google-cloud/bigquery": "^3.0.0" and I'm having exactly this problem calling createQueryStream function. What should I do?

@callmehiphop
Copy link
Contributor

@melissammbeff are you able to upgrade to the latest version (4.4.0)?

@melissammbeff
Copy link

Hi @callmehiphop, so, unfortunately not so far. I understood that this problem was solved on 2.0.6, so, why I'm still having the same problem on 3.0.0?

@callmehiphop
Copy link
Contributor

callmehiphop commented Nov 21, 2019

@melissammbeff I'm not sure where 2.0.6 came from, but the PR that resolved this issue (#465) was not released until 4.1.1.

@google-cloud-label-sync google-cloud-label-sync bot added the api: bigquery Issues related to the googleapis/nodejs-bigquery API. label Jan 31, 2020
yoshi-automation added a commit that referenced this issue Apr 1, 2020
googleapis/synthtool@9982024
commit 99820243d348191bc9c634f2b48ddf65096285ed
Author: Alexander Fenster <fenster@google.com>
Date:   Tue Mar 31 11:56:27 2020 -0700

    fix: update template files for Node.js libraries (#463)
alexander-fenster pushed a commit that referenced this issue Apr 1, 2020
* Change triggered by none of the following:
This git repo (https://github.com/googleapis/nodejs-bigquery.git)
Git repo https://github.com/googleapis/synthtool.git

* feat!: drop Node 8 from engines field (#662)

712b029
commit 712b029
Author: Steffany Brown <30247553+steffnay@users.noreply.github.com>
Date:   Mon Mar 30 12:59:52 2020 -0700

    feat!: drop Node 8 from engines field (#662)

    Drops Node 8 from the engines field.

* refactor!: don't return Stream from createLoadJob (#647)

8e26fb5
commit 8e26fb5
Author: Andrew Zammit <zammit.andrew@gmail.com>
Date:   Mon Mar 30 21:58:06 2020 -0700

    refactor!: don't return Stream from createLoadJob (#647)

    * fix!(table): createLoadJobStream sync returns a stream, createLoadJob always returns a job #640

    * chore(table): remove createLoadJobStream, createLoadJob test refactor for promises #640

    * chore(table): remove never encountered callback noop in createLoadJob given promisifyAll

    * test(biqquery): add tests to increase codecov as a result of #647 refactor

    Co-authored-by: Benjamin E. Coe <bencoe@google.com>
    Co-authored-by: Steffany Brown <30247553+steffnay@users.noreply.github.com>

* chore: update dependency @google-cloud/common to v3 (#661)

c61407e
commit c61407e
Author: WhiteSource Renovate <bot@renovateapp.com>
Date:   Tue Mar 31 19:27:51 2020 +0200

    chore: update dependency @google-cloud/common to v3 (#661)

* fix(deps): update dependency @google-cloud/paginator to v3 (#658)

a09c493
commit a09c493
Author: WhiteSource Renovate <bot@renovateapp.com>
Date:   Tue Mar 31 19:38:07 2020 +0200

    fix(deps): update dependency @google-cloud/paginator to v3 (#658)

    This PR contains the following updates:

    | Package | Type | Update | Change |
    |---|---|---|---|
    | [@google-cloud/paginator](https://togithub.com/googleapis/nodejs-paginator) | dependencies | major | [`^2.0.0` -> `^3.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fpaginator/2.0.3/3.0.0) |

    ---

    ### Release Notes

    <details>
    <summary>googleapis/nodejs-paginator</summary>

    ### [`v3.0.0`](https://togithub.com/googleapis/nodejs-paginator/blob/master/CHANGELOG.md#&#8203;300-httpswwwgithubcomgoogleapisnodejs-paginatorcomparev203v300-2020-03-25)

    [Compare Source](https://togithub.com/googleapis/nodejs-paginator/compare/v2.0.3...v3.0.0)

    ##### ⚠ BREAKING CHANGES

    -   **dep:** upgrade gts 2.0.0 ([#&#8203;194](https://togithub.com/googleapis/nodejs-paginator/issues/194))
    -   **deps:** deprecated node 8 to 10; upgrade typescript

    ##### Miscellaneous Chores

    -   **dep:** upgrade gts 2.0.0 ([#&#8203;194](https://www.github.com/googleapis/nodejs-paginator/issues/194)) ([4eaf9be](https://www.github.com/googleapis/nodejs-paginator/commit/4eaf9bed1fcfd0f10e877ff15c1d0e968e3356c8))
    -   **deps:** deprecated node 8 to 10; upgrade typescript ([f6434ab](https://www.github.com/googleapis/nodejs-paginator/commit/f6434ab9cacb6ab804c070f19c38b6072ca326b5))

    ##### [2.0.3](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.2...v2.0.3) (2019-12-05)

    ##### Bug Fixes

    -   **deps:** pin TypeScript below 3.7.0 ([e06e1b0](https://www.github.com/googleapis/nodejs-paginator/commit/e06e1b0a2e2bb1cf56fc806c1703b8b5e468b954))

    ##### [2.0.2](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.1...v2.0.2) (2019-11-13)

    ##### Bug Fixes

    -   **docs:** add jsdoc-region-tag plugin ([#&#8203;155](https://www.github.com/googleapis/nodejs-paginator/issues/155)) ([b983799](https://www.github.com/googleapis/nodejs-paginator/commit/b98379905848fd179c6268aff3e1cfaf2bf76663))

    ##### [2.0.1](https://www.github.com/googleapis/nodejs-paginator/compare/v2.0.0...v2.0.1) (2019-08-25)

    ##### Bug Fixes

    -   **deps:** use the latest extend ([#&#8203;141](https://www.github.com/googleapis/nodejs-paginator/issues/141)) ([61b383e](https://www.github.com/googleapis/nodejs-paginator/commit/61b383e))

    </details>

    ---

    ### Renovate configuration

    📅 **Schedule**: "after 9am and before 3pm" (UTC).

    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

    ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

    ---

     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

    ---

    This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery).

* fix(deps): update dependency @google-cloud/promisify to v2 (#657)

5d8112c
commit 5d8112c
Author: WhiteSource Renovate <bot@renovateapp.com>
Date:   Tue Mar 31 19:48:07 2020 +0200

    fix(deps): update dependency @google-cloud/promisify to v2 (#657)

    This PR contains the following updates:

    | Package | Type | Update | Change |
    |---|---|---|---|
    | [@google-cloud/promisify](https://togithub.com/googleapis/nodejs-promisify) | dependencies | major | [`^1.0.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fpromisify/1.0.4/2.0.0) |

    ---

    ### Release Notes

    <details>
    <summary>googleapis/nodejs-promisify</summary>

    ### [`v2.0.0`](https://togithub.com/googleapis/nodejs-promisify/blob/master/CHANGELOG.md#&#8203;200-httpswwwgithubcomgoogleapisnodejs-promisifycomparev104v200-2020-03-23)

    [Compare Source](https://togithub.com/googleapis/nodejs-promisify/compare/v1.0.4...v2.0.0)

    ##### ⚠ BREAKING CHANGES

    -   update to latest version of gts/typescript ([#&#8203;183](https://togithub.com/googleapis/nodejs-promisify/issues/183))
    -   drop Node 8 from engines field ([#&#8203;184](https://togithub.com/googleapis/nodejs-promisify/issues/184))

    ##### Features

    -   drop Node 8 from engines field ([#&#8203;184](https://www.github.com/googleapis/nodejs-promisify/issues/184)) ([7e6d3c5](https://www.github.com/googleapis/nodejs-promisify/commit/7e6d3c54066d89530ed25c7f9722efd252f43fb8))

    ##### Build System

    -   update to latest version of gts/typescript ([#&#8203;183](https://www.github.com/googleapis/nodejs-promisify/issues/183)) ([9c3ed12](https://www.github.com/googleapis/nodejs-promisify/commit/9c3ed12c12f4bb1e17af7440c6371c4cefddcd59))

    ##### [1.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.3...v1.0.4) (2019-12-05)

    ##### Bug Fixes

    -   **deps:** pin TypeScript below 3.7.0 ([e48750e](https://www.github.com/googleapis/nodejs-promisify/commit/e48750ef96aa20eb3a2b73fe2f062d04430468a7))

    ##### [1.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.2...v1.0.3) (2019-11-13)

    ##### Bug Fixes

    -   **docs:** add jsdoc-region-tag plugin ([#&#8203;146](https://www.github.com/googleapis/nodejs-promisify/issues/146)) ([ff0ee74](https://www.github.com/googleapis/nodejs-promisify/commit/ff0ee7408f50e8f7147b8ccf7e10337aa5920076))

    ##### [1.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.1...v1.0.2) (2019-06-26)

    ##### Bug Fixes

    -   **docs:** link to reference docs section on googleapis.dev ([#&#8203;128](https://www.github.com/googleapis/nodejs-promisify/issues/128)) ([5a8bd90](https://www.github.com/googleapis/nodejs-promisify/commit/5a8bd90))

    ##### [1.0.1](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.0...v1.0.1) (2019-06-14)

    ##### Bug Fixes

    -   **docs:** move to new client docs URL ([#&#8203;124](https://www.github.com/googleapis/nodejs-promisify/issues/124)) ([34d18cd](https://www.github.com/googleapis/nodejs-promisify/commit/34d18cd))

    </details>

    ---

    ### Renovate configuration

    📅 **Schedule**: "after 9am and before 3pm" (UTC).

    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

    ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

    ---

     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

    ---

    This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery).

* fix(deps): update dependency google-auth-library to v6 (#660)

3ea642e
commit 3ea642e
Author: WhiteSource Renovate <bot@renovateapp.com>
Date:   Tue Mar 31 19:58:07 2020 +0200

    fix(deps): update dependency google-auth-library to v6 (#660)

    This PR contains the following updates:

    | Package | Type | Update | Change |
    |---|---|---|---|
    | [google-auth-library](https://togithub.com/googleapis/google-auth-library-nodejs) | dependencies | major | [`^5.8.0` -> `^6.0.0`](https://renovatebot.com/diffs/npm/google-auth-library/5.10.1/6.0.0) |

    ---

    ### Release Notes

    <details>
    <summary>googleapis/google-auth-library-nodejs</summary>

    ### [`v6.0.0`](https://togithub.com/googleapis/google-auth-library-nodejs/blob/master/CHANGELOG.md#&#8203;600-httpswwwgithubcomgoogleapisgoogle-auth-library-nodejscomparev5101v600-2020-03-26)

    [Compare Source](https://togithub.com/googleapis/google-auth-library-nodejs/compare/v5.10.1...v6.0.0)

    ##### ⚠ BREAKING CHANGES

    -   typescript@3.7.x introduced some breaking changes in
        generated code.
    -   require node 10 in engines field ([#&#8203;926](https://togithub.com/googleapis/google-auth-library-nodejs/issues/926))
    -   remove deprecated methods ([#&#8203;906](https://togithub.com/googleapis/google-auth-library-nodejs/issues/906))

    ##### Features

    -   require node 10 in engines field ([#&#8203;926](https://www.github.com/googleapis/google-auth-library-nodejs/issues/926)) ([d89c59a](https://www.github.com/googleapis/google-auth-library-nodejs/commit/d89c59a316e9ca5b8c351128ee3e2d91e9729d5c))

    ##### Bug Fixes

    -   do not warn for SDK creds ([#&#8203;905](https://www.github.com/googleapis/google-auth-library-nodejs/issues/905)) ([9536840](https://www.github.com/googleapis/google-auth-library-nodejs/commit/9536840f88e77f747bbbc2c1b5b4289018fc23c9))
    -   use iamcredentials API to sign blobs ([#&#8203;908](https://www.github.com/googleapis/google-auth-library-nodejs/issues/908)) ([7b8e4c5](https://www.github.com/googleapis/google-auth-library-nodejs/commit/7b8e4c52e31bb3d448c3ff8c05002188900eaa04))
    -   **deps:** update dependency gaxios to v3 ([#&#8203;917](https://www.github.com/googleapis/google-auth-library-nodejs/issues/917)) ([1f4bf61](https://www.github.com/googleapis/google-auth-library-nodejs/commit/1f4bf6128a0dcf22cfe1ec492b2192f513836cb2))
    -   **deps:** update dependency gcp-metadata to v4 ([#&#8203;918](https://www.github.com/googleapis/google-auth-library-nodejs/issues/918)) ([d337131](https://www.github.com/googleapis/google-auth-library-nodejs/commit/d337131d009cc1f8182f7a1f8a9034433ee3fbf7))
    -   **types:** add additional fields to TokenInfo ([#&#8203;907](https://www.github.com/googleapis/google-auth-library-nodejs/issues/907)) ([5b48eb8](https://www.github.com/googleapis/google-auth-library-nodejs/commit/5b48eb86c108c47d317a0eb96b47c0cae86f98cb))

    ##### Build System

    -   update to latest gts and TypeScript ([#&#8203;927](https://www.github.com/googleapis/google-auth-library-nodejs/issues/927)) ([e11e18c](https://www.github.com/googleapis/google-auth-library-nodejs/commit/e11e18cb33eb60a666980d061c54bb8891cdd242))

    ##### Miscellaneous Chores

    -   remove deprecated methods ([#&#8203;906](https://www.github.com/googleapis/google-auth-library-nodejs/issues/906)) ([f453fb7](https://www.github.com/googleapis/google-auth-library-nodejs/commit/f453fb7d8355e6dc74800b18d6f43c4e91d4acc9))

    ##### [5.10.1](https://www.github.com/googleapis/google-auth-library-nodejs/compare/v5.10.0...v5.10.1) (2020-02-25)

    ##### Bug Fixes

    -   if GCF environment detected, increase library timeout ([#&#8203;899](https://www.github.com/googleapis/google-auth-library-nodejs/issues/899)) ([2577ff2](https://www.github.com/googleapis/google-auth-library-nodejs/commit/2577ff28bf22dfc58bd09e7365471c16f359f109))

    </details>

    ---

    ### Renovate configuration

    📅 **Schedule**: "after 9am and before 3pm" (UTC).

    🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

    ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

    ---

     - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

    ---

    This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery).

* build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#665)

3f78914
commit 3f78914
Author: Benjamin E. Coe <bencoe@google.com>
Date:   Tue Mar 31 18:35:04 2020 -0700

    build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#665)

* docs: document the release schedule we follow (#454)

googleapis/synthtool@6a17abc
commit 6a17abc7652e2fe563e1288c6e8c23fc260dda97
Author: Benjamin E. Coe <bencoe@google.com>
Date:   Mon Mar 23 19:22:34 2020 -0700

    docs: document the release schedule we follow (#454)

* fix: do not run node 8 CI (#456)

googleapis/synthtool@1b4cc80
commit 1b4cc80a7aaf164f6241937dd87f3bd1f4149e0c
Author: Alexander Fenster <fenster@google.com>
Date:   Wed Mar 25 08:01:31 2020 -0700

    fix: do not run node 8 CI (#456)

* fix: update template files for Node.js libraries (#463)

googleapis/synthtool@9982024
commit 99820243d348191bc9c634f2b48ddf65096285ed
Author: Alexander Fenster <fenster@google.com>
Date:   Tue Mar 31 11:56:27 2020 -0700

    fix: update template files for Node.js libraries (#463)
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 7, 2020
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/nodejs-bigquery API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants