arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
276 stars 129 forks source link

Error: Channel ended, no reply will be forthcoming #101

Closed raushansingh629 closed 6 years ago

raushansingh629 commented 7 years ago

I am using rabbot version 1.1.0 for report generation . i created 200 task(for request using persistent queue and for reply using rabbot autogenerated queue), rabbot configuration that i am using: "rabbitConfig": { "connection": { "user": "xyz", "pass": "**", "server": [ "192.168.9.224" ], "port": 5672, "vhost": "uat", "replyTimeout": 3600000, //rabbit throw exception if reply not received with specified replyTimeout(3600000ms=1hr). "retryLimit": 999999999, // limits how many consecutive failed attempts rabbot will make. Defaults to 3 "failAfter": 999999, // limits how long rabbot will attempt to connect (in seconds). Defaults to 60. "timeout": 1000000, //how long to wait for a connection to be established. 2 second default. "heartbeat": 1 }, "queues": [ { "name": "report.generator.request.queue", "limit": 20, //limit is prefetch limit "queueLimit": 99999, //queueLimit is how many totall message can be allowed in queue "subscribe": true, "durable": true } ], "exchanges": [ { "name": "report.generator.request.exchange", "type": "direct", "persistent": true, "durable": true } ], "bindings": [ { "exchange": "report.generator.request.exchange", "target": "report.generator.request.queue", "keys": [ "post" ] } ] },

}

I am using handle and request method to send and receive task.

sometimes in between processing of task, i am getting the following error:

Potentially unhandled rejection [1] Error: Channel ended, no reply will be forthcoming at rej (node_modules/amqplib/lib/channel.js:190:7) at Channel.C._rejectPending (node_modules/amqplib/lib/channel.js:192:28) at Channel.C.toClosed (node_modules/amqplib/lib/channel.js:160:8) at Connection.C.closeChannels (node_modules/amqplib/lib/connection.js:392:18) at Connection.C.toClosed (node_modules/amqplib/lib/connection.js:399:8) at Connection.accept (node_modules/amqplib/lib/connection.js:378:12) at Socket.go (node_modules/amqplib/lib/connection.js:476:48) at emitNone (events.js:86:13) at Socket.emit (events.js:185:7) at emitReadable (_stream_readable.js:438:10)

=> what is issue ? it's issue in rabbot or rabbitmq or some rabbot configuration missing

JimiC commented 6 years ago

I've seen this error in other projects that use amqplib. https://github.com/squaremo/amqp.node/issues/250

arobson commented 6 years ago

@raushansingh629 - amqplib is a great lib but there are some edge cases I have found in the channel implementation that I have not always been able to catch.

I do ask that you upgrade to 2.x since I have done a great deal of work to try and improve fault tolerance and logging. However, if you continue to experience this issue, try adding the following:

process.on('unhandledRejection`, (p, e) => {
   console.log(p, e);
});

To see if it gives you a better stack trace. Note that the stack trace there is entirely within the other library and not something I can likely get to unless I have more information that may indicate contextual clues for where I could attach a catch or rejection handler.

Thanks.