API product update error: "This product is currently being modified"

When trying to update products via GraphQL, sometimes it succeeds, sometimes it’s not. But whenever fails, it’s NOT because of 429 too many requests or over-usage, it is rather due to a VERY STRANGE error which goes like this:

“This product is currently being modified. Please try again later.” with the internal code of “TOO_MANY_PARALLEL_REQUESTS_FOR_THIS_PRODUCT”

now, what does that mean? why is that shown up? the GraphQL mutation used is “productAppendImages”.
I would also like to note that sometimes it succeeds, sometimes it doesn’t - and I can’t find any pattern for the failures. Final note - in the logic of completely updating the product, previous to this query being run, there’s another query run, but with REST API, which 100% succeeds. i.e, in chronological order:

  1. some REST API call to update a product is being made
  2. the request succeeds
  3. a GraphQL “productAppendImages” mutation is being called
  4. about 50% of times it fails and complains with this weird aforementioned error.

Any assistance, or even attempts of assistance will be super appreciated.
Thank you :slightly_smiling_face:

4 Likes

Did you ever resolve this error?

I added some extra delay (5 seconds, so quite a lot) after making the GraphQL request, and it seems to be working now. Fix your system, Shopify, a promise should not be returned until the data is actually ready.

1 Like

Hi** @Arkadi ****and @SoshJam **

When multiple images are being added to the product by the productAppendImages mutation, there must have been some delay with one or more of the asynchronous background operations involved.

Generally speaking, limiting the number of images in your inputs or adding a delay like @SoshJam suggested would be best, but since that mutation is deprecated I’d recommend moving to thecreateProductMedia mutation to see if that gives you better results.

Hope that helps.