BotFramework-Emulator icon indicating copy to clipboard operation
BotFramework-Emulator copied to clipboard

Unable to connect using Bot Framework Channel Emulator

Open ongzexuan opened this issue 9 years ago • 10 comments

I'm created a new bot using Azure Bot Services. I am trying to connect to it using the Bot Framework Channel Emulator.

I am consistently getting this error

-> POST 401 [conversationUpdate] [11:03:09] Error: The bot's MSA appId or passsword is incorrect.

The MSA AppId on both the emulator and the environment settings on the app are the same. I verified that. I have tried creating a new bot but I am getting the same problem.

I have tried the troubleshooting guide to set the appID and password to null and to remove the appID and password values from the emulator connection. I am getting the same error.

If I try to replace the endpoint with: http://localhost:3978/api/messages I get -> POST connect ECONNREFUSED 127.0.0.1:3978

Is this a problem with my configuration settings or something else. I am running on OSX 10.10.5.

ongzexuan avatar Mar 01 '17 03:03 ongzexuan

hi @ongzexuan, When you replaced your endpoint with http://localhost:3978/api/messages, was your bot running on localhost, and listening on that port? It would be good to first try to get bot & emulator talking in the simplest scenario: running locally with no MSA.

eanders-ms avatar Mar 01 '17 07:03 eanders-ms

I had this same issue, but it was caused because I had authentication and authorization set in my web.config. I worked around this by adding a location tag to the web.config that removed authentication for the api/messages path.

mdominioni avatar Mar 05 '17 04:03 mdominioni

Closing due to inactivity. Please open a new issue or comment here if you'd like further assistance.

eanders-ms avatar Mar 09 '17 05:03 eanders-ms

changing port number for iis express locally solved the same issue for me

priyankasrivas avatar Apr 19 '17 07:04 priyankasrivas

Can someone please help? I am running the ContosoFlowers file on VS and have the bot emulator running but I keep getting the following error: POST connect ECONNREFUSED 127.0.0.1:8080

Amrit2 avatar Jun 20 '17 08:06 Amrit2

I had this error previously: POST Request to 'http://127.0.0.1:8080/api/messages' failed: [500] Internal Server Error

and then made an ngrok tunnel and this is what it said: ngrok listening on https://c3aeabc8.ngrok.io [20:17:51] ngrok traffic inspector: http://127.0.0.1:4040 [20:17:51] Will bypass ngrok for local addresses

and then when i tried to send a message I got the ECONN error. No clue what to do.

Amrit2 avatar Jun 20 '17 08:06 Amrit2

Hi @Amrit2, what port is your bot listening on? You might also try replacing 127.0.0.1 with localhost in the endpoint URL.

eanders-ms avatar Jun 20 '17 16:06 eanders-ms

Hi Eanders, it's 8080. When I run the code it takes me to http://127.0.0.1:8080/api/messages (p.s. incase it makes a difference, I'm using mac)

Amrit2 avatar Jun 20 '17 20:06 Amrit2

For those who still sometimes have such an issue: I changed my api project's port from default one, in my case 3978, to 9000 and wrote to Bot Framework Channel Emulator URL box http://localhost:9000/api/messages, it worked.

burakkarakus avatar Oct 12 '17 19:10 burakkarakus

For those using WSL, I think this will not work if node index.js is run from within WSL while the Bot Framework Emulator is run in windows.

ethanabrooks avatar Jun 27 '23 18:06 ethanabrooks