Issue Description:
Our Netlify production builds are failing consistently with an ENOSPC error during the Essential Gatsby plugin’s post-build cache copy step. The Gatsby build completes successfully (~55-56 minutes), but the deploy fails when the plugin tries to copy the public folder to the build cache.
**Error Details:
**
Plugin “@netlify/plugin-gatsby” internal error
CpyError: Cannot copy from public/... to /opt/build/cache/cwd/public/...:
Cannot create directory: ENOSPC: no space left on device, mkdir ‘…’
Error location: In “onPostBuild” event in “@netlify/plugin-gatsby”
Build Configuration:
-
Node.js: 14.21.3
-
Gatsby: 4.25.7
-
@netlify/plugin-gatsby: 3.3.0 (auto-installed, not manually configured)
-
Build time: 55-56 minutes for full build, 10-15 minutes for incremental
-
Site type: Gatsby 4 with WordPress data source, Elasticsearch, Algolia
-
Build command:
yarn buildwith GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true
Troubleshooting Attempted:
-
Cleared build cache multiple times
-
Confirmed only one build runs at a time (no concurrent builds)
-
Upgraded Node to 14.21.3 (from 14.17.0)
-
Added SHARP_IGNORE_GLOBAL_LIBVIPS=1 to resolve earlier sharp compilation issue
Current Workaround:
We’ve disabled the Essential Gatsby plugin with NETLIFY_SKIP_GATSBY_BUILD_PLUGIN=true to allow builds to complete without cache, but this means slower subsequent builds.
Questions:
-
What is the current disk space limit for build caches on Netlify during the post-build phase?
-
Are there known issues with the plugin’s cache copy behavior on large Gatsby sites?
-
Is there a recommended way to handle builds with large public folders (our site generates thousands of static pages)?
Any guidance would be appreciated.