themekit: Receiving malformed response (bad response or corrupted JSON)

Is your feature request related to a problem? Please describe. Using version 1.0.0 windows 10 64 bit When downloading theme files, using themekit get -t=THEMEID, you may get the following message output: error downloading asset: received a malformed response Which seems to be from ErrMalformedResponse Without the verbose (-v) flag after the download process finishes this may be displayed multiple times. image And the progress count indicates all files have downloaded but some files are actually missing when checking the folders&files on the OS.

With the verbose flag I will see the above error in between messages of “Successfully wrote X to disk” so creates an ambiguity because what does that mean when following an error?

  • A) the file displayed after the error message was the one erroring and finally downloaded successfully?
  • B) that a file got skipped silently and next message are other files downloading and wrote to disk successfully?
  • ???

Without the filename or a checksum system you have to download the theme zip and do a comparison if you want to soothe the file paranoia, and then copy any missing files

Describe the solution you’d like Included the relevant filename so interpretation of the message is easier. Or clarifying if a file needs to be redownloaded either in the console or in the documentation. Or provide a log of affected files to then pipe back into themekit for individual download. Or prompt user to retry missing files

Describe alternatives you’ve considered Alternative is to manually download theme zip from the store admin via email kinda rendering themekits download capability pointless when these errors occur.

Additional context I’m not able to reliably reproduce the same output with the -v flag or narrow down if it’s specific file types, or as a problem on shopifys end or my end. The theme was created less than an hour before running command Increasing the timeout to 1minute doesn’t make it go away.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 36 (13 by maintainers)

Most upvoted comments

Context Cancelled is worriesome. Right now I am cancelling requests with context when we get a 499 status response. I did not think that this would effect responses that have already completed. I think I might be able to make a work around for this.

(assets/…js)

Probably unrelated and merely a coincidence but that js file indicates it’s the same theme that first gave me these types of errors. Which at the time seemed like a combo of the wifi portal used and maybe the large images assets.

@jonpennington Anyone found insights into this? Thanks!

Unfortunately I think repeatability is the problem here, I’ve not seen it again since themekit was updated with #544 thanks to tanema, however I also haven’t touched that theme again but I made a laundry list to go through if it happened again since it kills productivity when it happens. To rule out cases such as specific themes being culprits anyone wanting to hunt this down could try:

  • If you can, collect and note network logs either with Charles Proxy or mitmproxy so if tanema asks for logs he can make themekit more resilient
  • Rule out network, try a different network , and different hardware connection
  • Rule out local env, try a different computer, and with different network access
  • Try on a different test store (remember to delete theme when done)

That at least narrows it more to the theme itself or some themekit bug and not single network oddness Make a backup export of the theme:

  • Try to repeat the error using any of the free shopify themes directly installed from theme store theme download -> theme deploy either over the problem theme or a new folder
  • or use theme new to generate a theme and repeat themekit commands either over the problem theme or a new folder
  • Do a fresh zip install in the admin of the erroring theme then retest themekit commands
  • Try a fresh zip install but minus any large files? (repeat above but remove all large files first >2MB,>1MB,etc)
  • more extreme gut the theme and add files 1 at a time until errors come up again If any installs also get errors try using a different local directory or hard-drive location and repeating

Theme trials do not let you access the themes code neither through the admin or the api AFAIK , though this seems like this should be a 403 access forbidden instead of this error.

On Wed, Apr 8, 2020, 4:33 AM oscarsan notifications@github.com wrote:

So, is it so then that Trial Themes shoul work fine? Im having exactly this same problem for a theme trial. If I try in the same shop theme kit for an free one which is Live now it works, but for the Theme Trial it does not.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Shopify/themekit/issues/631#issuecomment-610827392, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALIKKMMQRU2UU54LOG6U42DRLQZDXANCNFSM4HIG5EHQ .