Shopify Theme Dev - 502 Error - Failed to perform theme synchronization

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Theme

Expected behavior

Command runs ok?

Actual behavior

502 Error

Failed to perform the initial theme synchronization. │
│ │
│ The Admin GraphQL API responded unsuccessfully with the HTTP status 502 │
│ and errors: │
│ │
│ {}

Reproduction steps

Setup a theme with a lot of files, then run shopify theme dev

Verbose output

-templates/page.brand-gifts-for-her.json: success
2025-10-31T14:08:51.829Z: Request to https://xxx.myshopify.com/admin/api/2025-10/graphql.json completed in 16235 ms
With response headers:

  • content-type: text/html

╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Failed to perform the initial theme synchronization. │
│ │
│ The Admin GraphQL API responded unsuccessfully with the HTTP status 502 and errors: │
│ │
│ {}

Operating system

Windows 11

CLI version

3.86.1

Shell

Git bash, Powershell

Nodejs version

24.6.0

What language and version are you using in your application?

N/A

How many theme files are we talking about here @ceri_waters ? I don’t access to your full verbose logs, but do you think it could be timing out because of the number of liquid or asset files?

Also how often do you hit this 502 error? Every theme dev call i assume?

Hi @AlokSwamy thanks for the response,

Yes very likely timing out due to the number of files, there’s a lot of page templates (just shy of 400) 120 snippets, 120 sections

If I delete the majority of additional templates, then run shopify theme dev and then restore them it works - but as you can imagine is a massive pain to do.

Thanks,
Ceri.

The logs in your original message shows that it completed ~16 seconds. Not sure if there are more important logs above/below that.

The timeout should be a generous 90 seconds. But if you really think it’s a timeout issue, you could pass in this flag when doing theme dev . It would disable retries (which isn’t great for poor network connections), but disable timeouts.

SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY=1 shopify theme dev

I would love it if you shared your full verbose logs (and redact any passwords inside)

@AlokSwamy That was the end of the verbose output, there wasn’t anything after it. It’s working at the moment, but I believe that’s because it’s just referencing the previous development theme so it isn’t uploading all of the resources.

Once the development theme expires and the issue comes back to life I’ll send across the output unless there’s a way of making it ‘forget’ the development theme?

You could delete the development theme:

shopify theme list will reveal it’s theme-id

shopify theme delete -t <theme-id>will delete it

But if it’s currently working, i don’t want to ruin your environment by deleting the theme. But if you still have your old verbose logs, I’d love to have your Request ID so we can investigate where in the pipeline it’s failing.

@AlokSwamy I don’t have my old Verbose Logs sorry (unless they’re saved to a file somewhere?) - incidentally.. I haven’t had the problem since :thinking:

@AlokSwamy Had it happen again today, two examples of logs before it died.

Also the command

SHOPIFY_CLI_SKIP_NETWORK_LEVEL_RETRY=1 shopify theme dev

Doesn’t work for me I’m afraid

@ceri_waters To unblock you, i think you can run shopify theme push -t <development-theme-id>, you can get the id from shopify theme list.

I think push is a little more tolerant with large code bases. Once it’s uploaded to the development theme, you should be able to do the regular shopify theme dev (and since it no longer needs to sync the whole codebase, it shouldn’t timeout).

Can you give that a go and let me know what happens?

@AlokSwamy Mm nope, same issue

Can you send me the Request ID in the verbose logs?

Also noticed that in your image, the files were still being synced when running theme dev, even though you previously pushed them?

Just tried it again, the last x-request-id I had before it died was:

61e8a1ed-f4f6-45aa-a1c6-88d89958304b-1763745801

I don’t follow sorry? In my latest image that was a shopify theme push but it failed in the same manner.

When running shopify theme dev the same issue, it runs for 15 seconds or so and then just dies as per the above with a 502

Just noticed as well.. the response that comes back with a 502 isn’t even in JSON, the content type is text/html and there’s no request id in the header :frowning:

I’m not the only person to run into this issue, there was someone on the Slack Partner Community (before it closed) who was struggling as well.

