1
votes

I'm trying to use Microsoft's Virtual Assistant Template (https://github.com/microsoft/botframework-solutions/blob/master/docs/readme.md), and while I've finally successfully gotten that installed and working via Web Chat in Azure, I'm unable to get it working in Bot Emulator locally. I have ngrok installed, and Bot Emulator set to start it at startup, bit it's throwing an error.

In the Bot Emulator settings I have the path to the ngrok executable populated, I have the Bypass ngrok for local addresses checkbox checked (from the example in the setup documentation for this solution, I have the Run ngrok when the Emulator start up checkbox checked, Localhost override is set to localhost (again, from the solution example), and Locale is set to en-US. I've tried checking and unchecking the Bypass ngrok for local addresses checkbox, but the result is the same.

Below is the output from the connection attempt in the Bot Emulator.

[12:02:12]Emulator listening on http://localhost:50757
[12:02:33]Error: The bot is remote, but the service URL is localhost.
Without tunneling software you will not receive replies.
[12:02:33]Connecting to bots hosted remotely [12:02:33]Configure ngrok
[12:02:33]Failed to spawn
ngrok{"error_code":104,"status_code":503,"msg":"ngrok is not yet ready
to start tunnels","details":{"err":"a successful ngrok tunnel session
has not yet been established"}}

I suspect there is some ngrok configuration that is missing, but the documentation only shows the Bot Emulator settings relative to using ngrok for tunneling.

1
It looks like something is wrong with your ngrok. Can you open command line, navigate to the directory with ngrok.exe in it and run 'ngrok http 3978 -host-header="localhost:3978"'? What SHOULD happen is you CL will be replaced with the ngrok status information. - JJ_Wailes
So that command you suggested outputs version, region, web interface, and a list of connections (all with a count of 0). It also lists a session status of "reconnecting" with some IP addresses and a closing statement that "an existing connection was forcibly closed by the remote host". The session status then switches to "reconnecting (resolved tunnel.us.ngrok.com has no records)" before flipping back to the prior statement with the IP addresses. - StuartDouglas
So all is well, it seems. I redeployed everything to a new VM, and while I still initially get that ngrok failure to spawn error, that may just be a timing thing, as it later does connect and the virtual assistant loads and function in the bot emulator. - StuartDouglas
Virtual Machine -> Ngrok -> Azure Bot Service Registration -> Bot Framework Emulator (Make sure to add your App Id and Password to the Bot and the Emulator) - tdurnford

1 Answers

0
votes

I redeployed everything to a new VM, and while I still initially get that ngrok failure to spawn error, that is just be a timing thing, as it later does connect and the virtual assistant loads and functions locally in the bot emulator. Thanks to everyone for their suggestions.