VuePress site build fails with a cryptic error

Hi there, Netlify community!

I am currently encountering a build error that I can’t seem to pin down a reason for. The site is built on VuePress, located here https://kuma.netlify.app, and I’m using a custom build command located in a netlify.toml file:

node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs

I’ve successfully built the site locally both directly with the command above, and with netlify build, but when deployed live, the build fails with the following log:

10:28:32 AM: Build ready to start
10:28:34 AM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
10:28:34 AM: build-image tag: v3.6.1
10:28:34 AM: buildbot version: df42d44cc6a0381cf657a671baf049c03981bafe
10:28:34 AM: Building without cache
10:28:34 AM: Starting to prepare the repo for build
10:28:35 AM: No cached dependencies found. Cloning fresh repo
10:28:35 AM: git clone https://github.com/kumahq/kuma-website
10:28:37 AM: Preparing Git Reference refs/heads/master
10:28:39 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs' versus 'vuepress build docs' in the Netlify UI
10:28:39 AM: Starting build script
10:28:39 AM: Installing dependencies
10:28:39 AM: Python version set to 2.7
10:28:40 AM: v12.18.0 is already installed.
10:28:41 AM: Now using node v12.18.0 (npm v6.14.4)
10:28:41 AM: Started restoring cached build plugins
10:28:41 AM: Finished restoring cached build plugins
10:28:41 AM: Attempting ruby version 2.7.1, read from environment
10:28:42 AM: Using ruby version 2.7.1
10:28:43 AM: Using PHP version 5.6
10:28:43 AM: Started restoring cached node modules
10:28:43 AM: Finished restoring cached node modules
10:28:43 AM: Started restoring cached yarn cache
10:28:43 AM: Finished restoring cached yarn cache
10:28:43 AM: Installing yarn at version 1.22.4
10:28:43 AM: Installing Yarn!
10:28:43 AM: > Downloading tarball...
10:28:43 AM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.U9xD7isIbx
10:28:43 AM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:28:43 AM:                                  Dload  Upload   Total   Spent    Left  Speed
10:28:43 AM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:28:43 AM: 100    80  100    80    0     0    386      0 --:--:-- --:--:-- --:--:--   388
10:28:43 AM: 100    93  100    93    0     0    193      0 --:--:-- --:--:-- --:--:--   193
10:28:44 AM: 100   625  100   625    0     0    833      0 --:--:-- --:--:-- --:--:--   833
10:28:44 AM:   0 1215k    0  9597    0     0  10056      0  0:02:03 --:--:--  0:02:03 10056
10:28:44 AM: 100 1215k  100 1215k    0     0  1053k      0  0:00:01  0:00:01 --:--:-- 6061k
10:28:44 AM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.U9xD7isIbx.asc
10:28:44 AM: 100    84  100    84    0     0    350      0 --:--:-- --:--:-- --:--:--   350
10:28:44 AM: 100    97  100    97    0     0    362      0 --:--:-- --:--:-- --:--:--   362
10:28:44 AM: 100   629  100   629    0     0   2105      0 --:--:-- --:--:-- --:--:--  2105
10:28:44 AM: 100  1028  100  1028    0     0   3267      0 --:--:-- --:--:-- --:--:--  3267
10:28:44 AM: > Verifying integrity...
10:28:44 AM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
10:28:44 AM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
10:28:44 AM: gpg: Note: This key has expired!
10:28:44 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
10:28:44 AM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
10:28:44 AM: > GPG signature looks good
10:28:44 AM: > Extracting to ~/.yarn...
10:28:44 AM: > Adding to $PATH...
10:28:45 AM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
10:28:45 AM: Installing NPM modules using Yarn version 1.22.4
10:28:46 AM: yarn install v1.22.4
10:28:46 AM: [1/4] Resolving packages...
10:28:46 AM: [2/4] Fetching packages...
10:28:59 AM: warning url-loader@1.1.2: Invalid bin field for "url-loader".
10:29:06 AM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
10:29:06 AM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
10:29:06 AM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
10:29:06 AM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
10:29:06 AM: [3/4] Linking dependencies...
10:29:06 AM: warning " > @babel/preset-env@7.12.7" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/helper-compilation-targets@7.12.5" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-async-generator-functions@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-class-properties@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-dynamic-import@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-export-namespace-from@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-json-strings@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-logical-assignment-operators@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-nullish-coalescing-operator@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-numeric-separator@7.12.7" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-object-rest-spread@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-optional-catch-binding@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-optional-chaining@7.12.7" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-private-methods@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-unicode-property-regex@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-async-generators@7.8.4" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-class-properties@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-dynamic-import@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-export-namespace-from@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-json-strings@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-logical-assignment-operators@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-nullish-coalescing-operator@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-numeric-separator@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-object-rest-spread@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-optional-catch-binding@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-optional-chaining@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-syntax-top-level-await@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-arrow-functions@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-async-to-generator@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-block-scoped-functions@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-block-scoping@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-classes@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-computed-properties@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-destructuring@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-dotall-regex@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-duplicate-keys@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-exponentiation-operator@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-for-of@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-function-name@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-literals@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-member-expression-literals@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-modules-amd@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-modules-commonjs@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-modules-systemjs@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-modules-umd@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-named-capturing-groups-regex@7.12.1" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-new-target@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-object-super@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-parameters@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-property-literals@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-regenerator@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-reserved-words@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-shorthand-properties@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-spread@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-sticky-regex@7.12.7" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-template-literals@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-typeof-symbol@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-unicode-escapes@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-transform-unicode-regex@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/preset-modules@0.1.4" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-class-properties > @babel/helper-create-class-features-plugin@7.12.1" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning "@babel/preset-env > @babel/plugin-proposal-unicode-property-regex > @babel/helper-create-regexp-features-plugin@7.12.7" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning " > @babel/plugin-transform-object-assign@7.12.1" has unmet peer dependency "@babel/core@^7.0.0-0".
10:29:06 AM: warning " > @vue/test-utils@1.1.1" has unmet peer dependency "vue-template-compiler@^2.x".
10:29:06 AM: warning " > vuepress-plugin-sitemap@2.3.1" has unmet peer dependency "chalk@^2.0.0".
10:29:06 AM: warning " > vuepress-plugin-sitemap@2.3.1" has unmet peer dependency "commander@^2.0.0".
10:29:06 AM: warning " > vuepress-plugin-sitemap@2.3.1" has unmet peer dependency "esm@^3.0.0".
10:29:06 AM: warning " > babel-jest@24.9.0" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning "babel-jest > babel-preset-jest@24.9.0" has unmet peer dependency "@babel/core@^7.0.0".
10:29:06 AM: warning " > raw-loader@3.1.0" has unmet peer dependency "webpack@^4.3.0".
10:29:06 AM: warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
10:29:06 AM: warning " > vue-jest@3.0.7" has unmet peer dependency "babel-core@^6.25.0 || ^7.0.0-0".
10:29:06 AM: warning " > vue-jest@3.0.7" has unmet peer dependency "vue-template-compiler@^2.x".
10:29:15 AM: [4/4] Building fresh packages...
10:29:19 AM: $ cd bin/kumacut && npm i
10:29:21 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!npm WARN kumacut@1.0.0 No repository field.
10:29:21 AM: added 53 packages from 18 contributors and audited 53 packages in 1.765s
10:29:21 AM: found 0 vulnerabilities
10:29:21 AM: Done in 35.65s.
10:29:21 AM: NPM modules installed using Yarn
10:29:22 AM: Started restoring cached go cache
10:29:22 AM: Finished restoring cached go cache
10:29:22 AM: go version go1.14.4 linux/amd64
10:29:22 AM: go version go1.14.4 linux/amd64
10:29:22 AM: Installing missing commands
10:29:22 AM: Verify run directory
10:29:24 AM: ​
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM:   Netlify Build                                                 
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM: ​
10:29:24 AM: ❯ Version
10:29:24 AM:   @netlify/build 9.1.3
10:29:24 AM: ​
10:29:24 AM: ❯ Flags
10:29:24 AM:   deployId: 6033cda002b82f56bee1ec55
10:29:24 AM:   mode: buildbot
10:29:24 AM: ​
10:29:24 AM: ❯ Current directory
10:29:24 AM:   /opt/build/repo
10:29:24 AM: ​
10:29:24 AM: ❯ Config file
10:29:24 AM:   /opt/build/repo/netlify.toml
10:29:24 AM: ​
10:29:24 AM: ❯ Context
10:29:24 AM:   production
10:29:24 AM: ​
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM:   1. build.command from netlify.toml                            
10:29:24 AM: ────────────────────────────────────────────────────────────────
10:29:24 AM: ​
10:29:24 AM: $ node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:29:24 AM: Netlify redirects created successfully!
10:29:24 AM: cURL version endpoint created!
10:29:25 AM: wait Extracting site metadata...
10:29:26 AM: tip Apply local theme at /opt/build/repo/docs/.vuepress/theme...
10:29:26 AM: tip Apply theme local ...
10:29:26 AM: tip Apply plugin container (i.e. "vuepress-plugin-container") ...
10:29:26 AM: tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
10:29:26 AM: tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
10:29:26 AM: tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
10:29:26 AM: tip Apply plugin clean-urls (i.e. "vuepress-plugin-clean-urls") ...
10:29:26 AM: tip Apply plugin seo (i.e. "vuepress-plugin-seo") ...
10:29:26 AM: tip Apply plugin @vuepress/google-analytics (i.e. "@vuepress/plugin-google-analytics") ...
10:29:26 AM: tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
10:29:26 AM: tip Apply plugin tabs (i.e. "vuepress-plugin-tabs") ...
10:29:26 AM: tip Apply plugin @vuepress/blog (i.e. "@vuepress/plugin-blog") ...
10:29:26 AM: tip Apply plugin sitemap (i.e. "vuepress-plugin-sitemap") ...
10:29:26 AM: tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
10:29:26 AM: tip Apply plugin reading-time (i.e. "vuepress-plugin-reading-time") ...
10:29:50 AM: [info] [webpackbar] Compiling Client
10:29:50 AM: [info] [webpackbar] Compiling Server
10:29:54 AM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/@vuepress/core/.temp/internal/routes.js as it exceeds the max of 500KB.
10:29:55 AM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/@vuepress/core/.temp/internal/routes.js as it exceeds the max of 500KB.
10:29:59 AM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/@vuepress/core/.temp/internal/siteData.js as it exceeds the max of 500KB.
10:30:02 AM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/node_modules/@vuepress/core/.temp/internal/siteData.js as it exceeds the max of 500KB.
10:33:49 AM: [success] [webpackbar] Server: Compiled successfully in 3.98m
10:35:59 AM: [success] [webpackbar] Client: Compiled successfully in 6.15m
10:36:01 AM: wait Rendering static HTML...
10:41:25 AM: bash: line 1:  1494 Killed                  node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:41:25 AM: ​
10:41:25 AM: ────────────────────────────────────────────────────────────────
10:41:25 AM:   "build.command" failed                                        
10:41:25 AM: ────────────────────────────────────────────────────────────────
10:41:25 AM: ​
10:41:25 AM:   Error message
10:41:25 AM:   Command failed with exit code 137: node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:41:25 AM: ​
10:41:25 AM:   Error location
10:41:25 AM:   In build.command from netlify.toml:
10:41:25 AM:   node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:41:25 AM: ​
10:41:25 AM:   Resolved config
10:41:25 AM:   build:
10:41:25 AM:     command: node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:41:25 AM:     commandOrigin: config
10:41:25 AM:     environment:
10:41:25 AM:       - PARDOT_COMMUNITY_CALL_URI_PROD
10:41:25 AM:       - PARDOT_NEWSLETTER_URI_PROD
10:41:25 AM:       - PARDOT_URI_ROOT
10:41:25 AM:     functions: /opt/build/repo/functions
10:41:25 AM:     publish: /opt/build/repo/docs/.vuepress/dist
10:41:25 AM: Caching artifacts
10:41:25 AM: Started saving node modules
10:41:25 AM: Finished saving node modules
10:41:25 AM: Started saving build plugins
10:41:25 AM: Finished saving build plugins
10:41:25 AM: Started saving yarn cache
10:41:25 AM: Finished saving yarn cache
10:41:25 AM: Started saving pip cache
10:41:26 AM: Finished saving pip cache
10:41:26 AM: Started saving emacs cask dependencies
10:41:26 AM: Finished saving emacs cask dependencies
10:41:26 AM: Started saving maven dependencies
10:41:26 AM: Finished saving maven dependencies
10:41:26 AM: Started saving boot dependencies
10:41:26 AM: Finished saving boot dependencies
10:41:26 AM: Started saving rust rustup cache
10:41:26 AM: Finished saving rust rustup cache
10:41:26 AM: Started saving go dependencies
10:41:26 AM: Finished saving go dependencies
10:41:29 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:41:29 AM: Failing build: Failed to build site
10:41:29 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:41:29 AM: Finished processing build request in 12m54.921794221s

The site is a VuePress docs and product site that has become quite large. Because of this I’ve resorted to the aforementioned custom build command where I boost Node’s RAM with --max_old_space_size=8192. This has worked without any issues. The site even deployed and built successfully 3 days ago with no changes other than a single line in a markdown file.

To give some more insight, there was another recent build that failed that contained this error:

3:53:25 PM: Execution timed out after 16m53.207225642s
3:53:25 PM: Error running command: Command did not finish within the time limit
3:53:25 PM: Failing build: Failed to build site
3:53:25 PM: Failed during stage 'building site': Command did not finish within the time limit
3:53:25 PM: Finished processing build request in 17m24.983571004s

This lead me to think maybe the build time limit needed to be increased to 30 minutes instead of 15 (I saw this mentioned in another thread), but this most recent log doesn’t mention anything about a time limit and instead gives some vague (to me) errors that I haven’t been able to find clear explanations for.

To recap, the site builds flawlessly locally (in ~8 minutes with netlify build), but fails when trying to deploy live.

Thanks in advance!

Well, after doing another build with some slight cleanup and testing the addition of CI='' to the build command, I am seeing this 15 minute build time limit error again:

Error running command: Command did not finish within the time limit

So I’m guessing simply increasing that to 30 minutes will do the trick.

As an aside, my local build takes 6-8 minutes on average, which is more than half of what it takes in production. I’m wondering why one is so much longer than the other.

I can’t explain why, but our site seems to be deploying without a hitch now. Perhaps a fluke in Netlify’s deploybot or something? Another dev launched a change to production and the site built flawlessly (in ~16 minutes). Strange.

Hey there!

Our build time limit is set to 15 minutes. Your build duration is very close to this duration so, depending on resources and what’s being built, sometimes it’ll pass, sometimes not.

As discussed in the ticket, I’ve bumped this to 30 minutes. Do let me know if this helps!

It’ll also take less time locally than prod because of the resources available :slight_smile:.

1 Like

Thank you, @Pie! The build time increase will help but I think there is something else going on that I can’t seem to pin down.

When I try to build the site, all of my deployments fail. If 2 of my fellow devs deploy the site, it finishes without any errors. One of our devs was even able to deploy my own changes successfully. I’ve tried redeploying with the cache cleared but still run into an error.

Here is the truncated error for reference:

10:35:22 AM: wait Rendering static HTML...
10:44:10 AM: bash: line 1:  1410 Killed                  node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:44:10 AM: ​
10:44:10 AM: ────────────────────────────────────────────────────────────────
10:44:10 AM:   "build.command" failed                                        
10:44:10 AM: ────────────────────────────────────────────────────────────────
10:44:10 AM: ​
10:44:10 AM:   Error message
10:44:10 AM:   Command failed with exit code 137: node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:44:10 AM: ​
10:44:10 AM:   Error location
10:44:10 AM:   In build.command from netlify.toml:
10:44:10 AM:   node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:44:10 AM: ​
10:44:10 AM:   Resolved config
10:44:10 AM:   build:
10:44:10 AM:     command: node ./bin/setup-redirects && node ./bin/curl-endpoints && node --max_old_space_size=8192 ./node_modules/vuepress/cli.js build docs
10:44:10 AM:     commandOrigin: config
10:44:10 AM:     environment:
10:44:10 AM:       - PARDOT_COMMUNITY_CALL_URI_PROD
10:44:10 AM:       - PARDOT_NEWSLETTER_URI_PROD
10:44:10 AM:       - PARDOT_URI_ROOT
10:44:10 AM:     functions: /opt/build/repo/functions
10:44:10 AM:     publish: /opt/build/repo/docs/.vuepress/dist
10:44:10 AM: Caching artifacts
10:44:10 AM: Started saving node modules
10:44:10 AM: Finished saving node modules
10:44:10 AM: Started saving build plugins
10:44:10 AM: Finished saving build plugins
10:44:10 AM: Started saving yarn cache
10:44:10 AM: Finished saving yarn cache
10:44:10 AM: Started saving pip cache
10:44:10 AM: Finished saving pip cache
10:44:10 AM: Started saving emacs cask dependencies
10:44:10 AM: Finished saving emacs cask dependencies
10:44:10 AM: Started saving maven dependencies
10:44:10 AM: Finished saving maven dependencies
10:44:10 AM: Started saving boot dependencies
10:44:10 AM: Finished saving boot dependencies
10:44:10 AM: Started saving rust rustup cache
10:44:10 AM: Finished saving rust rustup cache
10:44:10 AM: Started saving go dependencies
10:44:10 AM: Finished saving go dependencies
10:44:10 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:44:10 AM: Failing build: Failed to build site
10:44:10 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:44:10 AM: Finished processing build request in 16m41.90507939s

I can build the site locally without issue with both netlify-cli and my build script.

Is it possible there’s a permission issue at play here? Either on GitHub or Netlify. I’m not really sure what could be causing the error and I’m having a hard time tracking down exactly what Build script returned non-zero exit code: 2 means.

I finally resolved this issue (I hope)

If you encounter this yourself, there is a simple solution (at least for me).

  1. Log into Netlify
  2. Click on your user icon in the top right corner
  3. Under “Connected accounts”, click “Edit settings” and click the “X” next to your GitHub account to remove it
  4. Now reconnect your GitHub account and try to redeploy

I discovered this when I noticed that the summary for my failed deployments was not showing my GitHub username.

Example of a summary on a failed deployment:

Production: master@1ebe13f. Today at 11:14 AM

Example of a summary on a fresh successful deployment:

Production: master@e166943. By @bloqhead on GitHub. Today at 5:08 PM

Netlify was disassociating my deployments from my account and I think this is what caused them to fail halfway through. Reconnecting my GitHub account seemed to do the trick. Why this would happen is beyond me. There is absolutely nothing anywhere in the logs that alludes to this being a permission issue (that I can find anyway, and I did a bunch of searching).

TL;DR

Disconnect and reconnect your GitHub account from your Netlify account.

I stand corrected. Now the error continues to occur regardless. I am trying this solution but I am not optimistic. This issue has been plaguing me going on week 2 now. I can’t reproduce it at all, except by deploying to Netlify itself.

Edit: this did not fix it.

Things I’ve tried

  • cleaning up a handful of peer dependency warnings
  • increasing memory used by node from 8192 to 12048 (both of which are already ridiculous, but what I have learned is that VuePress is GROSSLY inefficient)
  • added CI='' to the front of my build script in netlify.toml (per these docs)

For anyone that arrives here with VuePress woes, let me try to ease your pain

TL;DR - Keep your VuePress site small!

If you’re starting with VuePress v2 (which uses Webpack 5), you will (hopefully) have a better time, since the newer version of Webpack is supposed to build faster and be more efficient.

VuePress 1.x is inefficient with file handling and if you have a VuePress website with any sort of versioning mechanism, try to keep the amount of versions on your site to a reasonable number. In an effort to make the site smaller and to make it easier to navigate, we’ve removed all 0.x doc versions and are striving to keep only release versions there. This approach has made our site successfully deploy again, as well as build faster and generally run faster

Here are some stats as a reference:

  • Before optimization: 15-20 minute build times, ~1,300 build files generated
  • After optimization: 5-6 minute build times, ~500-600 build files generated

We were even able to completely remove the Node max_old_space_size flag, which we initially had set to 4096 and then to 8192. The site builds successfully and is faster to work with for everyone on our team.

In my logs above, you’ll see a 137 error. This generally relates to memory allocation issues. If you run into that, try to reduce the size of your VuePress site and the amount of files it has to generate.

Another thing that would be really valuable, but VuePress seems to be lacking, are incremental builds. Having to rebuild the entire site each time for small changes is a huge waste of resources and can eat up build time minutes on your Netlify account.

@bloqhead ,

thank you so much for continuing to work on this and keeping us informed of your progress! we super appreciate it - and i am sure others will too!