Hey @ceri_waters, a new version of the CLI was released yesterday (3.88.0). It has some additional logging when theme dev fails with the “Failed to perform the initial theme synchronization”. If you are able to use the latest version and can reproduce the error again, we can take another look at what happened on our end. A screenshot of the failure that shows the store and the lst couple lines (including any request-id) will be more than enough!

@Josh-Shopify Does this help?

2025-12-05T11:12:13.174Z: Analytics event sent: {
  "command": "theme dev",
  "time_start": 1764933084702,
  "time_end": 1764933131657,
  "total_time": 46955,
  "success": false,
  "cli_version": "3.88.0",
  "ruby_version": "",
  "node_version": "24.6.0",
  "is_employee": false,
  "uname": "windows amd64",
  "env_ci": false,
  "env_plugin_installed_any_custom": false,
  "env_plugin_installed_shopify": "[\"@shopify/cli\"]",
  "env_shell": "powershell",
  "env_device_id": "b0ccfa14b014100c7bc9661d4bd762aa18eacdef",
  "env_cloud": "localhost",
  "env_package_manager": "npm",
  "env_is_global": true,
  "env_auth_method": "device_auth",
  "env_is_wsl": false,
  "env_build_repository": "Shopify/cli",
  "cmd_app_warning_api_key_deprecation_displayed": false,
  "cmd_all_timing_network_ms": 69744,
  "cmd_all_timing_prompts_ms": 0,
  "cmd_all_launcher": "unknown",
  "cmd_all_topic": "theme",
  "cmd_all_plugin": "@shopify/theme",
  "cmd_all_force": false,
  "cmd_all_verbose": true,
  "cmd_all_path_override": true,
  "cmd_all_path_override_hash": "64e06f57c6d1c50ea70bb0cb5522e055e1a2d1da",
  "store_fqdn_hash": "2e2d669fcc755c57782649502c48259a190d42b4",
  "cmd_theme_timings": "[{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":8264},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":0},{\"event\":\"theme-api:upload-files\",\"duration\":1},{\"event\":\"theme-api:upload-files\",\"duration\":237},{\"event\":\"theme-api:upload-files\",\"duration\":1153},{\"event\":\"theme-api:upload-files\",\"duration\":391},{\"event\":\"theme-api:upload-files\",\"duration\":642},{\"event\":\"theme-api:upload-files\",\"duration\":484},{\"event\":\"theme-api:upload-files\",\"duration\":478},{\"event\":\"theme-api:upload-files\",\"duration\":1795},{\"event\":\"theme-api:upload-files\",\"duration\":1}]",
  "cmd_theme_errors": "[{\"category\":\"UNKNOWN\",\"message\":\"\\nThe Admin GraphQL API responded unsuccessfully with the HTTP status 502 and errors:\\n\\n\\u001b[33m{}\\u001b[0m\\n      \",\"timestamp\":1764933131640}]",
  "cmd_theme_retries": "[{\"url\":\"https://cw-sellor-test.myshopify.com/admin/api/2025-10/graphql.json\",\"operation\":\"network-retry:request to https://cw-sellor-test.myshopify.com/admin/api/2025-10/graphql.json failed, reason: connect ETIMEDOUT 23.227.38.74:443\",\"attempts\":1,\"timestamp\":1764933105987}]",
  "cmd_theme_events": "[{\"name\":\"theme-command:dev:single-env:authenticated\",\"timestamp\":1764933084747},{\"name\":\"theme-command:dev:single-env:authenticated\",\"timestamp\":1764933084748},{\"name\":\"theme-api:fetch-theme\",\"timestamp\":1764933084750},{\"name\":\"retry:network-retry:request to https://cw-sellor-test.myshopify.com/admin/api/2025-10/graphql.json failed, reason: connect ETIMEDOUT 23.227.38.74:443:attempt:1\",\"timestamp\":1764933105987},{\"name\":\"theme-api:check-password-protection\",\"timestamp\":1764933106499},{\"name\":\"theme-service:storefront-session:get-session-essential-cookie\",\"timestamp\":1764933106711},{\"name\":\"theme-service:storefront-session:is-password-protected:false\",\"timestamp\":1764933107141},{\"name\":\"theme-api:fetch-checksums\",\"timestamp\":1764933107142},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108251},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108251},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108251},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108252},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108252},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108252},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108253},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108253},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108253},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108253},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108254},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108254},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108254},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108254},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108255},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108255},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108255},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108255},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108256},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108256},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108256},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108256},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108256},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108256},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108257},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108257},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108257},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108257},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108257},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108258},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108258},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108258},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108258},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108258},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108259},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108259},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108259},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108259},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108259},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108259},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108260},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108260},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108260},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933108260},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933108260},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933108260},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933116524},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116525},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933116525},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116525},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933116525},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116526},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933116526},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116526},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933116526},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116526},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933116526},{\"name\":\"theme-api:bulk-upload-assets\",\"timestamp\":1764933116527},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933116527},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933116612},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933116849},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933116862},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933118015},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933118723},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933119114},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933119209},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933119851},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933120149},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933120633},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933120837},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933121315},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933121737},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933123532},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933124210},{\"name\":\"timing:end:theme-api:upload-files\",\"timestamp\":1764933124211},{\"name\":\"timing:start:theme-api:upload-files\",\"timestamp\":1764933125761},{\"name\":\"error:unknown:the-admin-graphql-api-responded-unsuccessfully-wi\",\"timestamp\":1764933131640}]",
  "cmd_all_timing_active_ms": -22790,
  "cmd_all_exit": "expected_error",
  "user_id": "4ec90770-45bc-4c1a-a003-36064e1b995b",
  "request_ids": [
    "2363f8cf-d68c-4855-b71b-5d7aa5014dd7-1764933082",
    "a8eb85ce-78fc-4289-82e4-e6bc02cdbba3-1764933103",
    "59d0a1b3-b489-42f0-aacb-cdc815c154c2-1764933104",
    "829dda81-4d1d-4f3e-96f4-687321bf3ac0-1764933104",
    "5d2318ff-181f-4a55-8d4e-b1375839903f-1764933105",
    "47cd09b0-6204-4bcc-a5e6-dabecaa832d6-1764933105",
    "fb6fa34c-0c92-4bb4-a50b-2ac43a575629-1764933105",
    "0ad88039-94b0-4f84-8ffb-e91ba0b199d7-1764933113",
    "e6e9cfd3-9f94-4741-b24c-19085639793c-1764933113",
    "76866aea-b95e-4724-8456-b4f57a4a8a82-1764933113",
    "e7fefb30-0b77-44bf-a1ed-448f017c8dbb-1764933113",
    "9b95ca1c-93ef-4bf7-8a8f-c4fced68c97c-1764933113",
    "84a38b3e-9d62-4f31-bad6-cd04f2407b25-1764933115",
    "6582110d-7138-4e80-8fd1-116be0a51ea5-1764933115",
    "8f4e0282-531f-4bed-91f3-bfe07dfa90d7-1764933115",
    "581ad991-4eb9-4489-bad8-c688c8490ea9-1764933113",
    "bb63b84d-7410-4f3e-8e85-4a93667038a3-1764933116",
    "986b7935-bf18-4469-8642-9e5f6d01537e-1764933116",
    "18b88cd5-ffbb-440f-a219-5debb6910c41-1764933113",
    "efb7ff3a-9c1c-4e6f-86f7-9b408088889e-1764933113",
    "8d72a507-9a72-4686-b959-590a867e413a-1764933113",
    "640ae0fe-e0b1-4e1e-b3b7-cfe33795d056-1764933113",
    "6b92df95-b38e-4900-9629-2c037f553fd8-1764933113",
    "51b993d6-1e7b-4503-93b3-8c8e82011e69-1764933114",
    "a10f02a2-bb3b-48b6-95fc-18cdc295c39f-1764933113"
  ],
  "args": "--verbose",
  "error_message": "Failed to perform the initial theme synchronization.\n\nThe Admin GraphQL API responded unsuccessfully with the HTTP status 502 and errors:\n\n\u001b[33m{}\u001b[0m\n      ",
  "env_plugin_installed_all": "[\"@shopify/cli\"]",
  "env_shopify_variables": "{}",
  "metadata": "{\"store_fqdn\":\"cw-sellor-test.myshopify.com\",\"extraPublic\":{},\"extraSensitive\":{}}"
}

Sure does! Thank you :grinning_face: