Netlify build cache error

Site: glistening-eclair-de7f24

Hi there, I’ve started seeing the following error when this 11ty site tries to build. Hasn’t happened any time before and nothing should have changed with the general process.

Any advice would be greatly appreciated.

Build log:

5:31:33 PM: Build ready to start
5:31:41 PM: build-image version: aca5d7abf366658bb56784d0f9f8c345c0e42069 (focal)
5:31:41 PM: build-image tag: v4.14.2
5:31:41 PM: buildbot version: 18474a3c060f9c065d3b41c342523ee658b5a0c0
5:31:42 PM: Fetching cached dependencies
5:31:42 PM: Starting to download cache of 1.3GB
5:31:57 PM: Finished downloading cache in 15.551999076s
5:31:57 PM: Starting to extract cache
5:32:00 PM: Finished extracting cache in 2.777779947s
5:32:00 PM: Finished fetching cache in 18.43776213s
5:32:00 PM: Starting to prepare the repo for build
5:32:01 PM: Preparing Git Reference refs/heads/develop
5:32:11 PM: Parsing package.json dependencies
5:32:12 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'frontend/dist' versus 'dist/' in the Netlify UI
5:32:12 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npm run build:staging' versus 'npm run build:prod' in the Netlify UI
5:32:12 PM: Starting build script
5:32:12 PM: Installing dependencies
5:32:12 PM: Python version set to 2.7
5:32:12 PM: Started restoring cached node version
5:32:13 PM: Finished restoring cached node version
5:32:13 PM: Attempting node version 'lts/*' from .nvmrc
5:32:14 PM: Downloading and installing node v18.12.0...
5:32:14 PM: Downloading https://nodejs.org/dist/v18.12.0/node-v18.12.0-linux-x64.tar.xz...
5:32:14 PM: Computing checksum with sha256sum
5:32:14 PM: Checksums matched!
5:32:16 PM: Now using node v18.12.0 (npm v8.19.2)
5:32:16 PM: Enabling node corepack
5:32:16 PM: Started restoring cached build plugins
5:32:16 PM: Finished restoring cached build plugins
5:32:17 PM: Attempting ruby version 2.7.2, read from environment
5:32:17 PM: Using ruby version 2.7.2
5:32:17 PM: Using PHP version 8.0
5:32:18 PM: No npm workspaces detected
5:32:18 PM: Started restoring cached node modules
5:32:18 PM: Finished restoring cached node modules
5:32:18 PM: Installing NPM modules using NPM version 8.19.2
5:32:19 PM: added 1 package, and audited 545 packages in 647ms
5:32:19 PM: 59 packages are looking for funding
5:32:19 PM:   run `npm fund` for details
5:32:19 PM: found 0 vulnerabilities
5:32:19 PM: NPM modules installed
5:32:19 PM: Creating package sha
5:32:19 PM: Started restoring cached go cache
5:32:19 PM: Finished restoring cached go cache
5:32:19 PM: Installing Go version 1.17 (requested 1.17)
5:32:23 PM: unset GOOS;
5:32:23 PM: unset GOARCH;
5:32:23 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
5:32:23 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
5:32:23 PM: go version >&2;
5:32:23 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
5:32:23 PM: go version go1.17 linux/amd64
5:32:23 PM: Installing missing commands
5:32:23 PM: Verify run directory
5:32:25 PM: ​
5:32:25 PM: ────────────────────────────────────────────────────────────────
5:32:25 PM:   Netlify Build                                                 
5:32:25 PM: ────────────────────────────────────────────────────────────────
5:32:25 PM: ​
5:32:25 PM: ❯ Version
5:32:25 PM:   @netlify/build 28.1.3
5:32:25 PM: ​
5:32:25 PM: ❯ Flags
5:32:25 PM:   baseRelDir: true
5:32:25 PM:   buildId: 635960e55a6032000a19f9f5
5:32:25 PM:   deployId: 635960e55a6032000a19f9f7
5:32:25 PM: ​
5:32:25 PM: ❯ Current directory
5:32:25 PM:   /opt/build/repo/frontend
5:32:25 PM: ​
5:32:25 PM: ❯ Config file
5:32:25 PM:   /opt/build/repo/netlify.toml
5:32:25 PM: ​
5:32:25 PM: ❯ Context
5:32:25 PM:   branch-deploy
5:32:25 PM: ​
5:32:25 PM: ❯ Loading plugins
5:32:25 PM:    - netlify-plugin-cache@1.0.3 from netlify.toml and package.json
5:32:26 PM: Uncaught exception, the process will now terminate…
5:32:26 PM: Error: Unable to deserialize cloned data due to invalid or unsupported version.
5:32:26 PM:     at parseChannelMessages (node:internal/child_process/serialization:97:20)
5:32:26 PM:     at parseChannelMessages.next (<anonymous>)
5:32:26 PM:     at Pipe.channel.onread (node:internal/child_process:619:18)
5:32:26 PM: Caching artifacts
5:32:26 PM: Started saving node modules
5:32:26 PM: Finished saving node modules
5:32:26 PM: Started saving build plugins
5:32:26 PM: Finished saving build plugins
5:32:26 PM: Started saving pip cache
5:32:26 PM: Finished saving pip cache
5:32:26 PM: Started saving emacs cask dependencies
5:32:26 PM: Finished saving emacs cask dependencies
5:32:26 PM: Started saving maven dependencies
5:32:26 PM: Finished saving maven dependencies
5:32:26 PM: Started saving boot dependencies
5:32:26 PM: Finished saving boot dependencies
5:32:26 PM: Started saving rust rustup cache
5:32:26 PM: Finished saving rust rustup cache
5:32:26 PM: Started saving go dependencies
5:32:26 PM: Finished saving go dependencies
5:32:30 PM: Build was terminated: Build script returned non-zero exit code: 1
5:32:30 PM: Creating deploy upload records
5:32:30 PM: Failing build: Failed to build site
5:32:30 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
5:32:30 PM: Finished processing build request in 48.937591236s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

