cli icon indicating copy to clipboard operation
cli copied to clipboard

Failed to perform the initial theme synchronisation.

Open anand-s-marmeto opened this issue 1 year ago • 28 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?

Theme

Expected behavior

Running shopify theme dev --store "store-name" should open up a preview for my development theme.

Actual behavior

Image

Verbose output

Verbose output
Build Liquid themes.     

USAGE
$ shopify theme COMMAND

COMMANDS
theme check            Validate the theme.
theme console          Shopify Liquid REPL (read-eval-print loop) tool
theme delete           Delete remote themes from the connected store. This command can't be undone.
theme dev              Uploads the current theme as a development theme to the connected store, then prints theme     
                       editor and preview URLs to your terminal. While running, changes will push to the store in real                         time.
theme info             Displays information about your theme environment, including your current store. Can also      
                       retrieve information about a specific theme.
theme init             Clones a Git repository to use as a starting point for building a new theme.
theme language-server  Start a Language Server Protocol server.
theme list             Lists the themes in your store, along with their IDs and statuses.
theme open             Opens the preview of your remote theme.
theme package          Package your theme into a .zip file, ready to upload to the Online Store.
theme publish          Set a remote theme as the live theme.
theme pull             Download your remote theme files locally.
theme push             Uploads your local theme files to the connected store, overwriting the remote version if       
                       specified.
theme rename           Renames an existing theme.
theme share            Creates a shareable, unpublished, and new theme on your theme library with a randomized name. 

Reproduction steps

  1. Clone any branch from the levis-india-store on your IDE.
  2. Type "npm run dev" ---> this basically runs the command "shopify theme dev --store=levis-india-store.myshopify.com"

Operating System

Windows 10 Pro

Shopify CLI version (shopify --version)

3.70.0

Shell

No response

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

v22.11.0

What language and version are you using in your application?

No response

anand-s-marmeto avatar Dec 04 '24 07:12 anand-s-marmeto

Same issue here (Mac OS Sequoia 15.1.1).

Also tried to:

  • downgrade to 3.68.x or upgrade to 3.71
  • use the CLI installed with npm, pnpm or homebrew
  • switch between three different network connections

Sometimes I manage to sync some files and see my local preview, than it stops also if I do not save or make any change. Otherwise I'm having the error posted above immediately.

This is occurring since 2 days now (Monday morning).

metiuzucc avatar Dec 04 '24 09:12 metiuzucc

Can you rerun with the --verbose flag and send us the result? Could be a link to a github gist if the file is too big.

Seems to be working for me so there might be a problem with your theme/store or something.

charlespwd avatar Dec 04 '24 14:12 charlespwd

Had same issue here. Downgrading to 3.68 worked for me. Make sure you uninstall the package globally then install it with

npm install -g @shopify/cli@<version>

rmajidy avatar Dec 05 '24 05:12 rmajidy

@charlespwd this is the output that I get on running with the --verbose flag: :It basically prints all of the wishlist code - it is a third party application then exists with the following -

With request headers:

  • User-Agent: Shopify CLI; v=3.71.3
  • Keep-Alive: timeout=30
  • Sec-CH-UA-PLATFORM: win32
  • Content-Type: application/json

to https://levis-india-store.myshopify.com/admin/api/2024-10/graphql.json ╭─ error ──────────────────────────────────────────────────────────────────────╮ │ │ │ Failed to perform the initial theme synchronization. │ │ Asset must have a value or attachment │ │ │

anand-s-marmeto avatar Dec 05 '24 10:12 anand-s-marmeto

Also happened for me, had to downgrade.

jenadam avatar Dec 06 '24 01:12 jenadam

Also happened for me same issue

puspjoshi avatar Dec 06 '24 12:12 puspjoshi

Had same issue here. Downgrading to 3.68 worked for me. Make sure you uninstall the package globally then install it with

npm install -g @shopify/cli@<version>

this worked for me too. Thanks a lot.

ghost avatar Dec 06 '24 13:12 ghost

Even downgrading to 3.68 doesn't help in my case.


