Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
416 stars 125 forks source link

[Bug]: Multiple tunnel plugins for cloudflare found - running 'app dev' #4132

Closed ozzyonfire closed 2 months ago

ozzyonfire commented 3 months ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App

Expected behavior

It should be able to start my dev server and link it to cloudflare.

Actual behavior

Received an error, "Multiple tunnel plugins for cloudflare found". No docs suggest how to configure plugins?

Verbose output

2024-06-27T14:37:54.604Z: Running command app dev
2024-06-27T14:37:54.613Z: Getting a random port...
2024-06-27T14:37:54.618Z: Random port obtained: 54564
2024-06-27T14:37:54.813Z: cloudflared already installed, skipping
2024-06-27T14:37:54.816Z: 
Running system process:
  · Command: /Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/bin/cloudflared tunnel --url http://localhost:54564 --no-autoupdate
  · Working directory: /Users/ozzyonfire/Development/ec/shopify/cart-plus

2024-06-27T14:37:54.860Z: 2024-06-27T14:37:54Z 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
2024-06-27T14:37:54Z INF Requesting new quick Tunnel on trycloudflare.com...

2024-06-27T14:37:55.040Z: 
Running system process:
  · Command: /Users/ozzyonfire/.local/share/@shopify/cli/node_modules/@shopify/plugin-cloudflare/bin/cloudflared tunnel --url http://localhost:54564 --no-autoupdate
  · Working directory: /Users/ozzyonfire/Development/ec/shopify/cart-plus

╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                            │
│  Multiple tunnel plugins for cloudflare found                                                                                                                                                              │
│                                                                                                                                                                                                            │
│  To investigate the issue, examine this stack trace:                                                                                                                                                       │
│    at startTunnelPlugin (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:214203)                                                                  │
│    at async prepareForDev (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:217933)                                                                │
│    at async dev2 (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:217923)                                                                         │
│    at run (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:218219)                                                                                │
│    at _run (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/chunk-GEN4RXTD.js:209983)                                                                      │
│    at runCommand (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/chunk-GEN4RXTD.js:208416)                                                                │
│    at run (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/chunk-GEN4RXTD.js:210097)                                                                       │
│    at async runCLI (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:192823)                                                                       │
│    at async runShopifyCLI (Users/ozzyonfire/Library/pnpm/global/5/.pnpm/@shopify+cli@3.63.0/node_modules/@shopify/cli/dist/index.js:223114)                                                                │
│                                                                                                                                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-06-27T14:37:55.082Z: 
Running system process:
  · Command: npm prefix
  · Working directory: /Users/ozzyonfire/Development/ec/shopify/cart-plus

2024-06-27T14:37:55.266Z: 2024-06-27T14:37:55Z 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

2024-06-27T14:37:55.266Z: 2024-06-27T14:37:55Z INF Requesting new quick Tunnel on trycloudflare.com...

2024-06-27T14:37:55.317Z: Obtaining the dependency manager in directory /Users/ozzyonfire/Development/ec/shopify/cart-plus...
2024-06-27T14:37:55.466Z: 
Running system process:
  · Command: ruby -v
  · Working directory: /Users/ozzyonfire/Development/ec/shopify/cart-plus

2024-06-27T14:37:55.886Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 411 ms
With response headers:
 - x-request-id: 76f1b03e-bb5a-4d73-b9e1-da74ff7662e2

