Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error starting tunnel: Error: Error: failed to start tunnel #283

Closed
mariotacke opened this issue Jun 21, 2017 · 22 comments
Closed

Error starting tunnel: Error: Error: failed to start tunnel #283

mariotacke opened this issue Jun 21, 2017 · 22 comments

Comments

@mariotacke
Copy link

mariotacke commented Jun 21, 2017

I've been happily developing all day through the Expo tunnel feature until I restarted my project. I receive a valid exp:// link, but the device says "No experience can be found at ...". I have restarted my Expo XDE and tried starting through the exp CLI. I tried clearing the Expo XDE cache to no avail.

λ exp start --tunnel --dev
[exp] Making sure project is set up correctly...
[exp] Your project looks good!
[exp] Using project at <my project path>
[exp] Starting React Native packager...
[exp] Scanning 676 folders for symlinks in <my project path>\node_modules (17ms)
[exp] Loading dependency graph.
[exp] Running packager on port 19001.
[exp] Expo is ready.
[exp] You can scan this QR code:

<omitted>

[exp] Your URL is

exp://<my random url>.mariotacke.mobile.exp.direct:80

[exp] Logs for your project will appear below. Press Ctrl+C to exit.
[exp] Dependency graph loaded. 

The Expo XDE client log shows:

5:00:20 PM Starting React Native packager...
5:00:21 PM Scanning 676 folders for symlinks in <my project path>\node_modules (23ms)
5:00:22 PM Loading dependency graph.
5:00:22 PM Running packager on port 19001.
5:00:22 PM
5:00:26 PM Error starting tunnel: Error: Error: failed to start tunnel
5:00:26 PM Project opened! You can now use the "Share" or "Device" buttons to view your project.
5:00:34 PM Dependency graph loaded.

Any idea how to further debug this? It looks like the packager starts properly and the tunnel URL gets created.

I ran a netstat to look for any orphaned process that blocks the port, but I got nothing.

System: Windows 10
SDK: 17.0

@ide
Copy link
Member

ide commented Jun 21, 2017

