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.

[ServiceBus] Can't retrieve message: ECONNRESET error

See original GitHub issue

Hi there,

I’m trying to use the Service Bus from the NodeJS SDK… but get some errors on retrieving messages posted.

My package.json dependency:

 "dependencies": {
    "azure": "^0.9.11"

NodeJS version: 0.10.29 Here is my simplified code:

var azure = require('azure');
var azureServiceBus = azure.createServiceBusService();
    azureServiceBus.sendTopicMessage('default', 'test', function(err) {
        if (err) {
        console.log( + " - " + 'sendTopicMessage failed: ' + JSON.stringify(err));
    } else {
            console.log('Retrieving message');
            azureServiceBus.receiveSubscriptionMessage('default', 'my_subscription', function(err, receivedMessage) {
                if (err) {
                    if (err !== 'No messages to receive') {
                        console.log( + " - " + 'Error receiving message: ' + JSON.stringify(err));
                    console.log( + " - " + err);

                if (receivedMessage) {
                    console.log( + " - " + 'Brut: ' + receivedMessage);


Retrieving message
42076 - Error receiving message: {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}
42076 - Error: read ECONNRESET

Subscription and topic exist I know the sendTopicMessage works well because, from the portal, I can see message counter in other subscriptions is incremented From the portal, on the subscription “my_subscription” counter stay empty. Meaning that my subscription grabbed well the message from the service bus… but I don’t have this result in my callback…

I’m guessing a SDK error or something badly interacting with the request object.

Any clue on that please? Does anyone using the service bus can make it work?

Thank you,

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:15

github_iconTop GitHub Comments

sye1774commented, Mar 21, 2016

I’ve been experiencing this as well since 3/14/16.

2016-03-21T14:42:55.253Z: { [Error: tunneling socket could not be established, cause=socket hang up] stack: [Getter/Setter], code: ‘ECONNRESET’, __frame: { name: ‘__1’, line: 49, file: ‘/usr/local/lib/node_modules/azure-cli/lib/commands/login.js’, prev: undefined, calls: 0, active: false, offset: 64, col: 27 }, rawStack: [Getter] } Error: tunneling socket could not be established, cause=socket hang up <<< async stack >>> at __1 (/usr/local/lib/node_modules/azure-cli/lib/commands/login.js:113:28) <<< raw stack >>> at ClientRequest.onError (/usr/local/lib/node_modules/azure-cli/node_modules/request/node_modules/tunnel-agent/index.js:176:17) at ClientRequest.g (events.js:260:16) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at TLSSocket.socketErrorListener (_http_client.js:256:9) at emitOne (events.js:77:13) at TLSSocket.emit (events.js:169:7) at emitErrorNT (net.js:1255:8) at nextTickCallbackWith2Args (node.js:437:9) at process._tickCallback (node.js:351:17)

jjongsmacommented, Jan 11, 2016

Started seeing this a lot again just recently. Anyone else?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Service Bus Unknown Error code ECONNRESET
We have started facing an exception " ECONNRESET " while reading and pushing message in the SericeBusQueue with the frequency of every 3-4 ......
Read more >
Service Bus messaging exceptions - Azure - Microsoft Learn
This article provides a list of Azure Service Bus messaging exceptions and suggested actions to taken when the exception occurs.
Read more >
Error: read ECONNRESET Packages failed to restore
I am trying to restore NuGet packages from the Azure Artifacts feed with the task "Nuget restore" which is giving an error -...
Read more >
Unable to retrieve messages using AMQP Trigger with Azure ...
Describe the issue/error/question ... I'd provided the required credential and queue as per AMQP trigger but upon listening for 30s it returned ...
Read more >
@azure/service-bus - npm
Azure Service Bus SDK for JavaScript. Latest version: 7.7.3, last published: 2 months ago. Start using @azure/service-bus in your project by ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found