2024-06-27T14:37:55.887Z: Analytics event sent: {
  "command": "app dev",
  "time_start": 1719499074606,
  "time_end": 1719499075079,
  "total_time": 473,
  "success": false,
  "cli_version": "3.63.0",
  "ruby_version": "3.0.0",
  "node_version": "20.12.2",
  "is_employee": false,
  "uname": "darwin arm64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/cli\",\"@shopify/plugin-cloudflare\"]",
  "env_shell": "zsh",
  "env_device_id": "6a8c4b39eb2c8043b6b2cc9ebf75c00a8205c18b",
  "env_cloud": "localhost",
  "env_package_manager": "pnpm",
  "env_is_global": true,
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_all_timing_network_ms": 0,
  "cmd_all_timing_prompts_ms": 0,
  "cmd_all_launcher": "unknown",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/cli",
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "18124ff65fb773bb7b1750d1fd5c49afbf1cc62d",
  "cmd_app_dependency_installation_skipped": false,
  "cmd_app_reset_used": false,
  "cmd_dev_tunnel_type": "cloudflare",
  "cmd_all_timing_active_ms": 473,
  "cmd_all_exit": "unexpected_error",
  "args": "--verbose",
  "error_message": "Multiple tunnel plugins for cloudflare found",
  "env_plugin_installed_all": "[\"@shopify/cli\",\"@shopify/plugin-cloudflare\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2024-06-27T14:37:55.888Z: Reporting unhandled error to Bugsnag: Multiple tunnel plugins for cloudflare found
2024-06-27T14:37:56.116Z: 2024-06-27T14:37:56Z INF +--------------------------------------------------------------------------------------------+
2024-06-27T14:37:56Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
2024-06-27T14:37:56Z INF |  https://idol-beast-hands-src.trycloudflare.com                                            |
2024-06-27T14:37:56Z INF +--------------------------------------------------------------------------------------------+

2024-06-27T14:37:56.117Z: 2024-06-27T14:37:56Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
2024-06-27T14:37:56Z INF Version 2024.2.1
2024-06-27T14:37:56Z INF GOOS: darwin, GOVersion: go1.21.5-devel-cf, GoArch: amd64

2024-06-27T14:37:56.117Z: 2024-06-27T14:37:56Z INF Settings: map[ha-connections:1 no-autoupdate:true protocol:quic url:http://localhost:54564]

2024-06-27T14:37:56.121Z: 2024-06-27T14:37:56Z INF Generated Connector ID: 167cca0e-5084-4d72-bab1-16994f7b56b7

2024-06-27T14:37:56.198Z: 2024-06-27T14:37:56Z INF Initial protocol quic

2024-06-27T14:37:56.199Z: 2024-06-27T14:37:56Z INF ICMP proxy will use 192.168.1.60 as source for IPv4

2024-06-27T14:37:56.199Z: 2024-06-27T14:37:56Z INF ICMP proxy will use fe80::14b2:7012:35e4:8506 in zone en7 as source for IPv6

2024-06-27T14:37:56.200Z: 2024-06-27T14:37:56Z INF Created ICMP proxy listening on 192.168.1.60:0

2024-06-27T14:37:56.200Z: 2024-06-27T14:37:56Z INF Created ICMP proxy listening on [fe80::14b2:7012:35e4:8506%en7]:0

2024-06-27T14:37:56.252Z: 2024-06-27T14:37:56Z INF Starting metrics server on 127.0.0.1:54578/metrics

2024-06-27T14:37:56.283Z: 
Running system process:
  · Command: npm prefix
  · Working directory: /Users/ozzyonfire/Development/ec/shopify/cart-plus

2024-06-27T14:37:56.407Z: 2024-06-27T14:37:56Z WRN Your version 2024.2.1 is outdated. We recommend upgrading it to 2024.6.1

2024-06-27T14:37:56.437Z: Obtaining the dependency manager in directory /Users/ozzyonfire/Development/ec/shopify/cart-plus...
2024-06-27T14:37:56.632Z: 2024-06-27T14:37:56Z INF Registered tunnel connection connIndex=0 connection=9bb9deb3-127f-449d-96c0-46fc200aaaf3 event=0 ip=198.41.192.37 location=ewr05 protocol=quic

Reproduction steps

  1. Upgrade to latest @shopify/cli version (3.63.1)
  2. Try to start a dev server.

Operating System

Mac OS Sonoma

Shopify CLI version (check your project's package.json if you're not sure)

3.63.1

Shell

zsh, pnpm@9

Node version (run node -v if you're not sure)

v20.12.2

What language and version are you using in your application?

Node

ozzyonfire commented 3 months ago

Downgrading to 3.58.2 and install @shopify/app@3.58.2 works with "shopify app dev"

isaacroldan commented 3 months ago

Hi @ozzyonfire, to better understand why this could happen:

ozzyonfire commented 2 months ago

I used to run it locally, and now switched to the global pnpm installation.

I've tried with the @shopify/cli and @shopify/app in my dependencies and I've tried removing them. I get the same problem

ozzyonfire commented 2 months ago

just tried upgrading to 3.64.0. Scaffolded a new app with shopify app init. Still getting the same error.

ozzyonfire commented 2 months ago

Fixed it!

After trying a bunch of things. running shopify plugins update and that seemed to fix the cloudflare plugin.