Intermittent failure of Product Image API

We are experiencing intermittent failure of your ProductImage api. This appears to be a fairly recent problem.

Specifically we have a piece of code we will run the following operations.

  1. Check if a variant exists.
    2. If the variant exists delete an image from the variant.
    3. If the variant exists and once the image has been deleted we will upload a new image to a given product variant.

All these operations will always appear to have succeeded YET in some fraction of the cases (maybe 1/3) the image that is supposed to be created, despite the operation returning indication that it has completed successfully will not exist or be associated with the given product/variant.

An example of such a failed operation is an image that should be located at

https://cdn.shopify.com/s/files/1/0487/8349/1233/products/ZENGAZ-ZT3-LIG-20-RUBBERIZED-JET-LIGHTER_9b31e394-a8ea-4120-b433-e1f454490c97.png?v=1647094797

This image upload has completed successfully YET you will see that when you attempt to access this image it does not exist. I note that this image has not been deleted.

Example product/Shop: https://myvapclub.myshopify.com/admin/products/7297721270433

I have also attached below the complete request/response with what appears to be the successful transaction.

Can you please provide any guidance?

Hey @WebTail ,

I had a closer look the details you shared regarding API requests to update, delete, and/or create product images. In my testing I was unable to replicate this on my development store, troubleshooting with REST and GraphQL APIs as well as requests made by both an app and API client.

You mentioned this is not happening every time (more intermittent), so logging any x-request-id response header values returned for requests exhibiting the unexpected behavior is a good start. If you share those details we can try to locate logs on our end, however our team isn’t able to provide authenticated support through access to store/app info via these community forums and there may limit to how far we can dig.

The best option for cases where you feel there is a bug would be to authenticate for a partner account and select this support option to Report an issue. Though we can’t guarantee all requests or bugs reported here will be answered directly, sharing as much detail and context as possible is always suggested.

Regardless I will keep an eye out here, and hope you get this sorted out soon! - Cheers

Hi AwwDam,

I have already provided exactly what you are asking for in the attached response text file which includes the x-request-id: 41456ee0-8db3-40ee-9e99-0d4275b3d618 for the example I provided.

I am also already authenticated as a shopify partner as should be visible in my profile.

After further testing I found that I had a race condition in my code which was causing this error.

1 Like