Theme API throwing {'src': ['is empty']}} error

Highlighted
New Member
4 0 0

Hi. I've been trying to hardcode a picture into the hero.liquid section. I finally got it to work in the theme designer. However, when I download the theme file and try to upload it to another store via the API, I get a 422 unproccessable error with the following error : {'errors': {'src': ['is empty']}}. I know that I am making the correct call because I have other themes that I can download from my store and upload via the API completely normally. Also, it does not appear to be an issue with the theme itself because I can upload them manually by pressing the "Upload Theme" button. I'm confused why only the API call would fail and why it would say src is empty. Any help is appreciated! I have renamed the themes in my store. Both the themes "Img-src-attempt" and "non-uploadable" have hardcoded pictures and fail on the API. The theme "Please Test" does not have the hardcoded picture and can be uploaded via the API. Also the call that is being made is POST /admin/api/2019-10/themes.json. In addition, the following is my payload (where SRC corresponds to a direct link to a zip file stored in Google Drive. I have also tried storing it in Dropbox and this also gives the same error)

"theme": {
"name": "Please Test",
"src": "https://drive.google.com/uc?export=download&id=1N5B8-m2sbSBDaiqBi1fQtJv8Lc-RlGrN",
"role": "main"
}
}

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 71 128

Hey @jphifer,

 

The issue is the Google Drive link. I tried your call and got the same error, but I got it to work by downloading the file from your link and uploading it to a different public endpoint. I believe Google Drive attempts to do some kind of authentication which is why the API can't download the file. You can test this by uploading the theme zip file to the "Settings" > "Files" section of any Shopify store, and use the resulting CDN link in your API call.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
4 0 0

Hi Jb, when I try to upload a zip file to the files section, it says error, the file type is not supported. Is there any reason this would be occurring? I am using a mac computer if that helps at all.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 71 128

Hey @jphifer,

 

Can you confirm if you're downloading the ZIP file from the Google Drive link in the original post? If so, please confirm the shop_id and date/time that you tried to upload the ZIP, and I will check our logs to see what the issue was.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes