Cloudflare Tunnel failed to request a quick tunnel

I am trying to create a Shopify app and I am encountering an error when entering npm run dev command. The error message states that the Cloudflare Tunnel failed to request a quick tunnel due to an existing connection forcibly closed by the remote host. Iโ€™m relatively new to this, so this might be an easy setup issue, however I was not able to figure it out.

Thank you in advance for your help.

LOG:

npm run dev
 
> test-app@1.0.0 dev
> shopify app dev
 
 
To run this command, log in to Shopify Partners.
:point_right: Press any key to open the login page on your browser
โœ” Logged in.
 
Looks like this is the first time you're running dev for this project.
Configure your preferences by answering a few questions.
 
?  App name:
โœ”  TestApp
 
โœ” Using your default dev store (TestAppdevstore) to preview your project.
:white_check_mark: Success! Converted TestAppdevstore.myshopify.com to a Test store.
 
Error: Command failed with exit code 1: C:/Users/username/Documents/Programmering/Shopify/test-app/node_modules/@shopify/plugin-cloudflare/bin/cloudflared.exe tunnel --url http://localhost:55864 --no-autoupdate 
2023-04-10T11:49:58Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps
2023-04-10T11:49:58Z INF Requesting new quick Tunnel on trycloudflare.com...
failed to request quick Tunnel: Post "https://api.trycloudflare.com/tunnel": read tcp 192.168.0.91:55871->172.16.16.16:443: wsarecv: An existing connection was forcibly closed by the remote host.
    at makeError (file:///C:/Users/username/Documents/Programmering/Shopify/test-app/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///C:/Users/username/Documents/Programmering/Shopify/test-app/node_modules/execa/index.js:119:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exec (file:///C:/Users/username/Documents/Programmering/Shopify/test-app/node_modules/@shopify/cli-kit/dist/public/node/system.js:54:9)
PS C:\Users\username\Documents\Programmering\Shopify\test-app>
1 Like

Experiencing it right now also

Timed out while creating a cloudflare tunnel: failed to request quick Tunnel

adding --tunnel ngrok fixed the problem, looks like the default tunneling service will now be cloudflared.

npm run dev -- --reset --tunnel ngrok
4 Likes

Hey @ejprismfly

Glad you got this working.

If you run into any other errors while working with the Shopify CLI I would recommend checking in their Github Repoโ€™s Issues as well.

All the best

1 Like

Hey,

Iโ€™m having the same problem, and my default cloudfare tunnelling is not resetting.
I tried the same โ€œnpm run dev โ€“ --reset ngrokโ€ , tried with ngrok url as well

Could you please help me ?

3 Likes

Hey

Iโ€™m having the same problem, and my default cloudfare tunnelling is not resetting.
I tried the same โ€œnpm run dev โ€“ --reset ngrokโ€ , tried with ngrok url as well

1 Like

Hey @Samruddhi1 - this does seem odd, thanks for getting in touch. My team doesnโ€™t directly support the CLI, but I would recommend reaching out in the CLIโ€™s Github repo and opening an issue. I canโ€™t guarantee anything specifically, but opening up an issue and reporting the error there will get you in direct touch with the CLI developers and they may be able to help you out further.

This is usually the best place to get help for any of our development tools or specific API libraries for the programming languages we directly support (Ruby, Node.js, PHP).

Hope this helps.

Al | Shopify Developer Support

1 Like

worked for me thanks

which version of the shopify cli would you be using. I am using 3.49.2

And again for me. failed to request quick Tunnel โ€ฆ

Worked yesterday, today itโ€™s crap.

Is it possible to use my own ngrok tunnel, skipping the flaky cloudflared?

Iโ€™ve been experiencing this tunnel issue over the last 24 hours, and using my own ngrok tunnel works.

In a new terminal tab run

ngrok http 3000

and then in the other terminal tab, from within the repo of your app run shopify app dev --reset --tunnel-url {ngrok https url}:3000

For instance, mine was:

shopify app dev --reset --tunnel-url https://5127-46-149-103-112.ngrok-free.app:3000

hope that helps!

3 Likes

Thank you, Jamesdix and round. Did that and it worked. Happy to bid adieu to the often-dead (but free) cloudflared. Jb

I have also faced the same kind of issue and resolved after clearing the DNS Cache using this command ipconfig /flushdns

โ•ญโ”€ error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                              โ”‚
โ”‚  Could not start Cloudflare tunnel: failed to unmarshal quick Tunnel:        โ”‚
โ”‚  invalid character '<' looking for beginning of value                        โ”‚
โ”‚                                                                              โ”‚
โ”‚                                                                              โ”‚
โ”‚  What to try:                                                                โ”‚
โ”‚    โ€ข Run the command again                                                   โ”‚
โ”‚    โ€ข Add the flag `--tunnel-url {URL}` to use a custom tunnel URL

Or cough up $20/mo for ngrok and say goodbye and good riddance to the flaky cloudflare. Thatโ€™s what I did months ago and never looked back. Cheers jb