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.

using "topic.exists()" raises "TypeError: Channel's second argument must be a ChannelCredentials"

See original GitHub issue

Environment details

Steps to reproduce

  1. Setup PubSub emulator and set PUBSUB_EMULATOR_HOST
  2. run topic.exists()

This issue does not happen with PubSub version 0.15.0, when upgrading to 0.16.* and calling topic.exists() the following error occur:

[0] (node:48) UnhandledPromiseRejectionWarning: TypeError: Channel's second argument must be a ChannelCredentials
[0]     at ServiceClient.Client (/usr/src/app/node_modules/google-gax/node_modules/grpc/src/client.js:472:19)
[0]     at new ServiceClient (/usr/src/app/node_modules/google-gax/node_modules/grpc/src/client.js:884:12)
[0]     at /usr/src/app/node_modules/google-gax/lib/grpc.js:245:12
[0]     at <anonymous>
[0]     at process._tickCallback (internal/process/next_tick.js:160:7)
[0]     at Function.Module.runMain (module.js:703:11)
[0]     at startup (bootstrap_node.js:194:16)
[0]     at bootstrap_node.js:618:3
[0] (node:48) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[0] (node:48) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
stephenpluspluscommented, Jan 9, 2018

This sounds like a problem with multiple versions of gRPC loading. I believe I’ve found the issue, and will be sending a PR soon.

2reactions
fardogcommented, Jan 6, 2018

I’m seeing this issue as well; an npm cache clean --force did not change the behavior, nor did whacking the package-lock.json and regenerating it from an npm install unfortunately.

{ '<redacted>': '1.2.0',
  npm: '5.5.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.1',
  openssl: '1.0.2m',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.47',
  zlib: '1.2.11' }

Let me know if i can provide any additional information.

Edit: the installation of pubsub was into a project that hasn’t previously had any google cloud libraries intalled in it; it was installed with an npm install @google-cloud/pubsub which got me version 0.16.1; for the sake of getting things rolling, I tried an older version by specifying 0.15.0 and that version is working fine against the emulator.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Channel's second argument must be a ChannelCredentials
I can use it perfectly without setting the credentials for gRPC. But I do not know if that would be a problem.
Read more >
gRPC Python 1.46.2 documentation
Creates a ChannelCredentials for use with an SSL-enabled Channel. ... Typically, this object is an argument to add_secure_port() method during server setup.
Read more >
UnhandledPromiseRejectionWar...
UnhandledPromiseRejectionWarning: TypeError: Channel credentials must be a ChannelCredentials object in GCP Batch publishing · Ask Question.
Read more >
google-auth Documentation - Read the Docs
Use application default credentials. default() will automatically detect if ... ment should not be set; otherwise ValueError will be raised.
Read more >
2 Server Error Message Reference - MySQL :: Developer Zone
Message: Key column '%s' doesn't exist in table ... Message: You must have privileges to update tables in the mysql database to be...
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