question-mark
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.

Emulator doesn't recognize localhost

See original GitHub issue

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

4.4.2

Describe the bug

My bot is run though http://localhost:3978/api/messages, which I can confirm through trying to connect to the port in browser. However, the emulator is not recognizing the port. Regardless of whether or not the bot is running, I get the same error log:

[08:52:02]Emulator listening on http://localhost:61074 [08:52:02]ngrok not configured (only needed when connecting to remotely hosted bots) [08:52:02]Connecting to bots hosted remotely [08:52:02]Edit ngrok settings [08:52:02]The bot's Microsoft App Id or Microsoft App Password is incorrect. [08:52:02]POSTdirectline.conversationUpdate [08:52:02]The bot's Microsoft App Id or Microsoft App Password is incorrect. [08:52:02]POSTdirectline.conversationUpdate [08:52:02]POST200directline.startConversation [08:53:17]-> messagehello [08:53:17]POST400directline.postActivity

To Reproduce

Steps to reproduce the behavior:

  1. Get EchoBot sample code (from either Azure or Framework Template)
  2. Start debugging
  3. Obtain localhost address shown by browser page
  4. In bot emulator, press “Open Bot” and enter localhost address, as well as AppId and password obtained from appsettings.json file.
  5. Click connect

Expected behavior

The log appears as above, with any input messages giving the same POST 400 error.

Additional context

I have tried the following potential solutions with no luck:

  1. Download clean version of the echo bot
  2. Leave blank, comment out, or delete AppId and Password
  3. Reinstall Visual Studio
  4. Reinstall packages
  5. Build the echo bot from command line instead of Visual Studio
  6. Try “create a new bot configuration”, which just gives an infinite “connecting” message
  7. Try previous versions of the emulator

I have also documented the problem on Stack Overflow: https://stackoverflow.com/questions/56529611/bot-emulator-error-post-400-directline-postactivity

[bug]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
tonyanzianocommented, Nov 20, 2019

Hi @khiemnvd ,

Try setting the HTTPS_PROXY environment variable with the address of your proxy, and then try using the Emulator to connect to your bot. (I would recommend restarting the Emulator after setting the variable)

Ex: set HTTPS_PROXY=http://[proxy-address][:port]

1reaction
tonyanzianocommented, Jul 16, 2019

Closing due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you connect localhost in the Android emulator?
Use 10.0.2.2 to access your actual machine. · Backend running on localhost:8080 · Fetch your IP address (ipconfig on Windows).
Read more >
How to connect your Android emulator to a local web service
The first step is to update the base URL of your requests to 10.0.2.2 , which is a “[s]pecial alias to your host...
Read more >
Android Emulator Localhost Restful Api - YouTube
Android emulator restful api, connection closed problem solved.Buy me a coffeehttps://www.buymeacoffee.com/dbestech/e/79321.
Read more >
Run functions locally | Cloud Functions for Firebase - Google
The Cloud Functions runtime sets the EVENTARC_EMULATOR environment variable to localhost:9299 in the current process if the Eventarc emulator is running. The ...
Read more >
Install and develop locally with Azure Cosmos DB Emulator
For more information, see the command-line tool reference article. The Azure Cosmos DB Emulator by default runs on the local machine ("localhost ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found