Skip to content

Fix Netlify builds for PRs - #5876

Merged
dylans merged 5 commits into
ianstormtaylor:mainfrom
12joan:fix/netlify-build-error
May 24, 2025
Merged

Fix Netlify builds for PRs#5876
dylans merged 5 commits into
ianstormtaylor:mainfrom
12joan:fix/netlify-build-error

Conversation

@12joan

@12joan 12joan commented May 18, 2025

Copy link
Copy Markdown
Contributor

Description
The Netlify build workflows have been failing for some time. The error message Command failed with exit code 129: yarn build might indicate a problem with memory usage; if so, this forum thread indicates that limiting the number of CPUs during the build might address the problem.

Full error message
8:18:01 PM:    Generating static pages (0/27) ...
8:18:27 PM: ​
8:18:27 PM: "build.command" failed                                        
8:18:27 PM: ────────────────────────────────────────────────────────────────
8:18:27 PM: ​
8:18:27 PM:   Error message
8:18:27 PM:   Command failed with exit code 129: yarn build (https://ntl.fyi/exit-code-129)
8:18:27 PM: ​
8:18:27 PM:   Error location
8:18:27 PM:   In Build command from Netlify app:
8:18:27 PM:   yarn build
8:18:27 PM: ​
8:18:27 PM:   Resolved config
8:18:27 PM:   build:
8:18:27 PM:     command: yarn build
8:18:27 PM:     commandOrigin: ui
8:18:27 PM:     environment:
8:18:27 PM:       - NODE_VERSION
8:18:27 PM:       - REVIEW_ID
8:18:27 PM:     publish: /opt/build/repo/site/out
8:18:27 PM:     publishOrigin: ui
8:18:28 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
8:18:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:18:28 PM: Failing build: Failed to build site
8:18:28 PM: Finished processing build request in 1m43.368s

Context
Prior attempts: #5785 (addressing linter errors), #5809 (addressing stale browserlist). I'm not sure which of these potential issues is the root cause, or if multiple of them are. Setting the CPU limit fixed the problem. 🎉

@changeset-bot

changeset-bot Bot commented May 18, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3dcf5fc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@12joan

12joan commented May 18, 2025

Copy link
Copy Markdown
Contributor Author

Success! 4/4 of builds with the fix succeeded, and 1/1 of builds without the fix failed.

@12joan 12joan changed the title Attempt to fix Netlify builds for PRs Fix Netlify builds for PRs May 18, 2025
@ahoisl

ahoisl commented May 20, 2025

Copy link
Copy Markdown
Contributor

Would be great to get this PR in, because all other PRs are essentially stuck because of the netlify build issue 👏
I guess, limiting to a single CPU does not hurt...

@12joan

12joan commented May 20, 2025

Copy link
Copy Markdown
Contributor Author

@dylans has been merging PRs despite this issue, so they're not stuck per se, but it would definitely be nice to get the green checkmark back on mergeable PRs. Having a reliable preview build will also help with reviewing and testing.

The config file is a JS file, so it should be possible to apply the limit only in Netlify if anyone can figure out the right environment variable to check. That can probably happen as a separate PR, though.

@dylans
dylans merged commit ffe3f8c into ianstormtaylor:main May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants