Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Failed to upload file config/settings_data.json without a good reason #5242

Open
2 tasks done
DawidKopys opened this issue Jan 21, 2025 · 3 comments
Open
2 tasks done
Labels
Area: @shopify/theme @shopify/theme package issues Severity: 3 Normal Severity Type: Bug Something isn't working

Comments

@DawidKopys
Copy link

DawidKopys commented Jan 21, 2025

Please confirm that you have:

  • 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.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

The CLI should push both settings_data.json and settings_schema.json config files without any issues.
It should work since the new settings in the settings_data.json file meet new settings' schema defined in the settings_schema.json.

Actual behavior

The CLI pushes only settings_schema.json, and provides a warining in the command output:

╭─ warning ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  The theme 'Development (d7dc3d-Dawids-MacBook-Pro)' (#177681236314) was     │
│  pushed with errors                                                          │
│                                                                              │
│  Next steps                                                                  │
│    • View your theme [1]                                                     │
│    • Customize your theme at the theme editor [2]                            │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Verbose output

I can't paste the verbose output here as github shows "Field can not be longer than 65536 characters" error...

So, here is the file instead:

push-output.txt

Reproduction steps

  1. Modify some "type": "range" setting in the config/settings_schema.json file, reducing it's step value
  2. Modify value of the same setting in the config/settings_data.json. The new value should use the new step and it should not meet the previous step constraint.
  3. Run shopify theme push

This issue happens both on my local machine and in gitlab's CI.
I am using Shopify CLI 3.74.0 on my local machine and 3.72.1 in the Gitlab CI.

Operating System

MacOS Sonoma AND GitLab CI based on node:20 image

Shopify CLI version (shopify --version)

3.74.0

Shell

iTerm2

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

v20.18.0

What language and version are you using in your application?

No response

@DawidKopys DawidKopys added the Type: Bug Something isn't working label Jan 21, 2025
@craigmichaelmartin craigmichaelmartin added the Area: @shopify/theme @shopify/theme package issues label Jan 21, 2025
@aswamy
Copy link
Contributor

aswamy commented Jan 21, 2025

It's usually pretty risky to modify settings_data.json directly since it's an auto-generated file.

Could you try only changing settings_schema.json, and do the following steps instead?

  • Edit settings_schema.json to your liking (e.g. changing steps from 100 to 50 for page_width)
  • Run shopify theme dev
  • Open Theme Editor
  • Change the theme to have a width using the new increment
  • Save the theme
  • Run shopify theme pull

You should have current block in settings_data.json changed

@DawidKopys
Copy link
Author

In a real use case we are not modifying the settings_data.json manually. We do it through the theme editor, the way you suggested.

This issue is taking place in our GitLab CI pipeline. We are using GitLab instead of GitHub at our company, so we have created a custom integration with Shopify this way.

To be more precise, this issue might happen when we merge a feature branch into - for example - main.

The feature branch contains all changes done during feature implementation. This often includes changes in both settings_schema.json and settings_data.json (edited through the Theme Editor, during development).

After the merge happens, we then try to push our code into a theme corresponding to our main branch.
We do it with shopify theme push --theme=<theme_id>.
This command is where the issue appears.

The reproduction steps I have provided in the issue are here just to provide you with a simple way to reproduce the issue we encounted when executing shopify theme push command in our use case.

Hope this clarifies our issue to you.

@aswamy
Copy link
Contributor

aswamy commented Jan 24, 2025

@DawidKopys Ok i do see the error!

Image

I'll let the team know, but for now, you might have to make shopify theme push in multiple stages. Sorry for the inconvenience.

@aswamy aswamy added the Severity: 3 Normal Severity label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Severity: 3 Normal Severity Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants