No more pages are deployed - exit code: 2

Hello,

our Strapi pages are no longer deployed.
First I get this error:
Error enqueueing build. Build pavload exceeded limit of 140 KB. Please make sure environment variables and/or webhook body don’t exceed this size

Second I get this error:
Failed during stage ‘building site’: Build script returned non-zero exit code: 2


What I’ve done so far:
I changed build settings to: Build command: CI= npm run build
and Environment variables: Key: CI Value: false


package.json
{
“name”: “gatsby-starter-tailwind”,
“description”: “Gatsby starter styled with Tailwind”,
“version”: “4.0.0”,
“author”: “Taylor Bryant taylor@bryant.io”,
“dependencies”: {
@mdx-js/mdx”: “^1.6.22”,
@mdx-js/react”: “^1.6.22”,
@tailwindcss/typography”: “^0.4.1”,
“gatsby”: “^3.8.0”,
“gatsby-image”: “^3.10.0”,
“gatsby-plugin-anchor-links”: “^1.2.0”,
“gatsby-plugin-manifest”: “3.10.0”,
“gatsby-plugin-mdx”: “^2.10.0”,
“gatsby-plugin-netlify”: “^3.10.0”,
“gatsby-plugin-offline”: “4.10.0”,
“gatsby-plugin-postcss”: “4.10.0”,
“gatsby-plugin-react-helmet”: “4.10.0”,
“gatsby-plugin-react-svg”: “^3.0.0”,
“gatsby-plugin-sass”: “^4.10.0”,
“gatsby-plugin-scroll-reveal”: “0.0.7”,
“gatsby-plugin-sharp”: “^3.10.2”,
“gatsby-source-filesystem”: “^3.10.0”,
“gatsby-source-strapi”: “^1.0.2”,
“gatsby-source-wordpress”: “^5.0.0”,
“gatsby-transformer-remark”: “^4.7.0”,
“gatsby-transformer-sharp”: “^3.10.0”,
“gsap”: “^3.5.1”,
“node-sass”: “^6.0.1”,
“prop-types”: “15.7.2”,
“react”: “17.0.2”,
“react-dom”: “17.0.2”,
“react-headroom”: “^3.1.0”,
“react-helmet”: “6.1.0”,
“react-markdown”: “^6.0.2”,
“remark”: “^13.0.0”,
“remark-html”: “^13.0.1”,
“remark-preset-lint-recommended”: “^5.0.0”,
“typeface-prata”: “1.1.13”,
“typeface-yantramanav”: “1.1.13”
},


In the Deploy log I find this error:
WebpackError: TypeError: Cannot read property ‘localFile’ of null

failed Building static HTML for pages - 5.605s
8:38:11 PM: error Building static HTML failed for path “/transfer”
8:38:11 PM:
8:38:11 PM: 107 | <Img
8:38:11 PM: 108 | fluid={
8:38:11 PM: > 109 | node.VorschaubildSaeule.localFile.childImageSharp?.fluid
8:38:11 PM: | ^
8:38:11 PM: 110 | }
8:38:11 PM: 111 | className=“h-full”
8:38:11 PM: 112 | >
8:38:11 PM:
8:38:11 PM: WebpackError: TypeError: Cannot read property ‘localFile’ of null

And this error: Command failed with exit code 1: yarn build
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
8:38:11 PM: at process.target.send (internal/child_process.js:679:16)
8:38:11 PM: at onResult (/opt/build/repo/node_modules/gatsby-worker/dist/child.js:38:5)
8:38:11 PM: Emitted ‘error’ event on process instance at:
8:38:11 PM: at processEmit (/opt/build/repo/node_modules/signal-exit/index.js:161:32)
8:38:11 PM: at process.emit (/opt/build/repo/node_modules/@turist/fetch/dist/sourcemap-register.js:926:21)
8:38:11 PM: at internal/child_process.js:683:35
8:38:11 PM: at processTicksAndRejections (internal/process/task_queues.js:79:11) {
8:38:11 PM: code: ‘ERR_IPC_CHANNEL_CLOSED’
8:38:11 PM: }
8:38:11 PM: ​
8:38:11 PM:
8:38:11 PM: “build.command” failed
8:38:11 PM:
8:38:11 PM: ​
8:38:11 PM: Error message
8:38:11 PM: Command failed with exit code 1: yarn build
8:38:11 PM: ​
8:38:11 PM: Error location
8:38:11 PM: In build.command from netlify.toml:
8:38:11 PM: yarn build
8:38:11 PM: ​
8:38:11 PM: Resolved config
8:38:11 PM: build:
8:38:11 PM: command: yarn build
8:38:11 PM: commandOrigin: config
8:38:11 PM: environment:
8:38:11 PM: - CI
8:38:11 PM: - ONEGRAPH_AUTHLIFY_TOKEN
8:38:11 PM: publish: /opt/build/repo/public
8:38:11 PM: publishOrigin: config
8:38:11 PM: headers:
8:38:11 PM: - for: /*


The end of the log:
8:38:28 PM: Finished saving boot dependencies

8:38:28 PM: Started saving rust rustup cache

8:38:28 PM: Finished saving rust rustup cache

8:38:28 PM: Started saving go dependencies

8:38:28 PM: Finished saving go dependencies

8:38:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2

8:38:28 PM: Creating deploy upload records

8:38:28 PM: Failing build: Failed to build site

8:38:28 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2

8:38:28 PM: Finished processing build request in 3m5.860158228s


I have a yarn.lock file.


This is the netlify.toml
[build]
command = “yarn build”
publish = “public/”


No changes were made to the source code in Github. Changes were always made via Strapi. I have already spent many hours trying to find the error. I am happy about every hint.

Hey @Samu,

The error says exactly what’s wrong. You need to configure Strapi to not send so much data in the webhook body.

About the other error, it would be useful if you can send us the deploy link.

Thank you for your reply. I will check strapi.

Here is the deploy link: Netlify App

About the deploy log, I was hoping to see anything extra in there that could have pointed out at the cause of the error. Sadly, that’s not the case. Only the part you’ve shown here is relevant. In that case, this appears to be an error with the code or the way the project is setup. You might want to try logging out node.VorschaubildSaeule to see why it returns null.

2 Likes

The syntax of the node.VorschaubildSaeule was the problem. I removed this part from the source code. Now the deployment works well. Very odd. Actually I need these code lines to display some images.
But the deployment of changes is for me more important than to display some images.

Thank you for the hint.

1 Like