From: Dileep Ponna @.> Sent: Friday, December 6, 2024 7:18 PM To: Shopify/cli @.> Cc: Anand Singh @.>; Author @.> Subject: Re: [Shopify/cli] Failed to perform the initial theme synchronisation. (Issue #5016)

Had same issue here. Downgrading to 3.68 worked for me. Make sure you uninstall the package globally then install it with

npm install -g @shopify/cli@

this worked for me too. Thanks a lot.

— Reply to this email directly, view it on GitHubhttps://github.com/Shopify/cli/issues/5016#issuecomment-2523293673, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFQVJABXUHCIEL6RQO6YC532EGTK5AVCNFSM6AAAAABS7OPKQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRTGI4TGNRXGM. You are receiving this because you authored the thread.Message ID: @.***>

anand-s-marmeto avatar Dec 09 '24 06:12 anand-s-marmeto

Hi team,

This is the error that I get when downgrading to 3.68 and trying to upload the assets: "Error: Upload failed, could not reach the server at bulkUploadThemeAssets @./cli/dist/index.js:145206:11) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async handleBulkUpload @./cli/dist/index.js:148759:17) at async uploadBatch @.***/cli/dist/index.js:148749:9) at async Promise.all (index 43) at async Promise.all (index 1)"

I tried accessing the index.js file where I see that I get the status of "404" while trying to upload my assets.

Hope to hear from you soon.

Thanks, Anand


From: Dileep Ponna @.> Sent: Friday, December 6, 2024 7:18 PM To: Shopify/cli @.> Cc: Anand Singh @.>; Author @.> Subject: Re: [Shopify/cli] Failed to perform the initial theme synchronisation. (Issue #5016)

Had same issue here. Downgrading to 3.68 worked for me. Make sure you uninstall the package globally then install it with

npm install -g @shopify/cli@

this worked for me too. Thanks a lot.

— Reply to this email directly, view it on GitHubhttps://github.com/Shopify/cli/issues/5016#issuecomment-2523293673, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFQVJABXUHCIEL6RQO6YC532EGTK5AVCNFSM6AAAAABS7OPKQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRTGI4TGNRXGM. You are receiving this because you authored the thread.Message ID: @.***>

anand-s-marmeto avatar Dec 09 '24 08:12 anand-s-marmeto

│ Failed to perform the initial theme synchronization. │ │ Asset must have a value or attachment │

Hi 👋 This seems to be similar to https://github.com/Shopify/cli/issues/5010 (related to having empty files in the theme).

Can you try with the last patch release 3.71.4? It should be fixed there if it's the same problem 🤞

frandiox avatar Dec 10 '24 03:12 frandiox

Nope, getting this error with 3.71.4: Failed to perform the initial theme synchronization. │ │ │ │ │ │ The Admin GraphQL API responded unsuccessfully with errors: │ │ │ │ [ │ │ { │ │ "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: │ │ b4ea74c0-b84f-4951-b962-c68698e76745-1733834498 (include this in support requests).", │ │ "extensions": { │ │ "code": "INTERNAL_SERVER_ERROR", │ │ "requestId": "b4ea74c0-b84f-4951-b962-c68698e76745-1733834498" │ │ } │ │ } │ │ ] │ │ │ │ Request ID: b4ea74c0-b84f-4951-b962-c68698e76745-1733834498


From: Fran Dios @.> Sent: Tuesday, December 10, 2024 8:32 AM To: Shopify/cli @.> Cc: Anand Singh @.>; Author @.> Subject: Re: [Shopify/cli] Failed to perform the initial theme synchronisation. (Issue #5016)

│ Failed to perform the initial theme synchronization. │ │ Asset must have a value or attachment │

Hi 👋 This seems to be similar to #5010https://github.com/Shopify/cli/issues/5010

Can you try with the last patch release 3.71.4? It should be fixed there if it's the same problem 🤞

— Reply to this email directly, view it on GitHubhttps://github.com/Shopify/cli/issues/5016#issuecomment-2530135947, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFQVJABMQZAQLGZWFAQXVX32EZKT3AVCNFSM6AAAAABS7OPKQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZQGEZTKOJUG4. You are receiving this because you authored the thread.Message ID: @.***>

anand-s-marmeto avatar Dec 10 '24 12:12 anand-s-marmeto

I flush my dns and shopify theme dev works as usual.

windows:

ipconfig /flushdns

haziqfiqri avatar Dec 13 '24 09:12 haziqfiqri

Hi same problem here for some shop:

Image

djang0dev avatar Dec 26 '24 08:12 djang0dev

Following worked for me

npm uninstall -g @shopify/cli@latest npm install -g @shopify/[email protected]

chiragramjibhaipatel avatar Jan 09 '25 15:01 chiragramjibhaipatel

I am having this same issue and I have systematically downgraded to every version from latest down to 3.68.1 and no luck. I have cleared the npm cahe, also installed it both globally as well as a dev dependency in my project. Nothing seems to work

Adding on to this. The problem seems to stem from the fact that I am doing work on multiple stores as if I go to the store I had previously been making changes the shopify theme dev command works just fine.

hcmlopes avatar Jan 21 '25 19:01 hcmlopes

Hi team,

Downgrading the cli to 3.72.0, reinstalling the IDE and reinstalling the Shopify configuration requirements worked. Thankyou for the support.


From: Chirag Ramjibhai Patel @.> Sent: Thursday, January 9, 2025 9:16 PM To: Shopify/cli @.> Cc: Anand Singh @.>; Author @.> Subject: Re: [Shopify/cli] Failed to perform the initial theme synchronisation. (Issue #5016)

Following worked for me

npm uninstall -g @@.*** npm install -g @@.***

— Reply to this email directly, view it on GitHubhttps://github.com/Shopify/cli/issues/5016#issuecomment-2580613337, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFQVJAHDK6QDRFUBNASE2YL2J2KXFAVCNFSM6AAAAABS7OPKQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBQGYYTGMZTG4. You are receiving this because you authored the thread.Message ID: @.***>

anand-s-marmeto avatar Jan 22 '25 05:01 anand-s-marmeto

Hi All, attn: @charlespwd

I am currently suffering from this same issue.

While the CLI initially connects and displays the success message (including theme preview, customize, and share links), it abruptly shuts down with the following error message:

Failed to perform the initial theme synchronization.


The Admin GraphQL API responded unsuccessfully with errors:
[
  {
    "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 33d9e6e4-b0a1-4cb1-be86-29e9bd703ad0-1737645343 (include this in support requests).",
    "extensions": {
      "code": "INTERNAL_SERVER_ERROR",
      "requestId": "33d9e6e4-b0a1-4cb1-be86-29e9bd703ad0-1737645343"
    }
  }
]

Steps Taken:

  • Reinstalled Shopify CLI (latest, version 3.74.0 and 3.74.2)
  • Ran shopify auth logout and then re-authenticated
  • Cleared CLI cache (~/.shopify-cli/cache).
  • Cleared DNS Cache
  • Verified the theme ID and internet connectivity.
  • Switched to a different network connection
  • Attempted shopify theme push and shopify theme pull manually.
  • Ran the CLI in verbose mode but did not find additional actionable details (txt output attached).
  • Deleting and re-cloning my local repo.

Environment:

  • Shopify CLI version: 3.74.0
  • Node.js version: 20.15.0
  • Operating System: macOS: Sequoia 15.2
  • Request ID: 93b1e148-f5fd-4385-a63b-5fbf64380931
  • Shell: Zsh via VS Code and mac terminal
  • Language: Liquid + Vue which builds to /dist folder. Error occurs running shopify theme dev from dist folder as well as project's dev command.

Additional Info:

  • Everything worked fine during development, this issue cropped up about 18 hours after the theme went live. (Actively making changes the whole time.)
  • The other Developer on my team is not experiencing the same issue.

Could you please help me resolve this issue or provide guidance on how to proceed? I am happy to provide additional details if needed.

Thank you for your assistance!

Best regards, Liz Nix

shopify-theme-dev-verbose-output.txt

LizNix avatar Jan 23 '25 15:01 LizNix

Tried above steps of downgrading but issue still happening for me.

ghost avatar Jan 23 '25 17:01 ghost

What worked for me was removing my development theme by using the following command: shopify theme delete -t=<Your development theme id>

ghost avatar Jan 27 '25 10:01 ghost

What worked for me was removing my development theme by using the following command: shopify theme delete -t=<Your development theme id>

Brilliant! This worked for me as well. I wish I'd though of it!

I get a new error now, but I'm able to get around it with sudo.

LizNix avatar Jan 27 '25 15:01 LizNix

I've managed to get around it for now by working on an development store instead of a client store.

ghost avatar Jan 27 '25 15:01 ghost

Same issue happening for me. Had to downgrade to v3.72.0

MichaelMackus avatar Feb 26 '25 20:02 MichaelMackus

npm install -g @shopify/[email protected]

this one works for me, thanks @chiragramjibhaipatel

fiko avatar Mar 06 '25 14:03 fiko

I'm still getting this error. Failed to perform the initial theme synchronization.

Like many of the other people here, I tried downgrading version systematically. Nothing worked. There are a few times where I got it to work for 10 seconds, and then the process errored on me. I couldn't reproduce it.

I looked up the error in the source code and it's from this file packages/theme/src/cli/utilities/theme-environment, We're making a function here called abort with the error message in question:

// Line 32, in the `ensureThemeEnvironmentSetup` function:
const abort = createAbortCatchError('Failed to perform the initial theme synchronization.')

Only problem is, the same abort function gets called in 5 different places (with the same error message), which means we don't actually know where the code is going wrong.

I thought maybe I could clone the repo, change out the code a bit so it throws a different error message for each step, then build the code from source and run it against my project, but I don't actually know how to build it from source. Does anyone know how to to do this?

I tried the following

git clone https://github.com/Shopify/cli && cd cli
pnpm install
pnpm build
cd /path/to/my/project/
node path/to/cli/packages/theme/dist/cli/commands/theme/dev.js --store mystore

I also tried some variations of that:

  • using pnpm bundle-for-release instead of build
  • using packages/theme/dist/index.js dev instead of packages/theme/dist/cli/commands/theme/dev.js

If anyone knows more about how to do this, please let me know!

MinKaizen avatar Mar 14 '25 09:03 MinKaizen

I also have been facing this issue for many months now. (Deleting development theme did not help.)

Sample error received on version 3.70.0:

Failed to perform the initial theme synchronization.
│
│  request to
│  https://my-shopify-store.myshopify.com/admin/api/unstable/themes/173688914237/assets/bulk.json
│  failed, reason

Sample error received on version 3.76.2:

Failed to perform the initial theme synchronization.

request to https://my-shopify-store.myshopify.com/admin/api/2025-01/graphql.json failed, reason:

Luckily, using --legacy flag (like shopify theme dev --legacy --store my-shopify-store.myshopify.com) has been working as a workaround. As --legacy flag was removed in version 3.69.0, I have been using version 3.68.1 of @shopify/cli.

Note: After the downgrade, dunno why, but the first 2-3 executions of shopify theme dev just hangs. Killing the terminal, launching a new one and running it again works!

Hoping this gets fixed in latest version as who knows when old version becomes unsupported.

vinay-vissh avatar Mar 25 '25 15:03 vinay-vissh

I upgraded to latests version, it was working for some themes, but for some themes, it again started showing same error. routines:ssl3_read_bytes:sslv3 alert bad record │ │ mac:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1605:SSL alert number 20

again downgraded to 3.72.0 now its all good

chiragramjibhaipatel avatar Mar 31 '25 06:03 chiragramjibhaipatel

Current Shopify CLI version: 3.60.0 ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin23]

It can work!

lyctea avatar Apr 21 '25 09:04 lyctea

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 Jun 10 '25 03:06 github-actions[bot]

On the latest version of the shopify cli 3.80.7 with wsl same issue happens downgrading to 3.70.0 fixes the issue :/

KikoTs avatar Jun 10 '25 14:06 KikoTs

Closing this issue in favor of https://github.com/Shopify/cli/issues/5917.

karreiro avatar Jun 23 '25 12:06 karreiro