cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: Can't create a new extension after migrating to Dev Dashboard and upgrading version

Open seka19 opened this issue 3 months ago • 6 comments

Please confirm that you have:

  • [x] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • [x] Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Extension

Expected behavior

Command shopify app generate extension generates a new extention.

Actual behavior

Getting this error:

╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                        │
│  GraphQL Error (Code: 401): {"response":{"error":"","status":401,"headers":{}},"request":{"query":"\n    query OrganizationBetaFlags($organizationId:  │
│   OrganizationID!) {\n      organization(organizationId: $organizationId) {\n        id\n        flag_enable_cli_customer_segment_template_extension:  │
│   hasFeatureFlag(handle: \"enable_cli_customer_segment_template_extension\")\n        flag_order_routing_extensibility_partner:                        │
│  hasFeatureFlag(handle: \"order_routing_extensibility_partner\")\n        flag_payments_extensions_card_present: hasFeatureFlag(handle:                │
│  \"payments_extensions_card_present\")\n        flag_payments_extensions_credit_card: hasFeatureFlag(handle: \"payments_extensions_credit_card\")\n    │
│        flag_payments_extensions_custom_credit_card: hasFeatureFlag(handle: \"payments_extensions_custom_credit_card\")\n                               │
│  flag_payments_extensions_custom_onsite: hasFeatureFlag(handle: \"payments_extensions_custom_onsite\")\n        flag_payments_extensions_offsite:      │
│  hasFeatureFlag(handle: \"payments_extensions_offsite\")\n        flag_payments_extensions_redeemable: hasFeatureFlag(handle:                          │
│  \"payments_extensions_redeemable\")\n      }\n    }","variables":{"organizationId":"Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE="}}}      │
│                                                                                                                                                        │
│  To investigate the issue, examine this stack trace:                                                                                                   │
│    at makeRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28042)                                                                 │
│    at processTicksAndRejections (node:internal/process/task_queues:105)                                                                                │
│    at rawGraphQLRequest [as request] (var/www/app/node_modules/@shopify/cli/dist/chunk-ZAVXS5HH.js:3901)                                               │
│    at async runRequestWithNetworkLevelRetry (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28102)                                       │
│    at async makeVerboseRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28113)                                                    │
│    at async retryAwareRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28200)                                                     │
│    at (var/www/app/node_modules/@shopify/cli/dist/chunk-ZAVXS5HH.js:3923)                                                                              │
│    at (var/www/app/node_modules/@shopify/cli/dist/chunk-B36FYNEM.js:30364)                                                                             │
│    at organizationBetaFlags (var/www/app/node_modules/@shopify/cli/dist/index.js:217756)                                                               │
│    at async allowedTemplates (var/www/app/node_modules/@shopify/cli/dist/index.js:217882)                                                              │
│                                                                                                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Looks like it can't authorize an organization ID (base64 encoded) which is equal to the number in the URL of the new Dev Dashboard (https://dev.shopify.com/dashboard/129010041/apps).

Verbose output

Verbose output
> shopify
> env-cmd shopify app generate extension --verbose

2025-09-26T08:49:32.081Z: Running command app generate extension
2025-09-26T08:49:32.085Z: Running system process in background:
· Command: /usr/bin/node /var/www/app/node_modules/.bin/shopify notifications list --ignore-errors
· Working directory: /var/www/app

2025-09-26T08:49:32.093Z: Notifications to show: 0
2025-09-26T08:49:32.108Z: Reading cached app information for directory /var/www/app...
2025-09-26T08:49:32.109Z: Reading the content of file at shopify.app.toml...
2025-09-26T08:49:32.113Z: Reading the content of file at shopify.app.toml...
2025-09-26T08:49:32.115Z: Ensuring that the user is authenticated with the App Management API with the following scopes:
[]

2025-09-26T08:49:32.116Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=****
With request headers:


2025-09-26T08:49:32.386Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=**** completed in 270 ms
With response headers:
- cache-control: no-cache, no-store, private, must-revalidate, max-age=0
- content-type: application/json; charset=utf-8
- etag: W/"e73b9658b868841cc42f9b410edf9960"
- server-timing: processing;dur=28, socket_queue;dur=1.416, edge;dur=1.029, util;dur=0.05, cfRequestDuration;dur=175.999880
- x-request-id: 5a358eb4-af73-4e62-a32a-d17f08a485d5-1758876572
  
2025-09-26T08:49:32.389Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=****
With request headers:


2025-09-26T08:49:32.631Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=**** completed in 242 ms
With response headers:
- cache-control: no-cache, no-store, private, must-revalidate, max-age=0
- content-type: application/json; charset=utf-8
- etag: W/"908957846f3c1c78e302a8127fd129a1"
- server-timing: processing;dur=43, socket_queue;dur=1.763, edge;dur=1.043, util;dur=0.05, cfRequestDuration;dur=182.999849
- x-request-id: dcf2bbd4-b93d-4529-b9a0-0668ed9dc37a-1758876572
  
2025-09-26T08:49:32.634Z: Sending "BusinessPlatform" GraphQL request:
query UserInfo {
currentUserAccount {
  uuid
  email
  organizations(first: 2) {
    nodes {
      name
      __typename
    }
    __typename
  }
  __typename
}
}

With request headers:
- User-Agent: Shopify CLI; v=3.85.0
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: linux
- Content-Type: application/json

to https://destinations.shopifysvc.com/destinations/api/2020-07/graphql
2025-09-26T08:49:32.643Z: Sending "App Management" GraphQL request:
query ActiveAppReleaseFromApiKey($apiKey: String!) {
app: appByKey(key: $apiKey) {
  ...AppVersionInfo
  __typename
}
}

fragment ReleasedAppModule on AppModule {
uuid
userIdentifier
handle
config
target
specification {
  identifier
  externalIdentifier
  name
  managementExperience
}
}

fragment AppVersionInfo on App {
id
key
organizationId
activeRoot {
  clientCredentials {
    secrets {
      key
    }
  }
  grantedShopifyApprovalScopes
}
activeRelease {
  id
  version {
    name
    appModules {
      ...ReleasedAppModule
    }
  }
}
}

With variables:
{
"apiKey": "*****"
}

With request headers:
- User-Agent: Shopify CLI; v=3.85.0
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: linux
- Content-Type: application/json

to https://app.shopify.com/app_management/unstable/graphql.json
2025-09-26T08:49:33.179Z: Request to https://app.shopify.com/app_management/unstable/graphql.json completed in 535 ms
With response headers:
- content-type: application/json; charset=utf-8
- server-timing: processing;dur=240, verdict_flag_enabled;desc="count=3";dur=0.458, _y;desc="23a458be-0732-4816-8d7d-23b7b14e818e", _s;desc="1dd6bae8-0813-49a8-b461-c084463a7542", cfRequestDuration;dur=440.999985
- x-request-id: df09a8fd-f07a-4a38-8c25-decc709d5729-1758876572
  
2025-09-26T08:49:33.181Z: Sending "BusinessPlatform" GraphQL request:
query FindOrganizations($organizationId: OrganizationID!) {
currentUserAccount {
  organization(id: $organizationId) {
    id
    name
    __typename
  }
  __typename
}
}

With variables:
{
"organizationId": "Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE="
}

With request headers:
- User-Agent: Shopify CLI; v=3.85.0
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: linux
- Content-Type: application/json

to https://destinations.shopifysvc.com/destinations/api/2020-07/graphql
2025-09-26T08:49:33.187Z: Sending "App Management" GraphQL request:
query fetchSpecifications($organizationId: ID!) {
specifications(organizationId: $organizationId) {
  name
  identifier
  externalIdentifier
  features
  uidStrategy {
    appModuleLimit
    isClientProvided
    __typename
  }
  validationSchema {
    jsonSchema
    __typename
  }
  __typename
}
}

With variables:
{
"organizationId": "gid://shopify/Organization/129010041"
}

With request headers:
- User-Agent: Shopify CLI; v=3.85.0
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: linux
- Content-Type: application/json

to https://app.shopify.com/app_management/unstable/graphql.json
2025-09-26T08:49:33.825Z: Request to https://app.shopify.com/app_management/unstable/graphql.json completed in 637 ms
With response headers:
- content-type: application/json; charset=utf-8
- server-timing: processing;dur=404, verdict_flag_enabled;desc="count=4";dur=0.816, _y;desc="3d9ca186-e4a7-45f9-ba17-a6334d009daa", _s;desc="d8ab2d1c-13a6-4e82-8387-51ada947eaa9", cfRequestDuration;dur=575.999975
- x-request-id: 9786c042-aaa1-4417-a3b7-a8f80c97ea19-1758876573
  
2025-09-26T08:49:33.836Z: The following extension specifications were defined locally but not found in the remote specifications: channel_config, tax_calculation
2025-09-26T08:49:33.837Z: The following extension specifications were found in the remote specifications but not defined locally: admin_app, app_link, app_nav_item, bulk_action, checkout_script_tag, flow_action_definition, flow_trigger_definition, flow_trigger_discovery_webhook, manage_marketplaces, marketing_action, marketing_activity_extension, merchandising_create_publication, merchandising_fulfillment_variant_details, ping_message_callback, pos_link, product_configuration_link, resource_publication_settings, retail_cart_promotion, retail_product_recommendation, subscription_link
2025-09-26T08:49:33.843Z: Reading the content of file at shopify.app.example.toml...
2025-09-26T08:49:33.844Z: Reading the content of file at shopify.app.prod.toml...
2025-09-26T08:49:33.844Z: Reading the content of file at shopify.app.test.toml...
2025-09-26T08:49:33.846Z: Reading the content of file at .gitignore...
2025-09-26T08:49:33.849Z: Reading the .env file at .env
2025-09-26T08:49:33.849Z: Reading the content of file at .env...
2025-09-26T08:49:34.086Z: Reading the content of file at extensions/ext-customer-account/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/ext-product-discount/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/ext-order-discount/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/ext-shipping-discount/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/ext-theme-widget/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/flow-callback/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/flow-trgr-points-deduct/shopify.extension.toml...
2025-09-26T08:49:34.087Z: Reading the content of file at extensions/flow-trgr-points-deduct-order/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-adjust/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-earn/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-expr-apprch/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-earn-order/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-redeem/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-points-redeem-order/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/flow-trgr-vip-tier-achieve/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/pos/shopify.extension.toml...
2025-09-26T08:49:34.088Z: Reading the content of file at extensions/test/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/ext-customer-account/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/ext-order-discount/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/ext-product-discount/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/ext-shipping-discount/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-deduct-order/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-deduct/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-callback/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-earn/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-adjust/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-earn-order/shopify.extension.toml...
2025-09-26T08:49:34.094Z: Reading the content of file at extensions/flow-trgr-points-expr-apprch/shopify.extension.toml...
2025-09-26T08:49:34.095Z: Reading the content of file at extensions/flow-trgr-points-redeem/shopify.extension.toml...
2025-09-26T08:49:34.095Z: Reading the content of file at extensions/flow-trgr-points-redeem-order/shopify.extension.toml...
2025-09-26T08:49:34.095Z: Reading the content of file at extensions/flow-trgr-vip-tier-achieve/shopify.extension.toml...
2025-09-26T08:49:34.096Z: Reading the content of file at extensions/test/shopify.extension.toml...
2025-09-26T08:49:34.096Z: Reading the content of file at extensions/pos/shopify.extension.toml...
2025-09-26T08:49:34.120Z: Reading the content of file at package.json...
2025-09-26T08:49:34.121Z: Reading the content of file at package.json...
2025-09-26T08:49:34.126Z: Running system process:
· Command: npm prefix
· Working directory: /var/www/app

2025-09-26T08:49:34.211Z: Obtaining the dependency manager in directory /var/www/app...
2025-09-26T08:49:34.212Z: Reading the content of file at package.json...
2025-09-26T08:49:34.213Z: Reading the content of file at .shopify/project.json...
2025-09-26T08:49:34.435Z: Notifications to show: 0
2025-09-26T08:49:34.436Z: Unable to decide project type as no web backend
2025-09-26T08:49:34.437Z: Reading cached app information for directory /var/www/app...
2025-09-26T08:49:34.437Z: Storing app information for directory /var/www/app:{
"appId": "3919d02baadab33926dc0532cd894e46",
"title": "Loyalty (local)",
"directory": "/var/www/app",
"orgId": "129010041"
}
2025-09-26T08:49:34.508Z: Request to https://cdn.shopify.com/static/cli/extensions/templates.json completed in 66 ms
With response headers:
- cache-control: public, max-age=86400
- content-type: application/json
- server-timing: imagery;dur=101.172, imageryFetch;dur=95.815, cfRequestDuration;dur=11.999846
- x-request-id: 38de2537-b5ef-4c69-8202-9bfe3b435be5-1758766040
  
2025-09-26T08:49:34.511Z: Sending "BusinessPlatform" GraphQL request:
query OrganizationBetaFlags($organizationId: OrganizationID!) {
    organization(organizationId: $organizationId) {
      id
      flag_enable_cli_customer_segment_template_extension: hasFeatureFlag(handle: "enable_cli_customer_segment_template_extension")
      flag_order_routing_extensibility_partner: hasFeatureFlag(handle: "order_routing_extensibility_partner")
      flag_payments_extensions_card_present: hasFeatureFlag(handle: "payments_extensions_card_present")
      flag_payments_extensions_credit_card: hasFeatureFlag(handle: "payments_extensions_credit_card")
      flag_payments_extensions_custom_credit_card: hasFeatureFlag(handle: "payments_extensions_custom_credit_card")
      flag_payments_extensions_custom_onsite: hasFeatureFlag(handle: "payments_extensions_custom_onsite")
      flag_payments_extensions_offsite: hasFeatureFlag(handle: "payments_extensions_offsite")
      flag_payments_extensions_redeemable: hasFeatureFlag(handle: "payments_extensions_redeemable")
    }
  }

With variables:
{
"organizationId": "Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE="
}

With request headers:
- User-Agent: Shopify CLI; v=3.85.0
- Keep-Alive: timeout=30
- Sec-CH-UA-PLATFORM: linux
- Content-Type: application/json

to https://destinations.shopifysvc.com/organizations/api/unstable/organization/129010041/graphql
2025-09-26T08:49:34.766Z: Request to https://destinations.shopifysvc.com/organizations/api/unstable/organization/129010041/graphql completed in 255 ms
With response headers:
- cache-control: no-cache
- content-type: text/html
- server-timing: processing;dur=32, socket_queue;dur=2.115, util;dur=0.04, cfRequestDuration;dur=182.999849
- x-request-id: 8a608b8f-6c8c-488c-83a8-dfa27d426e08-1758876574
  
2025-09-26T08:49:34.766Z: Ensuring that the user is authenticated with the App Management API with the following scopes:
[]

2025-09-26T08:49:34.766Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=****
With request headers:


2025-09-26T08:49:35.006Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=**** completed in 240 ms
With response headers:
- cache-control: no-cache, no-store, private, must-revalidate, max-age=0
- content-type: application/json; charset=utf-8
- etag: W/"f20e309002f6ae72e37a92d609b674dc"
- server-timing: processing;dur=28, socket_queue;dur=0.956, edge;dur=1.447, util;dur=0.1, cfRequestDuration;dur=190.999985
- x-request-id: dbfce9f5-b7de-430c-8269-248a8cdf5e6c-1758876574
  
2025-09-26T08:49:35.007Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=****
With request headers:


2025-09-26T08:49:35.220Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=**** completed in 212 ms
With response headers:
- cache-control: no-cache, no-store, private, must-revalidate, max-age=0
- content-type: application/json; charset=utf-8
- etag: W/"cf68d1ef619c74fcbe7867ab6543c74d"
- server-timing: processing;dur=26, socket_queue;dur=0.989, edge;dur=1.032, util;dur=0.1, cfRequestDuration;dur=156.999826
- x-request-id: 9288fbd0-f581-45a8-a00a-50bf604d70a9-1758876575
  
2025-09-26T08:49:35.450Z: Request to https://destinations.shopifysvc.com/organizations/api/unstable/organization/129010041/graphql completed in 229 ms
With response headers:
- cache-control: no-cache
- content-type: text/html
- server-timing: processing;dur=36, socket_queue;dur=2.168, util;dur=0.0, cfRequestDuration;dur=166.999817
- x-request-id: 83b2df60-8d49-4c30-86c4-6dba6c8c776b-1758876575
  
╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                        │
│  GraphQL Error (Code: 401): {"response":{"error":"","status":401,"headers":{}},"request":{"query":"\n    query OrganizationBetaFlags($organizationId:  │
│   OrganizationID!) {\n      organization(organizationId: $organizationId) {\n        id\n        flag_enable_cli_customer_segment_template_extension:  │
│   hasFeatureFlag(handle: \"enable_cli_customer_segment_template_extension\")\n        flag_order_routing_extensibility_partner:                        │
│  hasFeatureFlag(handle: \"order_routing_extensibility_partner\")\n        flag_payments_extensions_card_present: hasFeatureFlag(handle:                │
│  \"payments_extensions_card_present\")\n        flag_payments_extensions_credit_card: hasFeatureFlag(handle: \"payments_extensions_credit_card\")\n    │
│        flag_payments_extensions_custom_credit_card: hasFeatureFlag(handle: \"payments_extensions_custom_credit_card\")\n                               │
│  flag_payments_extensions_custom_onsite: hasFeatureFlag(handle: \"payments_extensions_custom_onsite\")\n        flag_payments_extensions_offsite:      │
│  hasFeatureFlag(handle: \"payments_extensions_offsite\")\n        flag_payments_extensions_redeemable: hasFeatureFlag(handle:                          │
│  \"payments_extensions_redeemable\")\n      }\n    }","variables":{"organizationId":"Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE="}}}      │
│                                                                                                                                                        │
│  To investigate the issue, examine this stack trace:                                                                                                   │
│    at makeRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28042)                                                                 │
│    at processTicksAndRejections (node:internal/process/task_queues:105)                                                                                │
│    at rawGraphQLRequest [as request] (var/www/app/node_modules/@shopify/cli/dist/chunk-ZAVXS5HH.js:3901)                                               │
│    at async runRequestWithNetworkLevelRetry (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28102)                                       │
│    at async makeVerboseRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28113)                                                    │
│    at async retryAwareRequest (var/www/app/node_modules/@shopify/cli/dist/chunk-PUO72IWW.js:28200)                                                     │
│    at (var/www/app/node_modules/@shopify/cli/dist/chunk-ZAVXS5HH.js:3923)                                                                              │
│    at (var/www/app/node_modules/@shopify/cli/dist/chunk-B36FYNEM.js:30364)                                                                             │
│    at organizationBetaFlags (var/www/app/node_modules/@shopify/cli/dist/index.js:217756)                                                               │
│    at async allowedTemplates (var/www/app/node_modules/@shopify/cli/dist/index.js:217882)                                                              │
│                                                                                                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2025-09-26T08:49:35.493Z: Running system process:
· Command: npm prefix
· Working directory: /var/www/app

2025-09-26T08:49:35.587Z: Obtaining the dependency manager in directory /var/www/app...
2025-09-26T08:49:35.852Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 178 ms
With response headers:
- x-request-id: 18b78a21-1c0d-422f-9f3b-06328127fc35
  
2025-09-26T08:49:35.853Z: Analytics event sent: {
"command": "app scaffold extension",
"time_start": 1758876572082,
"time_end": 1758876575486,
"total_time": 3404,
"success": false,
"cli_version": "3.85.0",
"ruby_version": "",
"node_version": "22.18.0",
"is_employee": false,
"uname": "linux amd64",
"env_ci": false,
"env_plugin_installed_any_custom": false,
"env_plugin_installed_shopify": "[\"@shopify/cli\"]",
"env_shell": "bash",
"env_device_id": "2e6f644ee26a38010bed992ee062d3f16c1ead5a",
"env_cloud": "localhost",
"env_package_manager": "npm",
"env_is_global": false,
"env_auth_method": "partners_token",
"env_is_wsl": false,
"env_build_repository": "Shopify/cli",
"cmd_app_warning_api_key_deprecation_displayed": false,
"cmd_scaffold_required_auth": true,
"cmd_scaffold_template_custom": false,
"cmd_scaffold_type_owner": "@shopify/app",
"cmd_app_all_configs_any": true,
"cmd_app_all_configs_clients": "{\"shopify.app.example.toml\":\"3919d02baadab33926dc0532cd894e46\",\"shopify.app.prod.toml\":\"232375a372c1c471b0fe8999d9cbd3ae\",\"shopify.app.test.toml\":\"6e24b65df1521f862302339b91570d79\",\"shopify.app.toml\":\"3919d02baadab33926dc0532cd894e46\"}",
"cmd_app_linked_config_used": true,
"cmd_app_linked_config_name": "shopify.app.toml",
"cmd_app_linked_config_git_tracked": true,
"cmd_app_linked_config_source": "cached",
"app_extensions_any": true,
"app_extensions_breakdown": "{\"ui_extension\":2,\"function\":4,\"theme\":1,\"flow_trigger_lifecycle_callback\":1,\"flow_trigger\":9}",
"app_extensions_count": 17,
"app_extensions_custom_layout": false,
"app_extensions_function_any": true,
"app_extensions_function_count": 4,
"app_extensions_theme_any": true,
"app_extensions_theme_count": 1,
"app_extensions_ui_any": true,
"app_extensions_ui_count": 2,
"app_name_hash": "7d1043473d55bfa90e8530d35801d4e381bc69f0",
"app_path_hash": "e6e0ae7e79ca68e366ced0589ee0b41b1c0a13ff",
"app_scopes": "[]",
"app_web_backend_any": false,
"app_web_backend_count": 0,
"app_web_custom_layout": false,
"app_web_frontend_any": false,
"app_web_frontend_count": 0,
"env_package_manager_workspaces": false,
"business_platform_id": 129010041,
"api_key": "****",
"cmd_app_reset_used": false,
"cmd_all_timing_network_ms": 2690,
"cmd_all_timing_prompts_ms": 0,
"cmd_all_launcher": "npm",
"cmd_all_topic": "app generate",
"cmd_all_plugin": "@shopify/app",
"cmd_all_verbose": true,
"cmd_all_path_override": true,
"cmd_all_path_override_hash": "e6e0ae7e79ca68e366ced0589ee0b41b1c0a13ff",
"cmd_all_last_graphql_request_id": "83b2df60-8d49-4c30-86c4-6dba6c8c776b-1758876575",
"cmd_all_timing_active_ms": 713,
"cmd_all_exit": "unexpected_error",
"user_id": "f7d383b2-425b-3b63-9e4a-6524791b733a2f876d0f",
"request_ids": [
  "df09a8fd-f07a-4a38-8c25-decc709d5729-1758876572",
  "9786c042-aaa1-4417-a3b7-a8f80c97ea19-1758876573",
  "8a608b8f-6c8c-488c-83a8-dfa27d426e08-1758876574",
  "83b2df60-8d49-4c30-86c4-6dba6c8c776b-1758876575"
],
"args": "--verbose",
"error_message": "GraphQL Error (Code: 401): {\"response\":{\"error\":\"\",\"status\":401,\"headers\":{}},\"request\":{\"query\":\"\\n    query OrganizationBetaFlags($organizationId: OrganizationID!) {\\n      organization(organizationId: $organizationId) {\\n        id\\n        flag_enable_cli_customer_segment_template_extension: hasFeatureFlag(handle: \\\"enable_cli_customer_segment_template_extension\\\")\\n        flag_order_routing_extensibility_partner: hasFeatureFlag(handle: \\\"order_routing_extensibility_partner\\\")\\n        flag_payments_extensions_card_present: hasFeatureFlag(handle: \\\"payments_extensions_card_present\\\")\\n        flag_payments_extensions_credit_card: hasFeatureFlag(handle: \\\"payments_extensions_credit_card\\\")\\n        flag_payments_extensions_custom_credit_card: hasFeatureFlag(handle: \\\"payments_extensions_custom_credit_card\\\")\\n        flag_payments_extensions_custom_onsite: hasFeatureFlag(handle: \\\"payments_extensions_custom_onsite\\\")\\n        flag_payments_extensions_offsite: hasFeatureFlag(handle: \\\"payments_extensions_offsite\\\")\\n        flag_payments_extensions_redeemable: hasFeatureFlag(handle: \\\"payments_extensions_redeemable\\\")\\n      }\\n    }\",\"variables\":{\"organizationId\":\"Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE=\"}}}",
"app_name": "app",
"env_plugin_installed_all": "[\"@shopify/cli\"]",
"metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2025-09-26T08:49:35.865Z: Reporting unhandled error to Bugsnag: GraphQL Error (Code: 401): {"response":{"error":"","status":401,"headers":{}},"request":{"query":"\n    query OrganizationBetaFlags($organizationId: OrganizationID!) {\n      organization(organizationId: $organizationId) {\n        id\n        flag_enable_cli_customer_segment_template_extension: hasFeatureFlag(handle: \"enable_cli_customer_segment_template_extension\")\n        flag_order_routing_extensibility_partner: hasFeatureFlag(handle: \"order_routing_extensibility_partner\")\n        flag_payments_extensions_card_present: hasFeatureFlag(handle: \"payments_extensions_card_present\")\n        flag_payments_extensions_credit_card: hasFeatureFlag(handle: \"payments_extensions_credit_card\")\n        flag_payments_extensions_custom_credit_card: hasFeatureFlag(handle: \"payments_extensions_custom_credit_card\")\n        flag_payments_extensions_custom_onsite: hasFeatureFlag(handle: \"payments_extensions_custom_onsite\")\n        flag_payments_extensions_offsite: hasFeatureFlag(handle: \"payments_extensions_offsite\")\n        flag_payments_extensions_redeemable: hasFeatureFlag(handle: \"payments_extensions_redeemable\")\n      }\n    }","variables":{"organizationId":"Z2lkOi8vb3JnYW5pemF0aW9uL09yZ2FuaXphdGlvbi8xMjkwMTAwNDE="}}}
2025-09-26T08:49:36.147Z: Running system process:
· Command: npm prefix
· Working directory: /var/www/app

2025-09-26T08:49:36.235Z: Obtaining the dependency manager in directory /var/www/app...

Reproduction steps

Run npm run shopify app generate extension

Operating System

Debian GNU/Linux 12 (bookworm)

Shopify CLI version (shopify --version)

3.85.0

Shell

bash

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

v22.18.0

What language and version are you using in your application?

PHP 8.3

seka19 avatar Sep 26 '25 09:09 seka19

Hey @seka19, are you running the CLI with a SHOPIFY_CLI_PARTNERS_TOKEN? I'm afraid this type of token is not compatible with the app generate extension command for now. We are looking into this but don't have a timeline on when it will be ready.

isaacroldan avatar Oct 13 '25 15:10 isaacroldan

@isaacroldan yes, I'm using this variable since it's more convenient, especially when everything is running inside a Docker container (the only way, I think). Well, I dug a bit deeper and found a few lines responsible for organizationBetaFlags retrieval; I've commented those lines in my local node_modules/... and everything works now.

In general, it's a pity that using Shopify CLI inside Docker is still such a pain. Docker is really the only way to ensure a consistent environment across all developers and servers, avoiding all those "works on my machine" issues. But with Shopify CLI, despite its good intentions, there are quite a few problems: running app run command seems nearly impossible (maybe it is possible, but there’s no documentation), browser-based authentication (how’s that supposed to work inside a container?), and so on. So yeah… it feels like Shopify CLI really doesn’t like Docker — which is unfortunate. :(

seka19 avatar Oct 13 '25 15:10 seka19

hey @seka19, our browser based authentication is totally compatible with docker, when the CLI asks to open a browser, just copy the URL from the terminal and open it in your machine with browser access.

After completing authentication from that browser, the CLI will automatically pick up the session.

As per app dev (I assume that's what you mean by app run?), same thing, you can just copy the browser link from the terminal, open it in your machine to preview stuff and make any code changes inside your docker container.

We are planning to fix the issue with the TOKEN and the organizationBetaFlags query though!

isaacroldan avatar Oct 13 '25 16:10 isaacroldan

@isaacroldan I just checked shopify auth login:

root@857780069d26:/var/www/app# npm run shopify auth login

> shopify
> env-cmd shopify auth login

To run this command, log in to Shopify.
User verification code: NRSH-DPPM
👉 Press any key to open the login page on your browser
Opened link to start the auth process: https://accounts.shopify.com/activate-with-code?device_code%5Buser_code%5D=NRSH-DPPM
Error: spawn xdg-open ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
root@857780069d26:/var/www/app#

This is what happened when I press any key.

If I copy this URL, run command again, get the code from 2nd run, set it to the end of the URL and open in browser - browser shows "Successfully logged in to Shopify CLI on your device.", but CLI in the terminal still on the "Press any key" step. Any key makes the same error. I tried to expose different ports, googled for a solutions, checked docs many times - I don't know how to make this work, maybe I do smth wrong...

Anyway, since we have a solution via SHOPIFY_CLI_PARTNERS_TOKEN, this is not a big deal.

Thank you.

seka19 avatar Oct 13 '25 17:10 seka19

The CLI is failing to detect that this is a non-browser environment, you can force that with: CODESPACES=1 npm run shopify auth login That will show you the auth link directly, you can then copy paste it in your browser and complete the authentication. Once completed, it takes a few seconds for the CLI to receive it, just need to wait.

isaacroldan avatar Oct 14 '25 07:10 isaacroldan

@isaacroldan WOW, it really works, thank you! I hope one day this will be added to shopify-cli documentation :)

seka19 avatar Oct 14 '25 10:10 seka19

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

github-actions[bot] avatar Nov 26 '25 03:11 github-actions[bot]