botframework-sdk: SDK Node.js & Docker: ECONNREFUSED 127.0.0.1:51024

Hello !

I’m trying to push a bot built with Node.js Botframework SDK v4. The bot is starting up and when I’m sending a first message with Bot Framework SDK, I get this error: ECONNREFUSED 127.0.0.1:51024

The stack:

Error: connect ECONNREFUSED 127.0.0.1:51024
    at new RestError (/usr/src/node_modules/@azure/ms-rest-js/dist/msRest.node.js:1397:28)
    at AxiosHttpClient.<anonymous> (/usr/src/node_modules/@azure/ms-rest-js/dist/msRest.node.js:1550:35)
    at step (/usr/src/node_modules/tslib/tslib.js:136:27)
    at Object.throw (/usr/src/node_modules/tslib/tslib.js:117:57)
    at rejected (/usr/src/node_modules/tslib/tslib.js:108:69)
    at process._tickCallback (internal/process/next_tick.js:68:7)
BotFrameworkAdapter.processActivity(): 500 ERROR - Error: connect ECONNREFUSED 127.0.0.1:51024
(node:44) UnhandledPromiseRejectionWarning: Error: Error: connect ECONNREFUSED 127.0.0.1:51024
    at BotFrameworkAdapter.processActivity (/usr/src/node_modules/botbuilder/lib/botFrameworkAdapter.js:511:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:44) 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: 10)

What is this 51024 port ?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Thnks @mdrichardson !!! works like a charm 👍

@manutero With the recent versions of Emulator, you shouldn’t need to run ngrok manually.

First, please close your current running instance of ngrok.exe.

Please ensure that you have the following Emulator settings:

  1. Path to ngrok points to your ngrok.exe
  2. Bypass ngrok for local addresses is unchecked (you only want this unchecked for local docker bots since they run on localhost but still require routing)
  3. Run ngrok when the Emulator starts up is checked

image

Click Save, then when you Open Bot, use the http://localhost:3978/api/messages url and NOT the ngrok URL.

Then, make sure you see this in the log panel:

image

All of this is necessary for locally-running dockerized bots because of how docker intercepts and routes exposed ports.

@manutero Are you running ngrok? Ngrok (or similar tunneling service) is required for having Emulator communicate with a Dockerized bot running locally.