4

I can't seem to make Azure Bot Framework Emulator work with Ngork.

Environment :

  • Ubuntu 22.04
  • Python3

Steps I followed :

{
  "error_code": 102,
  "status_code": 400,
  "msg": "invalid tunnel configuration",
  "details":
    {
      "err": "yaml: unmarshal errors:\n line 1: field region not found in type config.HTTPv2Tunnel\n line 1: field path not found in type config.HTTPv2Tunnel",
    },
}

enter image description here


Edit 1 : following @sairamtadepalli-mt 's suggestion

If I change Ngrok's port (web_addr) in the config, I get a new error :

Connecting to bot on https://XXX.azurewebsites.net/api/messages
ngrok reconnected.
ngrok listening on http://localhost:36599
ngrok traffic inspector:
Will bypass ngrok for local addresses
Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.
Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies.
Connecting to bots hosted remotely
Configure ngrok

Edit 2 : following @sairamtadepalli-mt 's suggestion

Here is what I see in the Status Viewer and console (still the same error as initially...) :

enter image description here

Error in the Emulator "Ngrok Status Viewer" : Looks like the ngrok tunnel does not exist anymore. Try reconnecting to Ngrok or examine the logs for a detailed explanation of the error.

enter image description here

Error in the console :

Failed to spawn ngrok Error: {"error_code":102,"status_code":400,"msg":"invalid tunnel configuration","details":{"err":"yaml: unmarshal errors:\n  line 1: field region not found in type config.HTTPv2Tunnel\n  line 1: field path not found in type config.HTTPv2Tunnel"}}

    at NgrokInstance.runTunnel (/tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrok.js:257:17)
    at async NgrokInstance.connect (/tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrok.js:120:24)
    at async /tmp/.mount_BotFraqqaRh3/resources/app.asar/app/server/ngrokService.js:165:15


3 Answers 3

9

I had same problems like yours using Ngrok v3 in a W10 PC. I have tried several things like configuring tunneling with yaml files with no luck.

Finally, I have used Ngrok version 2.3.40 from this link: ngrok releases

And now everything is working ok. HTH

2

For now, please just use ngrok version 2 and not 3 for bot emulator. I had mine working by installing version 2.3.40 as mentioned by @cdiazal.

No update yet for emulator to be compatible with ngrok 3.

Read the issue thread here: https://github.com/microsoft/BotFramework-Emulator/issues/2389

0

The problem was reproduced and the required changes to solve the issue are two.

Solution 1:

Findings: The major finding from the problem screenshot is, Tunneling software of ngrok was not installed properly. In the installation was completed from your end, but the configuration need to be changed from port side.

Solution: Re-install the tunneling software again from the scratch

Solution 2:

Findings: When the Emulator failed to load and launch the required operations, it means, the Post which was trying to connect is already in use. When it is trying to connect to the new port, the issue will happen

Follow the below link to install and configure Ngrok on Linux machine

https://ngrok.com/download

Configure the port which is not in use. Check whether 4040 is being used by web server or not. If it is being used, then change the port to 4041 and restart the emulator and check the connection.

9
  • Thanks @sairamtadepalli-mt ! I just purged and re-installed Ngrok via apt (curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok) and still have the same issue, even after a computer restart.
    – fleuryc
    May 23, 2022 at 9:37
  • What do you mean exactly by and how can I "Configure the port which is not in use." ?
    – fleuryc
    May 23, 2022 at 9:38
  • I also tried purging and re-installing with snap (snap install ngrok). Same issue.
    – fleuryc
    May 23, 2022 at 9:54
  • stackoverflow.com/questions/36018375/… Check this link to change the port number May 23, 2022 at 12:31
  • OK I changed the port, but I still have an error : cf. edited question Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.
    – fleuryc
    May 23, 2022 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.