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

row.exists() promise is never resolved for the emulator #555

Closed
igorbernstein2 opened this issue Oct 11, 2019 · 5 comments
Closed

row.exists() promise is never resolved for the emulator #555

igorbernstein2 opened this issue Oct 11, 2019 · 5 comments
Assignees
Labels
api: bigtable Issues related to the googleapis/nodejs-bigtable API. external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@igorbernstein2
Copy link
Contributor

Environment details

  • OS: Mac OS X 10.14.6
  • Node.js version: v12.11.1
  • npm version: 6.11.3
  • @google-cloud/bigtable version: 2.1.0

Steps to reproduce

  1. gcloud beta emulators bigtable start &
  2. $(gcloud beta emulators bigtable env-init )
  3. npm install @google-cloud/bigtable
  4. The script below:
cat <<- EOF | node
const table = require('@google-cloud/bigtable')().instance("instance1").table("table1");

(async () => {
    await table.create();
    console.log("table created!")
    await table.row("nonexistent-row").exists();
    console.log("this is never seen!")
})()
EOF

The log line this is never seen! is never printed. However if you run this against a prod instance (by unsetting BIGTABLE_EMULATOR_HOST envvar), the line is printed. The same is true of row.get().

It seems like the read rows end event is not being properly propagated when connecting to the emulator. I can't figure out what grpc-node is doing differently for the go emulator, but other languages don't seem to have an issue (ie. grpc-java is able to detect end of stream for readRows in the emulator just fine).

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Oct 12, 2019
@bcoe bcoe added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Oct 14, 2019
@bcoe
Copy link
Contributor

bcoe commented Oct 14, 2019

@igorbernstein2 thank you for the bug report.

@stephenplusplus
Copy link
Contributor

I'm still investigating, but it looks like if you explicitly provide a project ID, it behaves as expected:

-const table = require('@google-cloud/bigtable')()
+const table = require('@google-cloud/bigtable')({ projectId: '...' })

@rjmasikome
Copy link

I have tried to test this further with 4 different node version and 2 different bigtable version, however the workaround did not work. The console.log below is never really seen, and the program just exited from there. Note: Using client version 1.0.1 works.

Here's the snippet that I used

const table = require('@google-cloud/bigtable')({projectId: "my-project-1"}).instance("instance1").table("table1");

(async () => {
    await table.create();
    console.log("table created!")
    await table.row("nonexistent-row").exists();
    console.log("this is never seen!")
})();

For more context here is the environment that I used

  • OS: MacOS Mojave
  • Node.js version: 10.16.3, 11.15.0, 12.13.0, 13.0.1
  • yarn version: v1.19.1
  • @google-cloud/bigtable version: 2.1.0 and 2.2.1

Steps to reproduce:

  1. Make sure the affected bigtable client is installed
  2. Run bigtable emulator gcloud beta emulators bigtable start
  3. Save the snippet as bt.js
  4. Run with the proper env variable BIGTABLE_EMULATOR_HOST=127.0.0.1:8086 node bt.js

@google-cloud-label-sync google-cloud-label-sync bot added the api: bigtable Issues related to the googleapis/nodejs-bigtable API. label Jan 30, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 17, 2020
@kolea2 kolea2 added external This issue is blocked on a bug with the actual product. and removed 🚨 This issue needs some love. labels Sep 14, 2020
@danieljbruce
Copy link
Contributor

Try again using the latest version of the emulator and nodejs-bigtable. I get an output that looks like:

table created!
this is never seen!

@danieljbruce
Copy link
Contributor

This was fixed in version 3.0.0-beta.0 of nodejs-bigtable.

@danieljbruce danieljbruce self-assigned this Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/nodejs-bigtable API. external This issue is blocked on a bug with the actual product. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

7 participants