Hello support team!
We’re unable to deploy our lamdba functions to our site. I know it last successfully worked on Feb 15, 2024. Since last week, when we started testing some updates, we’ve been getting the error “unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest” on the feature branch. To verify it wasn’t due to any of our changes, we tried a new deployment from our main
branch with the same commit that worked successfully in February and it also failed with the same error.
I’ve gone through all of the support guides, the Build troubleshooting tips, searched the support forums and the internet, and I haven’t found the exact same error message. Other similar messages have seemed to not been related or had a fix that was unrelated to our code/stack. On another feature/test branch, I tried updating our package.json
files to use netlify-cli
instead of netlify-lambda
, as well as adding all of our dependencies to the root package.json
. I also added a .node-version
file to the feature branch to match the Node version that I’m using on my laptop, with no change (but the log did indicate that it correctly identified and downloaded the correct version).
The only thing that seems to work is if we remove or rename our .json
files (besides package.json
and package-lock.json
) located in our functions directories. We’d prefer not to do that, as that seems more like a messy workaround, at least without knowing or understanding why we can’t have .json
files.
I did try the Ask Netlify AI, but it didn’t give me much guidance except that it might have something to do with a manifest.json
file. We don’t have one unless we run netlify build
, then one is generated in .netlify\functions\manifest.json
. I’m not sure if netlify deploy
(or any other deployment type) generates one and if it’s different.
Deploy URL: Netlify
Deploy ID: 670ed8d760fb346e93946b91
Context: Production: main@HEAD
Deployment Type: Netlify UI (but I’ve also been testing feature branch deployments through Netlify CLI so I don’t need to keep committing for an automatic deployment)
Last Broken Deploy URL: Netlify
Last Successful Deploy URL: Netlify
The build logs follow. These are from the main
(Production) branch that was the same commit as the last successful deployment.
5:04:41 PM: build-image version: ecdc8b770f4a0193fd3f258c1bc6029e681813a4 (focal)
5:04:41 PM: buildbot version: c1ccefdee611eab5836a599df80d16b6e08180cb
5:04:41 PM: Fetching cached dependencies
5:04:41 PM: Failed to fetch cache, continuing with build
5:04:41 PM: Starting to prepare the repo for build
5:04:42 PM: No cached dependencies found. Cloning fresh repo
5:04:42 PM: git clone --filter=blob:none git@gitlab.com:te-curriculum/curriculum-utility-projects/te-curriculum-apis
5:04:43 PM: Preparing Git Reference refs/heads/main
5:04:47 PM: Starting to install dependencies
5:04:47 PM: Python version set to 3.8
5:04:47 PM: Attempting Ruby version 2.7.2, read from environment
5:04:48 PM: Using Ruby version 2.7.2
5:04:49 PM: Started restoring cached go cache
5:04:49 PM: Finished restoring cached go cache
5:04:49 PM: Installing Go version 1.17 (requested 1.17)
5:04:55 PM: go version go1.17 linux/amd64
5:04:56 PM: Using PHP version 8.0
5:04:58 PM: Downloading and installing node v20.18.0…
5:04:59 PM: Downloading https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-x64.tar.xz…
5:04:59 PM: Computing checksum with sha256sum
5:04:59 PM: Checksums matched!
5:05:03 PM: Now using node v20.18.0 (npm v10.8.2)
5:05:03 PM: Enabling Node.js Corepack
5:05:03 PM: Started restoring cached build plugins
5:05:03 PM: Finished restoring cached build plugins
5:05:03 PM: Started restoring cached corepack dependencies
5:05:03 PM: Finished restoring cached corepack dependencies
5:05:03 PM: No npm workspaces detected
5:05:03 PM: Started restoring cached node modules
5:05:03 PM: Finished restoring cached node modules
5:05:03 PM: Installing npm packages using npm version 10.8.2
5:05:04 PM: added 12 packages, and audited 13 packages in 976ms
5:05:04 PM: 1 package is looking for funding
5:05:04 PM: run npm fund
for details
5:05:04 PM: 1 high severity vulnerability
5:05:04 PM: To address all issues, run:
5:05:04 PM: npm audit fix --force
5:05:04 PM: Run npm audit
for details.
5:05:04 PM: npm packages installed
5:05:05 PM: Successfully installed dependencies
5:05:05 PM: Starting build script
5:05:07 PM: Detected 0 framework(s)
5:05:07 PM: Section completed: initializing
5:05:09 PM:
5:05:09 PM: Netlify Build
5:05:09 PM: ────────────────────────────────────────────────────────────────
5:05:09 PM:
5:05:09 PM: ❯ Version
5:05:09 PM: @netlify/build 29.55.2
5:05:09 PM:
5:05:09 PM: ❯ Flags
5:05:09 PM: accountId: 5eee703d2e59e4b356d0006c
5:05:09 PM: baseRelDir: true
5:05:09 PM: buildId: 670ed8d760fb346e93946b8f
5:05:09 PM: deployId: 670ed8d760fb346e93946b91
5:05:09 PM:
5:05:09 PM: ❯ Current directory
5:05:09 PM: /opt/build/repo
5:05:09 PM:
5:05:09 PM: ❯ Config file
5:05:09 PM: /opt/build/repo/netlify.toml
5:05:09 PM:
5:05:09 PM: ❯ Context
5:05:09 PM: production
5:05:11 PM: Installing functions dependencies
5:05:28 PM:
5:05:28 PM: Functions bundling
5:05:28 PM: ────────────────────────────────────────────────────────────────
5:05:28 PM:
5:05:28 PM: Packaging Functions from api-functions directory:
5:05:28 PM: - books/books.js
5:05:28 PM: - celestial-objects/celestial-objects.js
5:05:28 PM: - facts/facts.js
5:05:28 PM: - movies/movies.js
5:05:28 PM: - national-park-exercise/national-park-exercise.js
5:05:28 PM: - pictures/pictures.js
5:05:28 PM: - statetax/statetax.js
5:05:28 PM: - weather/weather.js
5:05:28 PM:
5:05:31 PM:
5:05:31 PM: (Functions bundling completed in 3s)
5:05:31 PM:
5:05:31 PM: Deploy site
5:05:31 PM: ────────────────────────────────────────────────────────────────
5:05:31 PM:
5:05:32 PM: Starting to deploy site from ‘/’
5:05:34 PM: Calculating files to upload
5:05:45 PM: unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest
5:05:45 PM: unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest
5:05:45 PM: unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest
5:05:45 PM: unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest
5:05:45 PM: unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest
5:05:45 PM: 1 new file(s) to upload
5:05:45 PM: 6 new function(s) to upload
5:05:45 PM: Failed to upload file: pictures
5:05:45 PM: Failed to upload file: celestial-objects
5:05:45 PM: Failed to upload file: facts
5:05:45 PM: Failed to upload file: books
5:05:45 PM: Failed to upload file: movies
5:05:52 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
5:05:52 PM: Section completed: deploying
5:05:52 PM:
5:05:52 PM: Error deploying
5:05:52 PM: ────────────────────────────────────────────────────────────────
5:05:52 PM:
5:05:52 PM: Error message
5:05:52 PM: Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default &{Code:400 Message:unable to decode manifest file: json: cannot unmarshal array into Go value of type handler.functionManifest}
5:05:52 PM:
5:05:52 PM: Error location
5:05:52 PM: At deploy the stage with HTTP status code ‘400’
5:05:52 PM:
5:05:52 PM: Resolved config
5:05:52 PM: build:
5:05:52 PM: publish: /opt/build/repo
5:05:52 PM: publishOrigin: config
5:05:52 PM: functionsDirectory: /opt/build/repo/api-functions
5:05:52 PM: headers:
5:05:52 PM: - for: /*
values:
Access-Control-Allow-Origin: '’
headersOrigin: config
plugins:
- inputs: {}
origin: config
package: ‘@netlify/plugin-functions-install-core’
redirects:
- from: /api/cats//random
5:05:52 PM: status: 200
5:05:52 PM: to: /.netlify/functions/:splat
5:05:52 PM: - from: /books-api/books/*
status: 301
to: /api/books/:splat
- from: /books-api/authors/*
status: 301
to: /api/books/authors/:splat
- from: /books-api/genres/*
status: 301
to: /api/books/genres/:splat
- from: /movies-api/movies/*
status: 301
to: /api/movies/:splat
- from: /movies-api/genres/*
status: 301
to: /api/movies/genres/:splat
- from: /celestial-objects-api/celestial-objects/*
status: 301
to: /api/celestial-objects/:splat
- from: /celestial-objects-api/categories/*
status: 301
to: /api/celestial-objects/categories/:splat
- from: /api/national-park-exercise/verify/*
status: 308
to: /api/national-park-exercise/challenges/:splat/verify
- from: /api/*
status: 200
to: /.netlify/functions/:splat
redirectsOrigin: config
5:05:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:05:52 PM: Failing build: Failed to build site
5:05:52 PM: Finished processing build request in 1m11.436s