Hey Hillary, thanks for your reply.

This problem appears to be resolved by removing netlify-plugin-cache from the netlify.toml file, but obviously build times increase exponentially if i do this.

Do I need to contact the developer of the plugin? I feel like it could be a conflict with the npm package and the latest netlify build image?

Here is my package.json file:

{
	"name": "rabb11ty",
	"version": "1.0.0",
	"description": "",
	"keywords": [],
	"author": "Rabbithole",
	"license": "ISC",
	"browserslist": "> 0.5%, last 2 versions, not dead",
	"scripts": {
		"serve:dev": "ELEVENTY_ENV=development npx @11ty/eleventy --serve",
		"build:dev": "ELEVENTY_ENV=development npx @11ty/eleventy",
		"build:staging": "ELEVENTY_ENV=staging npx @11ty/eleventy",
		"build:prod": "ELEVENTY_ENV=production npx @11ty/eleventy",
		"clean": "rm -rf dist && rm -rf .cache"
	},
	"devDependencies": {
		"@11ty/eleventy": "^1.0.1",
		"@11ty/eleventy-cache-assets": "^2.3.0",
		"@11ty/eleventy-img": "^2.0.1",
		"dotenv": "^16.0.1",
		"esbuild": "^0.14.49",
		"esbuild-plugin-glob": "^2.1.0",
		"esbuild-sass-plugin": "^2.3.0",
		"html-minifier": "^4.0.0",
		"luxon": "^3.0.1",
		"md5": "^2.3.0",
		"netlify-plugin-cache": "^1.0.3",
		"postcss-hash": "^3.0.0",
		"sass": "^1.53.0",
		"stylelint": "^14.9.1",
		"stylelint-config-prettier": "^9.0.3",
		"stylelint-config-standard-scss": "^5.0.0",
		"stylelint-scss": "^4.3.0"
	},
	"dependencies": {
		"@vimeo/player": "^2.17.1",
		"axios": "^0.27.2",
		"flickity": "^3.0.0",
		"flickity-fade": "^2.0.0",
		"gsap": "^3.11.3"
	}
}

and netlify.toml (before removing netlify-plugin-cache):

[build]
  # Directory to change to before starting a build.
  # This is where we will look for package.json/.nvmrc/etc.
  # If not set, defaults to the root directory.
  base = "frontend/"

  # Directory that contains the deploy-ready HTML files and
  # assets generated by the build. This is relative to the base
  # directory if one has been set, or the root directory if
  # a base has not been set. This sample publishes the directory
  # located at the absolute path "root/project/build-output"

  publish = "dist/"

  # Default build command.
  command = "npm run build:prod"

[build.environment]
    NODE_OPTIONS = "–max_old_space_size=4096"

[context.develop] # develop is a branch name
  command = "npm run build:staging"

[[plugins]]
package = "netlify-plugin-cache"

  [plugins.inputs]
  paths = [
    "frontend/dist/images",
    "frontend/.cache",
    ".cache" # Remote Asset Cache
  ]

Sorry, just to provide some additional content. The local build of this site takes this long when using cached images: [11ty] Copied 10 files / Wrote 351 files in 1.97 seconds (5.6ms each, v1.0.1)

Whereas the Netlify build is taking: [11ty] Copied 10 files / Wrote 478 files in 1275.92 seconds (2669.3ms each, v1.0.1)

As you can see it’d be really great to have the caching plugin working.

Apologies for replying to myself, but I get the same error when trying to use a different caching plugin: netlify-plugin-11ty … So I’m pretty confused.

netlify-plugin-11ty@1.1.0 from netlify.toml and package.json
8:01:11 AM: Uncaught exception, the process will now terminate…
8:01:11 AM: Error: Unable to deserialize cloned data due to invalid or unsupported version

This was after trying to run the build with a cleared cache.

1 Like

Eeep looks like a node vesion issue… Using lts/* in our .nvmrc file was downloading Node 18.12.0 assumed this must have changed fairly recently. Locally, lts/* was still using 16.14.0.

Changing the .nvmrc file to be explicit seems to have fixed the issue.

Just in case anyone comes up against this.

Thank you so much for letting us know! Glad you are unblocked now. Happy building :rocket:

Re: Netlify build cache error - #4 by jrh

Heyo!

I’m the author of netlify-plugin-11ty and stumbled here while trying to fix the same bug for my website.

I have added a note about this build fail, the fix, and a link to this post in the repo.

I’ve also set the max node version to 16.x.x in package.json, so a warning should be generated and Netlify builds should fail with this better error message now:

12:27:30 PM:   Configuration error                                           
12:27:30 PM: ─────────────────────
12:27:30 PM: ​
12:27:30 PM:   Error message
12:27:30 PM:   The Node.js version is 19.1.0 but the plugin "netlify-plugin-11ty" requires >=12.18.0 <17.0.0

Thank you so much for the post and the fix!!

1 Like

No worries @zeroby0! Happy to help. Thanks for your help over email recently.

Not sure if you got my last reply on the 3rd of November? Possibly went to your spam folder.

We’re still having the odd issue with 11ty image cache randomly having to totally rebuild itself :frowning:

2 Likes