microsoft / BotFramework-Emulator

A desktop application that allows users to locally test and debug chat bots built with the Bot Framework SDK.
https://aka.ms/botemulator
MIT License
1.82k stars 756 forks source link

Failed to spawn ngrok #2389

Closed mgateno closed 2 months ago

mgateno commented 2 years ago

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

Version

What version of the Emulator are you using. 4.14.1-302259

Describe the bug

Give a clear and concise description of what the bug is. ngrok is not spawning. Trying to connect to a bot hosted in Azure

To Reproduce

Steps to reproduce the behavior:

  1. Path to ngrok set to '/snap/ngrok/current/ngrok'
  2. Open remote bot (saved as .bot)
  3. Error is in log 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_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"}} [17:05:33]Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies.

Expected behavior

Give a clear and concise description of what you expected to happen. ngrok spawns and I am able to connect to bot (this works from a windows machine).

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here. Ubuntu 20.04 LTS

[bug]

mgateno commented 2 years ago

Update

Changed path to ngrok to '/snap/bin/ngrok'

Now I can go into http://127.0.0.1:4040/status and see that ngrok is running but the tunnel is not active. Same error in the log. I can otherwise run ngrok manually and it works fine.

ngrok.yml is

authtoken: 25qpWK-------------------------------------------------------- version: "2" region: us

Ran 'ngrok config check' and comes back as valid.

anishprasad01 commented 2 years ago

Hi @mgateno,

Thanks for the report. I am able to reproduce this behavior in Ubuntu 20.04. I can also confirm that this issue does not occur in Windows. I will investigate further to see if I can determine a resolution.

anishprasad01 commented 2 years ago

Still investigating

mgateno commented 2 years ago

I have tried that but maybe I'm not doing it correctly. I spawn ngrok to listen to the same port where BFE is listening? I doesn't seem to find it. Can you please comment on the proper ngrok configuration?

On Tue, Jun 28, 2022 at 1:06 PM Anish Prasad @.***> wrote:

We're still looking into this. As a workaround in the meantime, you can launch ngrok from the terminal and use it that way.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/BotFramework-Emulator/issues/2389#issuecomment-1169056158, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4ACV4OWEEQDX5BWO7TUWLVRM5L7ANCNFSM5ZDSCBDA . You are receiving this because you were mentioned.Message ID: @.***>

-- Marco Gateño Ch.

anishprasad01 commented 2 years ago

Ah, I deleted that because it's primarily for the reverse. You want to communicate with a hosted bot on the local Emulator. The CLI method is for communication with a local bot from a remote client. If I determine a way to do it, I will update here.

mgateno commented 2 years ago

Ok, thanks for the clarification.

On Tue, Jun 28, 2022 at 4:55 PM Anish Prasad @.***> wrote:

Ah, I deleted that because it's primarily for the reverse. You want to communicate with a hosted bot on the local Emulator. The CLI method is for communication with a local bot from a remote client.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/BotFramework-Emulator/issues/2389#issuecomment-1169320115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4ACV6V2WK6PNZ3YVJ5RH3VRNYGXANCNFSM5ZDSCBDA . You are receiving this because you were mentioned.Message ID: @.***>

-- Marco Gateño Ch.

anishprasad01 commented 2 years ago

@mgateno

It looks like the issue is being caused by breaking changes in ngrok agent v3. For the time being, you can work around this by downloading the latest v2 version of ngrok instead.

I can also confirm this issue is not specific to Ubuntu. Ngrok v3 does not work with Emulator on any platform. We will continue to investigate and look for a fix.

mgateno commented 2 years ago

Thanks for the workaround. I will be looking out for a more permanent fix

anishprasad01 commented 2 years ago

I'm still working on it. I think I may have identified a potential fix, but it requires further testing to ensure it does not cause regressions or introduce new bugs.

anishprasad01 commented 2 years ago

No need. The incompatibility between Ngrok 3.x and Emulator affects all platforms. Until we release a fix, the workaround is to use Ngrok 2.x or test the bot from Test in Web Chat or the desired channel.

miguelhughes commented 10 months ago

I'm confused: pull request #2399 was merged, which fixes this bug. Why is this still open? It seems I still have this error, and there's also #2394. Is this included in v4.14.1?

OEvgeny commented 10 months ago

The fix is available in the latest Emulator nightly release, not in stable yet. I was able to set ngrok up while working on the PR. Please let me know if you have further issues.

Emmi05 commented 10 months ago

Sorry, but where can i configure my ngrok? Also what i have to do if i have a code from azure and i want to explore and edit some texts but i want to test in local? I previously installed, SDK 6,7,3.1, also i have the emulator. image image

d-kleine commented 7 months ago

@Emmi05 At the left side panel, bottom right corner, click on the gear symbol there: grafik

For the Ngrok version conflict, there has been also a workaround posted here

AttackOnMorty commented 7 months ago

For the Ngrok version conflict, there has been also a workaround posted here

@d-kleine This is not working unless you are a paid ngrok account.

It will force you to upgrade to v3 after running the command ngrok http 3980. And v3 it's not working. It's a dead loop.

(Note: I am using Mac with ngrok v2.3.41)

image
d-kleine commented 6 months ago

Yeah, I having the same issue. See also microsoft/BotFramework-Emulator#2443

d-kleine commented 6 months ago

@AttackOnMorty Have you tried the latest nightly build? For me, it worked with ngrok 3.9 with the Echo Bot. At least locally without authorization (no MSAppID, no MSAppPassword), it works for me. Tested with echo bot locally: bfe_ngrok_status bfe_local_test

For anyone that wants to reproduce:

interfacemirror commented 2 months ago

Facing the same dead loop. The Emulator needs ngork with region. The region field is deprecated in ngork v3.16. I tried using ngork v2.3 but ngork does not allow me old versions. Any help with this?

d-kleine commented 2 months ago

@tracyboehrer fyi

tracyboehrer commented 2 months ago

Closing this issue. The next release of Emulator will be removing ngrok completely. Tunneling will be an external concern and replaced with devtunnels as the recommendation, though any tunnel would still work. ETA likely in the next couple of weeks.