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!
Would you mind doing a full un- and re-installation of your project's node_modules (rm -rf node_modules && npm install). If that still doesn't work, try npm cache clean --force before the command.
Every time I try, I build a new Docker image, that means it is a clean install and I also tried the cache clean and it did not work. Could it be a problem with the Emulator version it self ?
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.
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.
0.16.2 is out! Please let me know if there are still any issues.
Seamless, Great work!
Thanks. This solved my problem. Just wanted to let you know that there are no prebuilt binaries for node 8 (at least for the version I'm using) and grpc-1.7.3. This makes my docker build times really long...
Is there any way I can know what prebuilt binaries there _are_ for this version of grpc and node, so I can fine tune the node version?
@giltayar Are you using Alpine? I think this is related to glibc vs musl (https://github.com/grpc/grpc/issues/6850). For this and other reasons we switched from Alpine back to Debian and we are able to use prebuilt grpc binaries (using pubsub 0.16.2).
Yes, I am. Ahhh.... thank you. I'll switch back to the regular debian. Thanks!
Although, given the love a lot of people have for Alpine, it _would_ be nice to have prebuilt binaries for them too... 馃槈
@stephenplusplus I'm experiencing the same issue with 0.16.3 when I downgrade to 0.16.2, I no longer get the error.
I'm trying to connect to the pubsub emulator.
OS: macOS 10.13.3
Node.js version: 8.7.0
npm version: 5.4.2
Yarn version: 1.3.2
version: 0.16.3
This is the error that I get on 0.16.3
TypeError: Channel's second argument must be a ChannelCredentials
at ServiceClient.Client (/Users/mazahmadi/microservices/financial-processing-service/node_modules/google-gax/node_modules/grpc/src/client.js:472:19)
at new ServiceClient (/Users/mazahmadi/microservices/financial-processing-service/node_modules/google-gax/node_modules/grpc/src/client.js:884:12)
at /Users/mazahmadi/microservices/financial-processing-service/node_modules/google-gax/lib/grpc.js:251:12
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
at Function.Module.runMain (module.js:667:11)
at Object.<anonymous> (/Users/mazahmadi/microservices/financial-processing-service/node_modules/babel-cli/lib/_babel-node.js:154:22)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
I have the same issue in version 0.28.0
const pubsub = require('@google-cloud/pubsub')
const grpc = require('grpc')
const client = new pubsub.v1.SubscriberClient({
servicePath: 'localhost',
port: 8085,
sslCreds: grpc.credentials.createInsecure()
})
Any help would be appreciated. Node 8.11.3
(node:39711) UnhandledPromiseRejectionWarning: TypeError: Channel's second argument must be a ChannelCredentials
@crivera Were you still able to fix this ?
Most helpful comment
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.