cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: shopify app deploy failing with 504 error

Open rajmasha opened this issue 1 year ago • 1 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

The shopify app deploy command should successfully deploy all extensions.

Actual behavior

The shopify app deploy command kept showing the rainbow loader for a while and then failed with an error

The Partners GraphQL API responded unsuccessfully with the HTTP status 504
  and errors:

{}

Request ID: ef2ce473-6415-4ba4-b566-a9050da6934c-1723534744

Note: We have a lot of extensions around 27. If I reduce the extensions to 13 then it deploys successfully but if it is more than 13 then it fails with the above error.

Verbose output

2024-08-13T07:40:04.477Z: Request to https://partners.shopify.com/api/cli/graphql completed in 60690 ms
With response headers:
 - content-type: text/html
 - x-request-id: ef2ce473-6415-4ba4-b566-a9050da6934c-1723534744


╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│                                                                              │
│  The Partners GraphQL API responded unsuccessfully with the HTTP status 504  │
│   and errors:                                                                │
│                                                                              │
│  {}                                                                          │
│                                                                              │
│  Request ID: ef2ce473-6415-4ba4-b566-a9050da6934c-1723534744                 │
│                                                                              │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

2024-08-13T07:40:04.533Z:
Running system process:
  · Command: npm prefix
  · Working directory: /Users/raj/Developer/reconvert/apps/reconvert-shopify-extensions

2024-08-13T07:40:04.799Z: Obtaining the dependency manager in directory /Users/raj/Developer/reconvert/apps/reconvert-shopify-extensions...
2024-08-13T07:40:04.833Z:
Running system process:
  · Command: ruby -v
  · Working directory: /Users/raj/Developer/reconvert/apps/reconvert-shopify-extensions

2024-08-13T07:40:05.205Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 348 ms
With response headers:
 - x-request-id: 4038e15b-26be-48fd-bb69-3b4f2f74a5a6

2024-08-13T07:40:05.206Z: Analytics event sent: {
  "command": "app deploy",
  "time_start": 1723534720971,
  "time_end": 1723534804522,
  "total_time": 83551,
  "success": false,
  "cli_version": "3.65.3",
  "ruby_version": "3.3.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\"]",
  "env_shell": "zsh",
  "env_device_id": "75521f6c61588af11f7b8e5d5d04b2d603391b97",
  "env_cloud": "localhost",
  "env_package_manager": "yarn",
  "env_is_global": false,
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_deploy_flag_message_used": false,
  "cmd_deploy_flag_version_used": false,
  "cmd_deploy_flag_source_url_used": false,
  "cmd_app_all_configs_any": true,
  "cmd_app_all_configs_clients": "{\"shopify.app.reconvert-dev.toml\":\"935fdf8ec0ba2c8e27ec2d32198a4a20\",\"shopify.app.toml\":\"2ce3e2878bc2779def0181272d5e1e3f\"}",
  "cmd_app_linked_config_used": true,
  "cmd_app_linked_config_name": "shopify.app.reconvert-dev.toml",
  "cmd_app_linked_config_git_tracked": true,
  "cmd_app_linked_config_source": "flag",
  "app_extensions_any": true,
  "app_extensions_breakdown": "{\"function\":1,\"ui_extension\":28,\"product_discounts\":1,\"checkout_post_purchase\":1,\"theme\":1,\"web_pixel_extension\":1}",
  "app_extensions_count": 33,
  "app_extensions_custom_layout": false,
  "app_extensions_function_any": true,
  "app_extensions_function_count": 2,
  "app_extensions_theme_any": true,
  "app_extensions_theme_count": 1,
  "app_extensions_ui_any": true,
  "app_extensions_ui_count": 30,
  "app_name_hash": "9f10f924ba1616202804bd1b3ebf47fb50fc6ed4",
  "app_path_hash": "5c5e26ac71f09f4593e769366ee79c2e7755a28f",
  "app_scopes": "[\"write_cart_transforms\"]",
  "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": true,
  "partner_id": 941756,
  "api_key": "****",
  "cmd_deploy_include_config_used": true,
  "cmd_deploy_config_modules_breakdown": "[\"access_scopes\",\"application_url\",\"auth\",\"embedded\",\"handle\",\"name\",\"pos\",\"webhooks\"]",
  "cmd_deploy_confirm_new_registrations": 0,
  "cmd_deploy_confirm_updated_registrations": 33,
  "cmd_deploy_confirm_removed_registrations": 0,
  "cmd_deploy_confirm_cancelled": false,
  "cmd_deploy_confirm_time_to_complete_ms": 3722,
  "cmd_all_timing_network_ms": 76873,
  "cmd_all_timing_prompts_ms": 3721,
  "cmd_all_launcher": "npm",
  "cmd_all_topic": "app",
  "cmd_all_plugin": "@shopify/app",
  "cmd_all_force": false,
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "5c5e26ac71f09f4593e769366ee79c2e7755a28f",
  "cmd_app_reset_used": false,
  "cmd_all_timing_active_ms": 2955,
  "cmd_all_exit": "expected_error",
  "args": "--verbose",
  "error_message": "\nThe Partners GraphQL API responded unsuccessfully with the HTTP status 504 and errors:\n\n\u001b[33m{}\u001b[0m\n      \nRequest ID: ef2ce473-6415-4ba4-b566-a9050da6934c-1723534744\n",
  "app_name": "reconvert-shopify-extensions",
  "env_plugin_installed_all": "[\"@shopify/cli\"]",
  "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2024-08-13T07:40:08.360Z: Reporting handled error to Bugsnag:
The Partners GraphQL API responded unsuccessfully with the HTTP status 504 and errors:

{}

Request ID: ef2ce473-6415-4ba4-b566-a9050da6934c-1723534744

2024-08-13T07:40:08.441Z:
Running system process:
  · Command: npm prefix
  · Working directory: /Users/raj/Developer/reconvert/apps/reconvert-shopify-extensions

2024-08-13T07:40:08.678Z: Obtaining the dependency manager in directory /Users/raj/Developer/reconvert/apps/reconvert-shopify-extensions...

Reproduction steps

npm run deploy

Operating System

Mac OS Sonoma 14.4.1

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

3.65.3

Shell

iTerm2

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

v20.12.2

What language and version are you using in your application?

Ruby 3.3.0

rajmasha avatar Aug 13 '24 07:08 rajmasha

Thanks for the report! We are investigating.

amcaplan avatar Aug 14 '24 13:08 amcaplan

@amcaplan, do you have any updates? This is starting to become harmful to business since we're unable to update extensions or even fix bugs. According to the log, this issue is a 60-second GraphQL timeout, not a CLI bug. Can you increase the timeout, at least as a temporary workaround?

exp131 avatar Aug 18 '24 18:08 exp131

Or is there a way to deploy extensions in small bunches? Without deleting all not listed extensions.

exp131 avatar Aug 18 '24 18:08 exp131

Hey @exp131, we are making progress, but there are some thorny issues under the surface to be solved, and it's unlikely to be fixed in a matter of hours.

The deployment process revolves around deploying a version as a single unit, so there is not a possibility to deploy extensions in batches, nor would I expect that to be put into place at any time.

amcaplan avatar Aug 19 '24 14:08 amcaplan

We've shipped the necessary back-end changes to allow large apps like this one to deploy successfully without timing out. It should be possible to deploy this app now.

gordonhirsch avatar Aug 22 '24 18:08 gordonhirsch