Can not modify asset via API

Topic summary

A developer’s Ruby code for modifying Shopify theme assets via the REST Admin API has stopped working after functioning for 2 years. The code attempts to update a liquid template file but fails with a generic error reference ID, providing no actionable debugging information.

Technical Details:

  • Using API versions 2023-01 and 2023-10 (both tested)
  • Has proper write_themes scope permission granted by Shopify
  • Uses shopify_api gem v13.3.1 with Ruby 3.2.2
  • Error occurs across multiple stores and vintage themes
  • Following official documentation for PUT /themes/{theme_id}/assets

Current Status:

  • Issue remains unresolved and ongoing
  • Shopify support (Liam) escalated to the Assets API team for investigation
  • Developer awaiting response after follow-up inquiry
  • No clear cause identified despite upgrading dependencies

The vague error messages from Shopify’s API make troubleshooting difficult, leaving the developer unable to determine whether the issue stems from code changes, API updates, or platform-side problems.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

I refer to this doc https://shopify.dev/docs/api/admin-rest/2023-01/resources/asset#put-themes-theme-id-assets

Using API 2023-01 (yes I get a permission from Shopify to use Assets API in 2023-04 etc)

The previous (2 years) code has recently stopped working without any adequate error. Here is my Ruby code

assetA = ShopifyAPI::Asset.all(theme_id: theme_id, asset: { "key" => "templates/collection.liquid" }).first
assetA.value = "{% assign somevar_position = 'posA' %}
{% render 'dotslidersnippet', somevar_position: somevar_position %}
                                      {% section 'static-collection' %}
                                      {% section 'static-recently-viewed' %}
                                      {% section 'static-collection-promo-grid' %}"
assetA.save

The above code get an Exception

{"error_reference":"If you report this error, please include this id: cdab03cc-29cb-41f4-8550-10a4e84e6f0d."} backtrace ["/user/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/clients/http_client.rb:75:in `request'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation_2_7.rb:108:in `bind_call'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation_2_7.rb:108:in `block in create_validator_method_fast1'", "/user/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/clients/rest/admin.rb:68:in `put'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:153:in `bind_call'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type'", "/user/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/rest/base.rb:345:in `public_send'", "/user/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/rest/base.rb:345:in `save'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:153:in `bind_call'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type'", "/user/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11156/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type'", "/opt/bitnami/apps/railsapp7/htdocs/shopifydotslider/app/controllers/settings_controller.rb:503:in `block in update'", "/opt/bitnami/apps/railsapp7/htdocs/shopifydotslider/app/controllers/settings_controller.rb:245:in `each'", "/opt/bitnami/apps/railsapp7/htdocs/shopifydotslider/app/controllers/settings_controller.rb:245:in `update'", "/user/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'", "/user/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'", "/user/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'", "/user/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'", "/user/.rvm/gems/ruby-3.2.2/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'", "/user/.rvm/gems/ruby-3.2.2/gems/actiontext-6.1.7.6/lib/action_text/rendering.rb:20:in `with_renderer'", "/user/.rvm/gems/ruby-3.2.2/gems/actiontext-6.1.7.6/lib/action_text/engine.rb:59:in `block (4 levels) in 

How to solve this?

Hi Lokki54,

The Asset API has not been deprecated yet, so the upcoming changes should not have caused what you’re seeing. Just to confirm, the above code is not calling the API version 2023-04 or above, correct? Is this happening on multiple stores, or just one?

Hello. Thanks for your reply.

I stay on 2023-01 and was testing things before switching to 2023-04. Yes, it happens on different stores and on two vintage themes. My first thought it was something with shopify_app gem v21.8.1 I recently upgraded and latest Ruby 3.2.2 but error returned from Shopify API give me no glue what is problem. ?

{"error_reference":"If you report this error, please include this id: cdab03cc-29cb-41f4-8550-10a4e84e6f0d."}

I’ve reached out to the Assets API team who’ll be able to look a bit deeper into this. Will update asap.

Hello. Is any news about this problem?

I have noticed same issue with API 2023-10

here is full debug from my ruby code when I try to edit asset (app has a special permission to write_themes scope)

I follow code from the doc https://shopify.dev/docs/api/admin-rest/2023-10/resources/asset#put-themes-theme-id-assets

ERROR: editasset: {"error_reference":"If you report this error, please include this id: ebaf99d8-5017-4341-97d8-ff2bce751d0e."}
CRITICAL ERROR FULL DEBUG editasset error: {"error_reference":"If you report this error, please include this id: ebaf99d8-5017-4341-97d8-ff2bce751d0e."} backtrace ["/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/clients/http_client.rb:75:in `request'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation_2_7.rb:108:in `bind_call'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation_2_7.rb:108:in `block in create_validator_method_fast1'", "/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/clients/rest/admin.rb:68:in `put'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:153:in `bind_call'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type'", "/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/rest/base.rb:345:in `public_send'", "/.rvm/gems/ruby-3.2.2/gems/shopify_api-13.3.1/lib/shopify_api/rest/base.rb:345:in `save'", "/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:153:in `bind_call'", 
"/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type'", 
"/.rvm/gems/ruby-3.2.2/gems/sorbet-runtime-0.5.11150/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type'", 
"/pathtoapp/app/controllers/save_controller.rb:510:in `block in update'", "/pathtoapp/app/controllers/save_controller.rb:258:in `each'", 
"/pathtoapp/app/controllers/save_controller.rb:258:in `update'", 
"/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'", "/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'", "/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'", "/.rvm/gems/ruby-3.2.2/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'", "/.rvm/gems/ruby-3.2.2/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'", "/.rvm/gems/ruby-3.2.2/gems/actiontext-6.1.7.6/lib/action_text/rendering.rb:20:in `with_renderer'", "/.rvm/gems/ruby-3.2.2/gems/actiontext-6.1.7.6/lib/action_text/engine.rb:59:in `block (4 levels) in