Shopify / cli

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

[Bug]: Shopify Cli Login Issue "The requested scope is invalid, unknown, or malformed." #3962

Closed valma-julius closed 4 months ago

valma-julius commented 4 months ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App

Expected behavior

You would expect to be able to login into the cli

Actual behavior

I want to be able to login however i only get 127.0.0.1 page with this:

Something went wrong!
There was an issue while trying to authenticate.

Return to your terminal and try running the previous command again.

and in the terminal I get this:

To run this command, log in to Shopify.
๐Ÿ‘‰ Press any key to open the login page on your browser
โ•ญโ”€ error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                                                                                                                                 โ”‚
โ”‚  The requested scope is invalid, unknown, or malformed.                                                                                                                         โ”‚
โ”‚                                                                                                                                                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

I cannot debug this in any way

Verbose output

โฏ shopify app dev --verbose
(node:47032) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
2024-06-01T09:00:38.325Z: Running command app dev
2024-06-01T09:00:38.334Z: Getting a random port...
2024-06-01T09:00:38.338Z: Random port obtained: 63591
2024-06-01T09:00:38.384Z: cloudflared already installed, skipping
2024-06-01T09:00:38.388Z: 
Running system process:
  ยท Command: /Users/julius/.nvm/versions/node/v21.7.1/lib/node_modules/@shopify/cli/bin/cloudflared tunnel --url http://localhost:63591 --no-autoupdate
  ยท Working directory: /Users/julius/emapis/size-guide-app

2024-06-01T09:00:38.391Z: Reading cached app information for directory /Users/julius/appname ...
2024-06-01T09:00:38.392Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.394Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.397Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.397Z: Reading the content of file at shopify.app.toml...
2024-06-01T09:00:38.410Z: Reading cached app information for directory /Users/julius/appname ...
2024-06-01T09:00:38.411Z: Reading cached app information for directory /Users/julius/appname ...
2024-06-01T09:00:38.412Z: Reading cached app information for directory /Users/julius/appnam...
2024-06-01T09:00:38.412Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.412Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.413Z: Reading the content of file at shopify.app.toml...
2024-06-01T09:00:38.413Z: Reading the content of file at shopify.app.valma.toml...
2024-06-01T09:00:38.424Z: Ensuring that the user is authenticated with the Partners API with the following scopes:
[]

2024-06-01T09:00:38.425Z: Getting session store...
2024-06-01T09:00:38.425Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly",
  "https://api.shopify.com/auth/organization.apps.manage"
]
For applications:
{
  "partnersApi": {
    "scopes": []
  }
}

2024-06-01T09:00:38.425Z: Initiating the full authentication flow...
2024-06-01T09:00:38.425Z: Authorizing through Identity's website...

To run this command, log in to Shopify.
๐Ÿ‘‰ Press any key to open the login page on your browser
2024-06-01T09:00:38.431Z: 2024-06-01T09:00:38Z 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-01T09:00:38Z INF Requesting new quick Tunnel on trycloudflare.com...

2024-06-01T09:00:40.416Z: 2024-06-01T09:00:40Z INF +--------------------------------------------------------------------------------------------+
2024-06-01T09:00:40Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
2024-06-01T09:00:40Z INF |  https://same-shaved-walks-symphony.trycloudflare.com                                      |
2024-06-01T09:00:40Z INF +--------------------------------------------------------------------------------------------+

2024-06-01T09:00:40.416Z: 2024-06-01T09:00:40Z 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-01T09:00:40Z INF Version 2024.2.1
2024-06-01T09:00:40Z INF GOOS: darwin, GOVersion: go1.21.5-devel-cf, GoArch: amd64

2024-06-01T09:00:40.417Z: 2024-06-01T09:00:40Z INF Settings: map[ha-connections:1 no-autoupdate:true protocol:quic url:http://localhost:63591]

2024-06-01T09:00:40.421Z: 2024-06-01T09:00:40Z INF Generated Connector ID: 5f27cd81-b7ab-4ea4-8a36-d42e5239bc73

2024-06-01T09:00:40.457Z: 2024-06-01T09:00:40Z INF Initial protocol quic

2024-06-01T09:00:40.457Z: 2024-06-01T09:00:40Z INF ICMP proxy will use 192.168.1.136 as source for IPv4

2024-06-01T09:00:40.458Z: 2024-06-01T09:00:40Z INF ICMP proxy will use ::1 in zone lo0 as source for IPv6

2024-06-01T09:00:40.458Z: 2024-06-01T09:00:40Z INF Created ICMP proxy listening on 192.168.1.136:0

2024-06-01T09:00:40.458Z: 2024-06-01T09:00:40Z INF Created ICMP proxy listening on [::1]:0

2024-06-01T09:00:40.492Z: 2024-06-01T09:00:40Z INF Starting metrics server on 127.0.0.1:63594/metrics

2024-06-01T09:00:40.599Z: 2024-06-01T09:00:40Z WRN Your version 2024.2.1 is outdated. We recommend upgrading it to 2024.5.0

2024-06-01T09:00:41.161Z: 2024-06-01T09:00:41Z INF Registered tunnel connection connIndex=0 connection=0ebf34cd-f11b-4982-86e2-66fb18081142 event=0 ip=198.41.192.167 location=vno01 protocol=quic

2024-06-01T09:00:42.939Z: Reading the content of file at ../../.nvm/versions/node/v21.7.1/lib/node_modules/@shopify/cli/dist/assets/auth-error.html...
2024-06-01T09:00:42.950Z: Reading the content of file at ../../.nvm/versions/node/v21.7.1/lib/node_modules/@shopify/cli/dist/assets/style.css...
โ•ญโ”€ error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                                                                                                                                 โ”‚
โ”‚  The requested scope is invalid, unknown, or malformed.                                                                                                                         โ”‚
โ”‚                                                                                                                                                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

2024-06-01T09:00:43.466Z: Obtaining the dependency manager in directory /Users/julius/appnam...
2024-06-01T09:00:43.468Z: 
Running system process:
  ยท Command: ruby -v
  ยท Working directory: /Users/julius/appname

2024-06-01T09:00:43.845Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 261 ms
With response headers:
 - x-request-id: 33bc33cd-2320-47b5-83fa-33475a1dd5cc

2024-06-01T09:00:43.846Z: Analytics event sent: {
  "command": "app dev",
  "time_start": 1717232438326,
  "time_end": 1717232443464,
  "total_time": 5138,
  "success": false,
  "cli_version": "3.61.0",
  "ruby_version": "3.3.0",
  "node_version": "21.7.1",
  "is_employee": false,
  "uname": "darwin arm64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/cli\"]",
  "env_shell": "zsh",
  "env_device_id": "5e7b24a4e7155824f2d99c3d52cd70821742f793",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "env_is_global": true,
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_app_all_configs_any": true,
  "cmd_app_all_configs_clients": "{\"shopify.app.toml\":\"68778b5dca0e10689102605ca55cfa22\",\"shopify.app.valma.toml\":\"ef808242a6fbece337f055119aedf17c\"}",
  "cmd_app_linked_config_used": true,
  "cmd_app_linked_config_name": "shopify.app.valma.toml",
  "cmd_app_linked_config_git_tracked": false,
  "cmd_app_linked_config_source": "cached",
  "cmd_app_linked_config_uses_cli_managed_urls": true,
  "cmd_all_timing_network_ms": 0,
  "cmd_all_timing_prompts_ms": 5005,
  "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": "fe2e559b8bf0f17a09ba365d9d3c3ce3d62dd2ae",
  "cmd_app_dependency_installation_skipped": false,
  "cmd_app_reset_used": false,
  "cmd_all_timing_active_ms": 132,
  "cmd_all_exit": "expected_error",
  "args": "--verbose",
  "error_message": "The requested scope is invalid, unknown, or malformed.",
  "env_plugin_installed_all": "[\"@shopify/cli\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2024-06-01T09:00:43.848Z: Reporting handled error to Bugsnag: The requested scope is invalid, unknown, or malformed.
2024-06-01T09:00:43.861Z: Obtaining the dependency manager in directory /Users/julius/emapis/size-guide-app...

Reproduction steps

  1. Just try to login and it does not work

Operating System

Mac OS 14.5 (23F79)

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

3.61.0

Shell

zsh

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

v21.7.1

What language and version are you using in your application?

ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]

debe7408 commented 4 months ago

Hey @valma-julius, I've deployed a new application to test your case out and could replicate the issue. The issue occurs for me with the Shopify CLI v3.61.0.

Issue: Seems like the issue is with the latest version of Shopify CLI. Fix: Downgrade to version 3.59 CLI.

valma-julius commented 4 months ago

I can confirm that it started worked when I rolled back to 3.59. It seems that the bug is in version 3,61 after all

kyrylo-soulandwolf commented 4 months ago

The latest version pre 3.61.0 (which is 3.60.1) works fine

gonzaloriestra commented 4 months ago

It was an issue server-side. It should work now no matter the version, sorry for the inconvenience! We'll try to ensure it doesn't happen again.

waleed-softaims commented 4 months ago

@gonzaloriestra, I am still having the issue that scope are missing when installing app.

gonzaloriestra commented 4 months ago

@waleed-softaims that looks like a different issue (not with login). Could you please open a new one with as much details as you can? Thanks!