When I try to create a SessionClient in a docker container, an error is thrown with a message that is not very helpful.
dialogflow-nodejs-client-v2 version: 0.6.0node:8.11.3-jessie)Source file is something like:
import dialogflow from "dialogflow";
const config = {
credentials: {
client_email: process.env.DIALOGFLOW_CLIENT_EMAIL,
private_key: process.env.DIALOGFLOW_PRIVATE_KEY,
},
};
const sessionClient = new dialogflow.SessionsClient(config);
Calls to new dialogflow.SessionsClient(config) result in stacktrace:
TypeError: Call can only be created with Channel.createCall
at getCall (node_modules/grpc/src/client_interceptors.js:651:14)
at node_modules/grpc/src/client_interceptors.js:784:16
at node_modules/grpc/src/client_interceptors.js:1381:14
at _buildChain (node_modules/grpc/src/client_interceptors.js:1384:33)
at Object.getInterceptingCall (node_modules/grpc/src/client_interceptors.js:1346:10)
at ServiceClient.Object.<anonymous>.Client.makeUnaryRequest (node_modules/grpc/src/client.js:481:47)
at apply (node_modules/lodash/lodash.js:478:17)
at ServiceClient.wrapper (node_modules/lodash/lodash.js:5337:16)
at node_modules/dialogflow/src/v2/sessions_client.js:148:39
at timeoutFunc (node_modules/google-gax/src/api_callable.ts:212:12)
Almost the same error when i try to interact with DialogFlow (set/get Intent/Entity), no problem on create SessionClient.
/usr/app/node_modules/grpc/src/client_interceptors.js:651
var call = channel.createCall(path, deadline, host,
^
TypeError: channel.createCall is not a function
at getCall (/usr/app/node_modules/grpc/src/client_interceptors.js:651:22)
at /usr/app/node_modules/grpc/src/client_interceptors.js:784:16
at /usr/app/node_modules/grpc/src/client_interceptors.js:1381:14
at _buildChain (/usr/app/node_modules/grpc/src/client_interceptors.js:1384:33)
at Object.getInterceptingCall (/usr/app/node_modules/grpc/src/client_interceptors.js:1346:10)
at ServiceClient.Client.makeUnaryRequest (/usr/app/node_modules/grpc/src/client.js:483:47)
at apply (/usr/app/node_modules/lodash/lodash.js:478:17)
at ServiceClient.wrapper (/usr/app/node_modules/lodash/lodash.js:5323:16)
at /usr/app/node_modules/dialogflow/src/v2/intents_client.js:238:39
at wrappedCall (/usr/app/node_modules/google-gax/build/src/paged_iteration.js:93:20)
at timeoutFunc (/usr/app/node_modules/google-gax/build/src/api_callable.js:165:16)
at repeat (/usr/app/node_modules/google-gax/build/src/api_callable.js:223:25)
at Immediate.retryingFunc [as _onImmediate] (/usr/app/node_modules/google-gax/build/src/api_callable.js:250:13)
at runCallback (timers.js:814:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
Could you please the paste exact version of all dependencies (in particular gRPC) from package-lock.json? I can't immediately repro. The error seems to come from gRPC internally: https://github.com/grpc/grpc-node/blob/master/packages/grpc-native-core/ext/call.cc#L582.
This is my complete package-lock.json.
Thanks for your help
{
"name": "xxxxx",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
....
}
@Xipotera I was running into the same problem you had. Fixed the issue by removing node_moodules and reinstall dependencies. Still not very sure what would cause this behavior
I run test about grpc, not in docker but on Linux, and I meet this problem. Like @bdatdo0601 said, remove node_modules and reinstall deps solves it.
We've recently switched to a newer pure JavaScript implementation of gRPC, so I'd be curious to know if anyone is still experiencing this issue with the latest version.
Doesn't seem to much activity here and I'm willing to wager its been solved with the move to grpc-js, so I'm going to close this out. If anyone continues to experience this issue, please let us know and we'll be happy to re-open and continue investigating. 馃槑
Most helpful comment
@Xipotera I was running into the same problem you had. Fixed the issue by removing
node_moodulesand reinstall dependencies. Still not very sure what would cause this behavior