Support Forums

Gridsome build fails while processing images in Netlify - works fine using netlify-cli just not Netlify UI

I need advice to debug deploy Netlify App

Hiya, I am able to run the build command w/o issue on my local device, but everytime I run it on Netlify it fails processing on a different image. Sometimes processing get to 98% then fails, others it fails at 52%. Reading similar issues it looks like it could be Netlify’s build process timing out, but the build isn’t taking that long ~6m and I still have plenty of build minutes available - note that even after 15m if it gets hung up it does not exit the build nor present me with any errors.

I ran the netlify-cli build command on my machine and everything worked properly. I also tried changing the image, but that just leads to it getting hung up and never actually finishing or erroring out on a build. Let me know if i can provide logs - or if you can see my deploy history. not sure what is up here. I would like to keep automatic deploys so would prefer to keep that workflow if possible

Additional build log for reference: Netlify App

Switched back to the Ubuntu Xenial 16.04 image as read v20 does not handle image processing well and the build process would not even get to the point of erroring our with the v20 image applied. After switching it back to 16.4 am back to normal with the following errors:

3:14:39 PM: Processing images (637 images) - 0%Processing images (637 images) - 4%Processing images (637 images) - 8%Processing images (637 images) - 12%Processing images (637 images) - 15%Processing images (637 images) - 19%Processing images (637 images) - 23%Processing images (637 images) - 27%Processing images (637 images) - 31%Processing images (637 images) - 35%Processing images (637 images) - 38%Processing images (637 images) - 42%Processing images (637 images) - 46%Processing images (637 images) - 50%Processing images (637 images) - 54%Processing images (637 images) - 58%Processing images (637 images) - 62%Processing images (637 images) - 65%Processing images (637 images) - 69%Processing images (637 images) - 73%Processing images (637 images) - 77%Processing images (637 images) - 81%Error: Failed to process image wp-images/csf-mini-case-study-v1-04.png.
3:14:39 PM:     at pMap.concurrency (/opt/build/repo/node_modules/gridsome/lib/workers/image-processor.js:140:13)
3:14:39 PM:     at runMicrotasks (<anonymous>)
3:14:39 PM:     at processTicksAndRejections (internal/process/task_queues.js:97:5)
3:14:39 PM: (sharp:5613): GLib-CRITICAL **: 20:14:39.887: g_hash_table_lookup: assertion 'hash_table != NULL' failed
3:14:39 PM: (sharp:5613): GLib-CRITICAL **: 20:14:39.887: g_hash_table_lookup: assertion 'hash_table != NULL' failed
3:14:39 PM: (sharp:5613): GLib-CRITICAL **: 20:14:39.887: g_hash_table_lookup: assertion 'hash_table != NULL' failed
3:14:39 PM: (sharp:5613): GLib-CRITICAL **: 20:14:39.887: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
3:14:39 PM: (sharp:5613): GLib-CRITICAL **: 20:14:39.887: g_hash_table_lookup: assertion 'hash_table != NULL' failed
3:14:40 PM: (sharp:5620): GLib-CRITICAL **: 20:14:40.102: g_hash_table_lookup: assertion 'hash_table != NULL' failed
3:14:40 PM: (sharp:5620): GLib-CRITICAL **: 20:14:40.456: g_hash_table_lookup: assertion 'hash_table != NULL' failed

Hi @createfervor,

Are you trying to download the images build? if yes, does this happen only with the images that are downloaded or also with the images that you might already have in the repo?

My guess is that, if you’re trying to download the images, maybe one of the images is getting corrupted and thus failing.

Yeah, images are pulled from WordPress during the build cycle. At first, I left that download folder out of my repo (so it would download again) but after getting errors I generated the images and just pushed those to the repo. I see what you mean, I will look a little deeper to make sure that images aren’t being downloaded if they already exist in the proper directory.

Thanks, i’ll update with what I find!

No dice, unfortunately, I confirmed that it does not re-download images if they are already present, but the build continues to fail when it runs through the asset optimization stage. It is not consistent on what file or percentage it fails on, sometimes it will fail at 30% others at random spots in the 80% range. No issues running the netlify build command on my local machine. I added NETLIFY_BUILD_DEBUG but it does not seem to print out any errors etc associated with the process failing.

Given how slow the build is compared to what I see when running it locally, I am wondering if Netlify UI doesn’t have enough memory/resources to generate static assets in addtion to processing 600+ images at build?

One thing for you to try could be to use Netlify’s official docker image on your system to see if that’s able to build your website. If that does and Netlify UI doesn’t, then it would be something wrong with the systems. If that fails too, you could confirm out the problem about not having enough memory/resources.