Image post randomly return 422 status

Image post randomly return 422 status

Ahira
Tourist
7 0 1

I've been messing with this for hours now. Certain product images will fail with 422 status, and I can't identify any rhyme or reason. For example:

 

 

 

422
https://X:X@my-store.myshopify.com/admin/api/2022-04/products/7095854825652/images.json
{'User-Agent': 'python-requests/2.27.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '95', 'Content-Type': 'application/json', 'Authorization': 'Basic 'Y'}

b'{"image": {"src": "https://www.website.com/cdn/cs/set/assets/blta3d39bc2baca3d5f/42115_alt7.jpg"}}'

 

200
https://X:X@my-store.myshopify.com/admin/api/2022-04/products/7095854825652/images.json
{'User-Agent': 'python-requests/2.27.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '95', 'Content-Type': 'application/json', 'Authorization': 'Basic 'Y'}
b'{"image": {"src": "https://www.website.com/cdn/cs/set/assets/blt3fc5cfbfbf54f990/42115_alt8.jpg"}}'

 

 

 

 

Any thoughts are GREATLY appreciated!

Replies 3 (3)

Shayne
Shopify Staff (Retired)
254 20 48

Usually when this happens, it's because the image isn't accessible, or it's transferring too slowly because the image is too big or the host is too slow. 

You may want to try hosting the images somewhere else, and then try adding them again!

Shayne | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Ahira
Tourist
7 0 1

Thank you for the reply. I can’t see how it’s either of those things considering it’s hosted on a CDN where I pulled 1000s of other images. It’s not larger than other files. Could it be anything else?

吴晗
Shopify Partner
6 0 0

创建产品时,如何上传产品描述的图片呢