`Connection failed` issue after some successful calls

35 views
Skip to first unread message

krundru....@gmail.com

unread,
Jun 16, 2017, 5:39:25 PM6/16/17
to grpc.io, 116m...@gmail.com
Hi,

I am using gRPC on nodejs. I am able create a new client and  call rpc methods successfully but after some time, it is throwing me 'Connection failed` error.

from  rpc-client.js file

import grpc from 'grpc'

const package = grpc.load(PROTO_PATH).external.protocol
const client = new package.CkPublic(url, grpc.credentials.createInsecure())

function executeCommand(request) {
  return client.executeCommand(request)
}

export default { executeCommand }

from another-file.js  file:

import rpcClient from 'rpc-client.js'

var stream = rpcClient.executeCommand(request);

stream.on('error', ....)
stream.on('data', .....)
stream.on('status',....)
-----done-----

Error I am getting: 

> on status : Connect Failed
> { Error: Connect Failed
    at ClientReadableStream._emitStatusIfDone (/rapid/node_modules/grpc/src/node/src/client.js:209:19)
    at ClientReadableStream._readsDone (/rapid/node_modules/grpc/src/node/src/client.js:177:8)
    at readCallback (/rapid/node_modules/grpc/src/node/src/client.js:237:12) code: 14, metadata: Metadata { _internal_repr: {} } }

Can someone help me how to deal with this.

Reply all
Reply to author
Forward
0 new messages