Failure when updating product image

Good afternoon :waving_hand:t2: !!

I have a Shopify app to manage the fulfillment service of an online store. The thing is it works fine by keeping the stock and the products up to date, but recently it stopped syncing properly the images as most of them disappeared.

Now I´m digging into this issue and I see I cannot create an image for a given product but no further details are provided. Is there any I could do?

Here is an snippet with the error:

image = ShopifyAPI::Image.new(session: session)
image.product_id = 7532973392025
image.src="https://distribudiet.net/webstore/images/01803.jpg"
image.save!
# Error raised:
# /app/vendor/bundle/ruby/3.1.0/gems/shopify_api-10.1.0/lib/shopify_api/clients/http_client.rb:72:in `request': 
# {"image"=>["Could not download image: [\"Image https://distribudiet.net/webstore/images/01803.jpg failed to download.\"]"]} (ShopifyAPI::Errors::HttpResponseError)
# If you report this error, please include this id: a4ac20a8-ef78-4aa4-bdfd-631cc904ae8f

.

Hi @lmbautista :waving_hand:

Thanks for sharing the Request ID! From the logs, it appears to be an issue with the image host. One option would be to download the image and create the new product image with the image data an attachment, or host the image on a different CDN to use a source URL.

Hope that helps!

Hey @ShopifyDevSup :waving_hand:t2:

First of all, let me thank you for the suggestion.

I tried to regenerate a specific product in the shop via our app, but it didn´t work. However, I tried to upload a random image (https://i.picsum.photos/id/237/200/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U) and It worked fine

Despite I got no clue about how your internal process works to download/expose an image, I can add a snippet where I tried to download successfully an image locally.

# by using gem "rest-client"
def download_fulfillment_service_image
  url = "https://distribudiet.net/webstore/images/01803.jpg"
  response = RestClient.get(url)
  
  File.open("image.jpg", "wb+") { _1.write response.body }
end

I was wondering if you could provide any further technical detail regarding the error of the process to try to push on their side, as I´m totally blind with this issue so any help would be really appreciated to try to solve it ??

Our fulfillment service confirmed they didn´t apply any change on their side, but if there´s no issue either on your side it´s a drama to find out where to look for a solution :sweat_smile:

Thanks!

It’s definitely strange that your image host is not allowing us to process the image. I tested the URL directly on the Admin UI (not using the API), and it failed to process the image URL as well. Historically, we’ve seen situations with custom ports causing issues, and it may be worthwhile to try adjusting your CDN’s server settings to see it that resolves the issue. Alternatively, images can be uploaded to Shopify CDN with the staged upload process as well.