-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK Node.js & Docker: ECONNREFUSED 127.0.0.1:51024 #5587
Comments
@simon-tannai Looks like your bot is trying to start listening at Can you provide steps to reproduce? That's not the standard Bot Framework port number ( As you're running this in docker, you may need to expose the port when starting the container with something like: docker run -d -p 51024:51204 |
@simon-tannai, thanks for reporting. Are you seeing this in the Emulator? Could you hit the bot endpoint directly via postman? We'll also get someone from Support team to help. |
@mdrichardson I'm using Dockerfile and Docker Compose. My bot is listening on port Dockerfile:
Docker compose:
From Postman, a simple POST request on But through Bot Framework Emulator, it still not working. The port changed for I tested with Ngrok tunneling and it's working fine. I don't know if it's possible to "force" a localhost request from Docker's container to hit on host machine :S |
I think I understand. Are you saying that your requests are going like this:
When instead, you want this:
I'm having a little trouble understanding what's happening vs. what's expected. If I have this right, I don't believe you have an option other than to use ngrok. What's really happening is that messages get routed through Directline (a cloud service) and the urls for both Emulator and the Bot are You may be able to get around this with offline-directline, but I haven't tested it myself. Let me know if we're on the same page and I can test implementing this. |
@simon-tannai Are you still experiencing this issue? It needs to stay active to stay open. |
Closing due to lack of activity |
@mdrichardson Sorry for the delay :S I had tested offline directline but I got an error with it. I had opened an issue bot I didn't got any reply. |
@simon-tannai As posted above, can you explain what's happening vs. what you expect? |
@mdrichardson the process which you described above is exactly what's happen and what I expect. I would like to find a solution to not be forced to use Direct Line. |
I've ended up here with the same issue. If anyone finds these clues revealing.... Context:
The problem:
The error
Some clues So, first thing comes to my mind: who is 56868 (in case of @simon-tannai, the problematic port was 51024 instead... the number will change for sure) $» lsof -i tcp:56868
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Bot\x20Fr 13197 martero 56u IPv6 0x1b17a78f9dc82995 0t0 TCP *:56868 (LISTEN)
Bot\x20Fr 13197 martero 67u IPv6 0x1b17a78fa77edcd5 0t0 TCP localhost:56877->localhost:56868 (CLOSE_WAIT) Ok, so that's Bot Framework emulator listening on that port. My running container can't reach localhost:56868 (the emulator) (*) Dockerize the service Just for reference, this is my dockerfile: FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --only=production
COPY . ./
EXPOSE 3978
CMD [ "npm", "start" ] which I run as: |
@manutero Are you running ngrok? Ngrok (or similar tunneling service) is required for having Emulator communicate with a Dockerized bot running locally. |
Yep: ngrok http -host-header=rewrite 3978
[...]
Forwarding https://0d947dcab353.ngrok.io -> http://localhost:3978 The container is routing port 3978: $» docker run -p 3978:3978 <my-service:my-version> (I can check this setup since the server is returning a simple string at root path) $» curl localhost:3978
"my-service@my-version" Now, when I open the emulator connecting to
Now, are you saying to run ngrok from the running container? |
@manutero It's been awhile since I dockerized a bot. I'll attempt to repro today and see what I can figure out. |
@manutero With the recent versions of Emulator, you shouldn't need to run ngrok manually. First, please close your current running instance of Please ensure that you have the following Emulator settings:
Click Save, then when you Open Bot, use the Then, make sure you see this in the log panel: All of this is necessary for locally-running dockerized bots because of how docker intercepts and routes exposed ports. |
Thnks @mdrichardson !!! works like a charm 👍 |
@manutero AWESOME! Just FYI, in the future, open up a new issue and then just reference this one. You're much more likely to get a response to an open issue vs. a new comment on a closed one. |
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:
What is this
51024
port ?The text was updated successfully, but these errors were encountered: