Site is building but not deploying (Error: Deploy did not succeed: Failed to execute deploy: [PUT /sites/{site_id}/deploys/{deploy_id}][500] updateSiteDeploy default &{Code:0 Message:} )

Site is https://davidrhoden.com, or https://davidrhoden-basic.netlify.app. It’s built in eleventy.

The site builds ok…

7:17:50 AM: Benchmark (Configuration): "url" Nunjucks Filter took 68527ms (38.7%, called 5532550×, 0.0ms each)
7:17:50 AM: Copied 2592 files / Wrote 2022 files in 176.73 seconds (87.4ms each, v0.12.1)
7:17:50 AM: ​
7:17:50 AM: (build.command completed in 2m 57.6s)

…but it fails in the deployment step. This has been going on for more than a day. The site builds fine on my local machine. I haven’t seen this error before. I can’t tell from these error messages what’s happening. Anyone know?


7:18:15 AM: ​
7:18:15 AM: ────────────────────────────────────────────────────────────────
7:18:15 AM:   Internal error during "Deploy site"                           
7:18:15 AM: ────────────────────────────────────────────────────────────────
7:18:15 AM: ​
7:18:15 AM:   Error message
7:18:15 AM:   Error: Deploy did not succeed: Failed to execute deploy: [PUT /sites/{site_id}/deploys/{deploy_id}][500] updateSiteDeploy default  &{Code:0 Message:}
7:18:15 AM: ​
7:18:15 AM:   Error location
7:18:15 AM:   During Deploy site
7:18:15 AM:       at handleDeployError (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins_core/deploy/buildbot_client.js:87:18)
7:18:15 AM:       at deploySiteWithBuildbotClient (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins_core/deploy/buildbot_client.js:68:12)
7:18:15 AM:       at processTicksAndRejections (node:internal/process/task_queues:96:5)
7:18:15 AM:       at async coreStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins_core/deploy/index.js:45:5)
7:18:15 AM:       at async fireCoreStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/core_step.js:39:9)
7:18:15 AM:       at async tFireStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/time/main.js:20:59)
7:18:15 AM:       at async runStep (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/run_step.js:88:7)
7:18:15 AM:       at async pReduce.index (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/run_steps.js:91:11)
7:18:15 AM:       at async runSteps (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/steps/run_steps.js:51:7)
7:18:15 AM:       at async runBuild (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/core/main.js:610:7)
7:18:15 AM: ​
7:18:15 AM:   Resolved config
7:18:15 AM:   build:
7:18:15 AM:     command: eleventy
7:18:15 AM:     commandOrigin: config
7:18:15 AM:     environment:
7:18:15 AM:       - NETLIFY_LFS_ORIGIN_URL
7:18:15 AM:       - NODE_VERSION
7:18:15 AM:       - NODE_OPTIONS
7:18:15 AM:     publish: /opt/build/repo/_site
7:18:15 AM:     publishOrigin: config
7:18:16 AM: Caching artifacts
7:18:16 AM: Started saving node modules
7:18:16 AM: Finished saving node modules
7:18:16 AM: Started saving build plugins
7:18:16 AM: Finished saving build plugins
7:18:16 AM: Started saving pip cache
7:18:16 AM: Finished saving pip cache
7:18:16 AM: Started saving emacs cask dependencies
7:18:16 AM: Finished saving emacs cask dependencies
7:18:16 AM: Started saving maven dependencies
7:18:16 AM: Finished saving maven dependencies
7:18:16 AM: Started saving boot dependencies
7:18:16 AM: Finished saving boot dependencies
7:18:16 AM: Started saving rust rustup cache
7:18:16 AM: Finished saving rust rustup cache
7:18:16 AM: Started saving go dependencies
7:18:30 AM: Finished saving go dependencies
7:18:30 AM: Build failed due to an internal system error: Build script returned non-zero exit code: 4
7:18:31 AM: Failing build: Failed to build site
7:18:31 AM: Finished processing build request in 4m20.003969854s

Is there a limit to the number of posts I’m allowed?

Now it’s saying Command was killed with SIGKILL (Forced termination): eleventy…I didn’t shut it down. Anyway to find out what caused the forced termination?

9:06:50 PM: Writing _site/tags/taglist/index.html from ./tags.njk.
9:06:51 PM: ​
9:06:51 PM: ────────────────────────────────────────────────────────────────
9:06:51 PM:   "build.command" failed                                        
9:06:51 PM: ────────────────────────────────────────────────────────────────
9:06:51 PM: ​
9:06:51 PM:   Error message
9:06:51 PM:   Command was killed with SIGKILL (Forced termination): eleventy
9:06:51 PM: ​
9:06:51 PM:   Error location
9:06:51 PM:   In build.command from netlify.toml:
9:06:51 PM:   eleventy
9:06:51 PM: ​
9:06:51 PM:   Resolved config
9:06:51 PM:   build:
9:06:51 PM:     command: eleventy
9:06:51 PM:     commandOrigin: config
9:06:51 PM:     environment:
9:06:51 PM:       - NETLIFY_LFS_ORIGIN_URL
9:06:51 PM:       - NODE_VERSION
9:06:51 PM:       - NODE_OPTIONS
9:06:51 PM:     publish: /opt/build/repo/_site
9:06:51 PM:     publishOrigin: config
9:06:52 PM: Caching artifacts
9:06:52 PM: Started saving node modules
9:06:52 PM: Finished saving node modules
9:06:52 PM: Started saving build plugins
9:06:52 PM: Finished saving build plugins
9:06:52 PM: Started saving pip cache
9:06:52 PM: Finished saving pip cache
9:06:52 PM: Started saving emacs cask dependencies
9:06:52 PM: Finished saving emacs cask dependencies
9:06:52 PM: Started saving maven dependencies
9:06:52 PM: Finished saving maven dependencies
9:06:52 PM: Started saving boot dependencies
9:06:52 PM: Finished saving boot dependencies
9:06:52 PM: Started saving rust rustup cache
9:06:52 PM: Finished saving rust rustup cache
9:06:52 PM: Started saving go dependencies
9:06:52 PM: Finished saving go dependencies
9:06:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:06:53 PM: Failing build: Failed to build site
9:06:54 PM: Finished processing build request in 3m47.266773088s

This is what’s in netlify.toml:

[build]
  publish = "_site"
  command = "eleventy"

[build.environment]
  NODE_VERSION="16.5.0"
  NODE_OPTIONS="--max-old-space-size=8192"

I’m going to remove it and see if it changes anything.

Would it make sense/be possible to just build the site locally and add the _site directory to the repo and deploy that way?

I turned on debugging for my deploy logs and I have more information. Here’s where it starts to get interesting. Looks like I’m out of memory; what can I do about it?

8:41:49 AM: Writing _site/tags/mardi-gras/index.html from ./tags.njk.
8:41:50 AM: Writing _site/timeline/53/index.html from ./pages/timeline.md.
8:41:50 AM: Writing _site/tags/hangman/index.html from ./tags.njk.
8:42:07 AM: <--- Last few GCs --->
8:42:07 AM: [1535:0x4ca33f0]   201944 ms: Scavenge (reduce) 2045.8 (2082.9) -> 2044.9 (2082.9) MB, 2.2 / 0.0 ms  (average mu = 0.089, current mu = 0.001) allocation failure
8:42:07 AM: [1535:0x4ca33f0]   205122 ms: Mark-sweep (reduce) 2046.0 (2083.2) -> 2044.6 (2083.2) MB, 3173.6 / 0.0 ms  (average mu = 0.052, current mu = 0.016) allocation failure scavenge might not succeed
8:42:07 AM: <--- JS stacktrace --->
8:42:07 AM: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
8:42:07 AM:  1: 0xb09980 node::Abort() [node]
8:42:07 AM:  2: 0xa1c235 node::FatalError(char const*, char const*) [node]
8:42:07 AM:  3: 0xcf77be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
8:42:07 AM:  4: 0xcf7b37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
8:42:07 AM:  5: 0xeaf3d5  [node]
8:42:07 AM:  6: 0xeafeb6  [node]
8:42:07 AM:  7: 0xebe3de  [node]
8:42:07 AM:  8: 0xebee20 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8:42:07 AM:  9: 0xec1d9e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
8:42:07 AM: 10: 0xe832da v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
8:42:07 AM: 11: 0x11fc026 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
8:42:07 AM: 12: 0x15f0a99  [node]
8:42:08 AM: ​
8:42:08 AM: ────────────────────────────────────────────────────────────────
8:42:08 AM:   "build.command" failed                                        
8:42:08 AM: ────────────────────────────────────────────────────────────────
8:42:08 AM: ​
8:42:08 AM:   Error message
8:42:08 AM:   Command was killed with SIGABRT (Aborted): eleventy
8:42:08 AM: ​
8:42:08 AM:   Error location
8:42:08 AM:   In build.command from netlify.toml:
8:42:08 AM:   eleventy
8:42:08 AM: ​
8:42:08 AM:   Resolved config
8:42:08 AM:   build:
8:42:08 AM:     command: eleventy
8:42:08 AM:     commandOrigin: config
8:42:08 AM:     environment:
8:42:08 AM:       - NETLIFY_BUILD_DEBUG
8:42:08 AM:       - NETLIFY_LFS_ORIGIN_URL
8:42:08 AM:       - NODE_VERSION
8:42:08 AM:     publish: /opt/build/repo/_site
8:42:08 AM:     publishOrigin: config
8:42:08 AM:   plugins:
8:42:08 AM:     - inputs: {}
8:42:08 AM:       origin: config
8:42:08 AM:       package: '@netlify/plugin-sitemap'
8:42:08 AM: Caching artifacts
8:42:08 AM: Started saving node modules
8:42:08 AM: Finished saving node modules
8:42:08 AM: Started saving build plugins
8:42:08 AM: Finished saving build plugins
8:42:08 AM: Started saving pip cache
8:42:09 AM: Finished saving pip cache
8:42:09 AM: Started saving emacs cask dependencies
8:42:09 AM: Finished saving emacs cask dependencies
8:42:09 AM: Started saving maven dependencies
8:42:09 AM: Finished saving maven dependencies
8:42:09 AM: Started saving boot dependencies
8:42:09 AM: Finished saving boot dependencies
8:42:09 AM: Started saving rust rustup cache
8:42:09 AM: Finished saving rust rustup cache
8:42:09 AM: Started saving go dependencies
8:42:10 AM: Finished saving go dependencies
8:42:16 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:42:16 AM: Creating deploy upload records
8:42:16 AM: Failing build: Failed to build site
8:42:16 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
8:42:16 AM: Finished processing build request in 4m33.329709676s

hi there, sorry to be slow to reply but i am excited to see you did a lot of great debugging work!

now for the less than great news - there are some things we can tweak with regards to builds (longer build timeouts, more bandwidth, more longer function timeout, etc) but memory is not one of them.

Here is a guide that might be helpful, though:

Thanks for the resources. I do notice it is replacing all or a lot of the files on every build.

 * **1936 new files uploaded**
1934 generated pages and 2 assets changed.

I thought that was just an irritating Eleventy thing that can’t be avoided, but the docs indicate that’s a user error. Maybe I can make it stop doing that with help from other Eleventy users.

Another thing it is doing is hanging while the admin page is building. (It does this on my local server as well, but not long enough to stop the build:

12:22:53 PM: [11ty] Writing _site/admin/index.html from ./admin/index.html (njk)
12:32:10 PM: <--- Last few GCs --->

Notice the ten-minutes between starting the page build before the whole thing stops.
I could live without the admin page if it would speed the builds.

This seems like it’s my fault (or my Eleventy boilerplate’s fault), not Netlify’s, so I’m not expecting further help but I am going to document the steps I’m taking here in case it helps someone in the future. (I will accept help if offered, of course!)

Should I be doing more about fixing these broken dependencies? Shouldn’t that happen automatically?

1:31:29 PM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
1:31:29 PM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
1:31:29 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
1:31:29 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
1:31:30 PM: npm WARN deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
1:31:30 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
1:31:30 PM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
1:31:30 PM: npm WARN deprecated statsd-client@0.4.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
1:31:30 PM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
1:31:32 PM: npm WARN deprecated node-pre-gyp@0.13.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
1:31:36 PM: npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
1:31:36 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
1:31:37 PM: npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
1:31:50 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
1:32:01 PM: added 2507 packages, and audited 2508 packages in 49s

Am I missing a step? npm audit fix --force doesn’t do anything.

Hey @davidrhoden,

Those dependency stuff should not really matter. I don’t see how that would help. You probably don’t even need npm audit.

I got some help from another eleventy user on the eleventy Discord. I removed most or all instances of the
| url
filter used in eleventy and it seems to have sped my builds up about 10x. So, not Netlify’s problem, I don’t think. Just posting here in case other eleventy users have a similar problem and find this thread.

2 Likes