Why am I getting a socket hang up exception when updating theme assets?

Why am I getting a socket hang up exception when updating theme assets?

abhishektaparia
Shopify Partner
9 0 6

I have created a Shopify App which add/update assets files to themes. For this I am using HTTP PUT request on:

 

https://your-development-store.myshopify.com/admin/api/2022-01/themes/828155753/assets.json

 

 As a response, I am getting Socket hung up exception:

 

PUT https://your-development-store.myshopify.com/admin/api/2022-01/themes/828155753/assets.json
Error: socket hang up

 

I have tried in Postman, Axios and cURL. Getting same response.

Replies 4 (4)

AvadaCommerce
Shopify Partner
3879 839 981

Hi @abhishektaparia ,

 

It looks like it may be a similar issue as others are seeing and discussing in https://community.shopify.com/c/Shopify-APIs-SDKs/Urgent-Are-you-experiencing-issues-with-PUT-POST-P...

 

banned
abhishektaparia
Shopify Partner
9 0 6

@AvadaCommerce yes and this is weirdly occurring. If I try the request with small data it works, but if I try with long paragraph I get this exception.

 

Below cURL request adds the data to the file.

 

curl --location --request PUT 'https://cooee-test-store.myshopify.com/admin/api/2022-04/themes/121121734730/assets.json' \
--header 'X-Shopify-Access-Token: XXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
  "asset": {
    "key": "snippets/sample.liquid",
    "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  }
}'

 

 

But when I increase data quantity, it fails:

 

curl --location --request PUT 'https://cooee-test-store.myshopify.com/admin/api/2022-04/themes/121121734730/assets.json' \
--header 'X-Shopify-Access-Token: XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
  "asset": {
    "key": "snippets/sample.liquid",
    "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vitae scelerisque sapien. Duis dapibus pellentesque orci, at mollis mi condimentum non. Donec posuere ante ut nulla ullamcorper, sit amet aliquet ligula sollicitudin. Nulla facilisi. Suspendisse lectus turpis, placerat vitae est in, tincidunt tincidunt ligula. Proin tempor tempus est, et aliquam lacus tincidunt a. Sed convallis varius felis, vitae imperdiet mauris vulputate dapibus. Fusce fringilla cursus orci ut hendrerit. Sed fringilla est vitae vehicula tempus. Suspendisse consectetur, risus et commodo feugiat, diam est pretium metus, ut auctor quam erat vel magna. Sed malesuada ex id leo porta, vel lobortis purus ultricies. Sed ornare augue molestie libero vehicula fringilla. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris euismod faucibus dictum. Praesent eget aliquam elit. Nulla sit amet lorem aliquet, ullamcorper orci nec, posuere mi. Duis ornare dolor id sapien dui."
  }
}'

 

And even this is quite bit random. If I decrease data line by line, same data some times adds, some don't.

 

abhishektaparia
Shopify Partner
9 0 6

Hi, any update on this? It is becoming a blocker for my app.

iamanam
Shopify Partner
3 0 0

I am also facing the problem. Did you find any solution?