I can’t seem to make Azure Bot Framework Emulator work with Ngork.
Environment :
- Ubuntu 22.04
- Python3
Steps I followed :
- Create a bot with the Bot Framework SDK
- => bot works fine locally with the Emulator
- Tutorial: Provision a bot in Azure
- Tutorial: Publish a basic bot
- => bot works fine in Azure with the Test Web Chat
- install and configure Tunneling (ngrok)
- => the status page of Ngrok (http://localhost:4040/status) says it is Onine
- => "Ngrok Status Viewer" says "Tunnel Status" is on error in the Emulator
- => I have error messages in the Emulator :
Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.
- => the status page of Ngrok (http://localhost:4040/status) says it is Onine
{
"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.HTTPv2Tunneln line 1: field path not found in type config.HTTPv2Tunnel",
},
}
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…) :
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.
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.HTTPv2Tunneln 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
2
Answers
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.
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