The tunnel software we use is ngrok (https://ngrok.com) so I'd try testing ngrok out to make sure it works on your computer before spending more time. (XDE and exp have a LAN option where your project URLs contain LAN IP addresses instead of the exp.direct tunnel URLs.)

If ngrok works I'd recommend a few things while debugging:

  1. Close your project in XDE and open it again.
  2. Try to load the URL in your browser on your computer (switch out exp:// for http://). If that works, the development server is up and running.
  3. Try to load the URL from your phone's browser to make sure your phone can reach your development server.
  4. Lastly, open the URL in the Expo client.

@mariotacke
Copy link
Author

Thanks for your help, James. I tried running ngrok and it works without issues. When I try to load the URL from the Expo client through the browser, I get Tunnel <my random url>.mariotacke.mobile.exp.direct not found. I just got home, so I can develop against the LAN option for now.

Could there be communication issues with mobile.exp.direct? I suppose this is a sort of tunneling service from Expo?

@ide
Copy link
Member

ide commented Jun 21, 2017

@mariotacke Is your Expo username mariotacke.mobile? I'm wondering if it has a dot in it and if that's messing up the subdomain....

@mariotacke
Copy link
Author

Nope, it is only mariotacke. I registered through the GitHub integration and am logging in with mariotacke + password.

@mariotacke
Copy link
Author

I switched back and forth between Tunnel and LAN options and both stopped working now. After some time (~1m) I get this stack trace in the Expo XDE client:

6:45:54 PM
Error starting tunnel: Error: Error: panic: runtime error: invalid memory address or nil pointer dereference

github.com/inconshreveable/olive/recover.go:40
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
<autogenerated>:30
<autogenerated>:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_amd64.s:479
runtime/panic.go:458
github.com/inconshreveable/olive/error.go:37
runtime/asm_amd64.s:479
runtime/panic.go:458
runtime/panic.go:62
runtime/signal_windows.go:161
lib/tunnel/client/reconnecting.go:39
lib/tunnel/client/session.go:97
ngrok/tunnel_session.go:138
ngrok/web_api.go:95
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
<autogenerated>:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
<autogenerated>:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
<autogenerated>:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
<autogenerated>:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
ngrok/src/ngrok/web.go:27
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69

@ide
Copy link
Member

ide commented Jun 21, 2017

exp.direct is the domain we tell ngrok to use for tunneling. The entire tunneling implementation (including the stack trace above) is ngrok. Aside from trying to restart all the things, in XDE you could try hitting Ctrl+Shift+I to bring up the devtools and see if there are any errors in the console.

@mariotacke
Copy link
Author

Interesting. I wonder where the mobile part comes from in the domain. For whatever reason, it is working again today (the tunnel proxy). Thanks for all of your help.

Not sure if this could be related to the exp.direct service not liking me for a few hours... I guess we can close this issue.

@ide
Copy link
Member

ide commented Jun 22, 2017

Is your project slug called "mobile"? I think that might be where it came from.

Glad to hear it is working for you now and sorry about the temporary unavailability. Will close this issue now.

@ide ide closed this as completed Jun 22, 2017
@mariotacke
Copy link
Author

No, my project slug is "manifest" (product name), my actual project folder is "mobile" (git). Who knows what happened, I'm glad it is back to normal. :)

@brunont
Copy link

brunont commented Jul 31, 2017

I also had this problem today. It looks like sometimes ngrok can't create the tunnel. But changing the Expo XDE Host to LAN instead of Tunnel solved it... Tks @ide

@dangbh1002-org
Copy link

Expo and react-devtools conflict!!! If you are using react-devtools, you must uninstall it:
npm uninstall react-devtools --save-dev

@RyanPWalker
Copy link

Neither the tunneling nor LAN have been working all day, but without even changing anything tonight the tunneling suddenly works again. Any idea why this happens?

@umar1921
Copy link

This worked for me...

capture

@gregpalaci
Copy link

npm uninstall react-devtools -g after 6 hours of trying everything...

@BalajiTheo
Copy link

running ngrok.exe in the background, appears to be the workaround

@acomito
Copy link

acomito commented Dec 29, 2017

wow...... I needed this so bad. Might be worth adding a warning?

@ihusak
Copy link

ihusak commented Feb 27, 2018

@gregbenner delete devtools works for me

@jojomickymack
Copy link

I believe there are multiple causes for the 'Error: failed to start tunnel' notification is shown - for me (on windows 10), I realized that the error didn't come up and tunnel url was successful when a physical android was plugged in for debugging. My attempts to deploy to 'genymotion' continued to get the 'failed to start tunnel' notification until I added the android 'platform-tools' directory to my path. It must be looking for adb and can't find it unless this is done.

Not having the 'platform-tools' added to my path is what was causing the error on my system.

@vikulkumar123
Copy link

"We noticed your tunnel is having issues. This may be due to intermittent problems with our tunnel provider. If you have trouble connecting to your app, try to Restart the project, or switch Host to LAN."

please help me solve this error.

@brunont
Copy link

brunont commented May 30, 2019

Hi @vikulkumar123, have you tried restarting the project, switching host to lan and all other tips above?

@varuntyagi001
Copy link

I was somehow able to identify the problem. You just need to do ipconfig /all (windows) or ifconfig (unix) and check for Wireless LAN adapter WIFI IPV4 Address and replace the host in exp URL with it.

exp://192.168.84.161:19000 (This published URL on expo start was using ethernet IPV4 adress instead of Wireless LanIPV4 192.168.0.10)

Changing the host and directly hitting it on safari opens a expo app and loads the react app successfully

Hope this will help everyone facing this problem.
replaced it with

@pencilcheck
Copy link

Start getting Tunnel URL not found, falled back to LAN URL., how do I solve this? Changed network, downloaded ngrok (and it worked) and not sure what to do.

@lock lock bot added the outdated label Mar 17, 2020
@lock lock bot locked and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests