-
-
Notifications
You must be signed in to change notification settings - Fork 56
Frequent build errors on Netlify #204
Comments
here is another one 11:47:09 AM: success run static queries - 0.106s - 16/16 150.38/s |
The sharp errors look scary but can be ignored (there is an async issue in the gatsby-plugin-sharp plugin, but the images are still generated). The other build errors, however, should not happen and I am surprised to see those given that I also deploy on Netlify without problems. Could you please first test, if you also see those errors when building locally? Maybe it is an issue with the volume, how many images are you processing? |
Funny I just had the first time the same error on my local.
I looked for the file in demo/public/static and it did exist. I ran yarn build and everything was fine 🙃. Any advice on what to look for? I am just starting out with Gatsby, wondering if
3.406837832 Number of node types: 16. Nodes per type: SitePage: 41, SitePlugin: 64, Site: 1, SiteBuildMetadata: 1, Directory: 3, File: 32, ImageSharp: 28, GhostTag: 14, GhostSettings: 1, GhostAuthor: 1, GhostPage: 4, HtmlRehype: 15, GhostPost: 11, ghostConfig: 1, ContactPage: 1, TopicsPage: 1 |
So I signed up for Gatsby, I made 3 deploys so far, and they always succeded in Gatsby but failed on Netlify. I experienced the issues once more on my local, so I am not 100% confident that building on Gatsby solves my issue. |
I also build on Gatsby Cloud and not directly on Netlify, but I am also not seeing the issue locally. Could you please provide your repo with (temporary) API keys, so I can test your site locally on my machine? This is most likely either a problem with the used Gatsby version or related to your (local/Netlify) build system. Apart from clearing the cache with
The error messages points to dangling cache files. |
Not sure if I like that dependency 😄 but it works flawlessly so far. I am currently building simultaneously on both and Netlify always fails. I have removed the lock file btw and the build installs the packages with npm. I use yarn locally.
I tried a lot of things replicated the same steps after a fail, but since the build time takes a while this is a painful time suck.
Local - Gatsby CLI version: 2.12.107 node v12.19.0 Gatsby - Gatsby CLI version: 2.12.113 Node v12.19.0 I still think it's related to image processing and running out of memory, and considering the lighthouse results mentioned in #203 images not correctly sized etc maybe improvements will help with this issue.
Thoughts on how I can trace the error? All I was able to confirm is that the file does exist at least after the failed build, not sure where the error is thrown and how to debug. |
I'd be surprised if the error is related to image processing and running out of memory. You can turn off Gatsby image processing entirely by:
This could be a first step in trying to localize the issue. |
I already removed gatsby-rehype-inline-images and I will give removing the feature images a try |
While I looked at #202 I cloned this repository installed packages with yarn and ran yarn build and got this error Error: ENOENT: no such file or directory, chmod '/dev/gatsby-theme-try-ghost/demo/public/static/d5aa518ea784e1b659 b6bf9a69bd6f76/site-meta.png' yarn build right after no error |
Sounds like a duplicate of #188 if you are building on macOS. I think this error is different from the ones showing the |
Try run yarn develop |
After clearing the cache, I can see the issue now. Actually, I think it is the same as gatsby/issues/27984. |
Fun fact: this error tells you something about the speed of your file-system. The faster your file writes the less likely you run into this error. Final fix is on its way... |
@marcoSven: Could you please verify that the reported build errors are fixed? |
I had a hunch something hardware is related to this intermittent issue. Tells you something about Netlify vs Gatsby Cloud - kind of annoyed this was frequently happening on my Mac ;) Looks like it is fixed!!! 🎉 |
Perfect... and thanks for bringing this up. Both this project and official Gatsby benefited from it. |
I experience intermittently build errors. They do not appear to be related to CMS content changes or code changes, it just randomly, unfortunately frequently, fails.
The following changes did not improve or worsen the fail rate - I think
I removed netlify-plugin-gatsby-cache - #44
I removed gatsby-rehype-inline-images - #202
Clearing the cache before a deploy is not helping in my opinion.
The error is always something like this
...
11:17:15 AM: success run static queries - 0.204s - 16/16 78.48/s
11:17:18 AM: error [object Object] ENOENT: no such file or directory, unlink '/opt/build/repo/public/static/c79ed69a45dfa3eb3fa94442cc61454a/photo-1499479387933-4567e710809c.jpg'
11:17:18 AM:
11:17:18 AM:
11:17:18 AM: Error: ENOENT: no such file or directory, unlink '/opt/build/repo/public/stati c/c79ed69a45dfa3eb3fa94442cc61454a/photo-1499479387933-4567e710809c.jpg'
11:17:18 AM:
11:17:18 AM: not finished Generating image thumbnails - 13.367s
11:17:18 AM: not finished run page queries - 2.574s
...
11:17:18 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:17:18 AM: Finished saving boot dependencies
11:17:18 AM: Started saving go dependencies
11:17:18 AM: Finished saving go dependencies
11:17:18 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:17:18 AM: Failing build: Failed to build site
11:17:19 AM: Finished processing build request in 47.137682029s
The text was updated successfully, but these errors were encountered: