dfx2
February 15, 2024, 10:47am
1
Hello, I have a failure message when I add content to my site in Gitub:
Build failed due to a user error: Build script returned non-zero exit code: 2
Could you please help me.
It is :
Deploys from GitHub - Dfx579/bluise withNuxt.
dspk.netlify.app
Netlify subdomain
Deploy Previews
deploy-preview-123–dspk.netlify.app
Branch Deployers
branch-name–dspk.netlify.app
Set up Branch Deploys in Build & Deploy settings
THANKS.
@dfx2 Can you provide the full build log?
The message Build failed due to a user error: Build script returned non-zero exit code: 2
is the result, it’s not the error itself.
I also note that repository is quite old, 5 years old for much of it, the node version for example is set to 12.13.1
dfx2
February 15, 2024, 2:42pm
3
Thank you for your Nathanmartin,
This is a site that I deployed yesterday, here is the log:
dspk: Production: master@74b7cb4 Failed
By Dfx579: Update la-croix.json
Today at 10:24 AM
Build details
dspk: Production: master@81ff3d2 Failed
By Dfx579: Update la-croix.json
Yesterday at 5:29 PM
Build details
dspk: Production: master@c8b7bdb Failed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 5:27 PM
Build details
dspk: Production: master@9fb0fe3 Failed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 5:24 PM
Build details
dspk: Production: master@1b9a748 Failed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 5:23 PM
Build details
dspk: Production: master@HEAD Failed
Failed during stage 'building site': Build script returned non-zero exit code: 2
Yesterday at 5:22 PM
Build details
dspk: Production: master@df890c5 Failed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 4:58 PM
Build details
dspk: Production: master@e6194e6 Failed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 4:56 PM
Build details
dspk: Production: master@5fa51e5 Completed
By Dfx579: Update meditation-pop-up-forage.json
Yesterday at 4:50 PM
Deployed in 54s
Build details
dspk: Production: master@c49d3c1 Completed
penser: Production: main@7b39902 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:58 PM
Build details
penser: Production: main@443c326 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:50 PM
Build details
penser: Production: main@0498532 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:44 PM
Build details
penser: Production: main@ef88389 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:40 PM
penser: Production: main@dba4805 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:37 PM
Build details
penser: Production: main@aa35ec9 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:35 PM
Build details
penser: Production: main@5e59d2b Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:33 PM
Build details
penser: Production: main@7bb360f Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:23 PM
Build details
penser: Production: main@3a49a34 Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:12 PM
Build details
penser: Production: main@5b3358f Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:05 PM
Build details
penser: Production: main@165427c Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:03 PM
Build details
penser: Production: main@8f2c42a Failed
By Dfx579: Update hello-world.mdx
Yesterday at 3:01 PM
Build details
penser: Production: main@336b902 Completed
By Dfx579: Update hello-world.mdx
Yesterday at 2:55 PM
Deployed in 1m 11s
Build details
penser: Production: main@d0e8d53 Completed
By Dfx579: Add files via upload
Yesterday at 2:53 PM
Deployed in 1m 14s
Build details
penser: Production: main@32d5813 Completed
By Dfx579: Update hello-world.mdx
Yesterday at 2:38 PM
Deployed in 1m 18s
Build details
penser: Production: main@ebb26ab Completed
By Dfx579: Update hello-world.mdx
Feb 13 at 6:28 PM
Deployed in 1m 16s
Build details
penser: Production: main@2026d30 Completed
By Dfx579: Update hello-world.mdx
Feb 13 at 6:13 PM
Deployed in 1m 14s
Build details
penser: Production: main@62bed72 Completed
By Dfx579: Update another-post-in-the-wall.mdx
Feb 13 at 6:09 PM
Deployed in 1m 12s
Build details
penser: Production: main@HEAD Completed
No deploy message
Feb 13 at 5:12 PM
Deployed in 1m 29s
3:18:35 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
3:18:35 PM: buildbot version: f395ea5f6f06715665ef60980f5ca024c32ca3b9
3:18:35 PM: Fetching cached dependencies
3:18:35 PM: Starting to download cache of 244.9MB
3:18:38 PM: Finished downloading cache in 2.511s
3:18:38 PM: Starting to extract cache
3:18:44 PM: Finished extracting cache in 6.322s
3:18:44 PM: Finished fetching cache in 8.893s
3:18:44 PM: Starting to prepare the repo for build
3:18:44 PM: Preparing Git Reference refs/heads/master
3:18:46 PM: Starting to install dependencies
3:18:46 PM: Python version set to 3.8
3:18:46 PM: Attempting Ruby version 2.7.2, read from environment
3:18:47 PM: Using Ruby version 2.7.2
3:18:47 PM: Started restoring cached go cache
3:18:47 PM: Finished restoring cached go cache
3:18:49 PM: go version go1.19.13 linux/amd64
3:18:49 PM: Using PHP version 8.0
3:18:50 PM: Started restoring cached Node.js version
3:18:51 PM: Finished restoring cached Node.js version
3:18:51 PM: Attempting Node.js version “12.13.1” from .nvmrc
3:18:52 PM: v12.13.1 is already installed.
3:18:52 PM: Now using node v12.13.1 (npm v6.12.1)
3:18:52 PM: Started restoring cached build plugins
3:18:52 PM: Finished restoring cached build plugins
3:18:52 PM: Started restoring cached corepack dependencies
3:18:52 PM: Finished restoring cached corepack dependencies
3:18:52 PM: Started restoring cached yarn cache
3:18:52 PM: Finished restoring cached yarn cache
3:18:52 PM: No yarn workspaces detected
3:18:52 PM: Started restoring cached node modules
3:18:52 PM: Finished restoring cached node modules
3:18:52 PM: Installing npm packages using Yarn version 1.22.19
3:18:53 PM: yarn install v1.22.19
3:18:53 PM: [1/4] Resolving packages…
3:18:53 PM: success Already up-to-date.
3:18:53 PM: Done in 0.49s.
3:18:53 PM: npm packages installed using Yarn
3:18:53 PM: Successfully installed dependencies
3:18:53 PM: Starting build script
3:18:54 PM: Detected 1 framework(s)
3:18:54 PM: “nuxt” at version “2.13.3”
3:18:54 PM: Section completed: initializing
3:18:56 PM:
3:18:56 PM: Netlify Build
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: ❯ Version
3:18:56 PM: @netlify /build 29.35.1
3:18:56 PM:
3:18:56 PM: ❯ Flags
3:18:56 PM: baseRelDir: true
3:18:56 PM: buildId: 65ce6373b4ffcc295455ff67
3:18:56 PM: deployId: 65ce6373b4ffcc295455ff69
3:18:56 PM:
3:18:56 PM: ❯ Current directory
3:18:56 PM: /opt/build/repo
3:18:56 PM:
3:18:56 PM: ❯ Config file
3:18:56 PM: /opt/build/repo/netlify.toml
3:18:56 PM:
3:18:56 PM: ❯ Context
3:18:56 PM: production
3:18:56 PM:
3:18:56 PM: build.command from netlify.toml
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: $ yarn generate
3:18:56 PM: yarn run v1.22.19
3:18:56 PM: $ nuxt-ts generate
3:18:56 PM: [fatal] /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: SyntaxError: app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: at JSON.parse ()
3:18:56 PM: at Object.Module._extensions…json (internal/modules/cjs/loader.js:1009:27)
3:18:56 PM: at Generator.next ()
3:18:56 PM: tput: No value for $TERM and no -T specified
3:18:56 PM:
3:18:56 PM: ╭──────────────────────────────────────────────────────────────────────────────────╮
3:18:56 PM: │ │
3:18:56 PM: │ Nuxt Fatal Error │
3:18:56 PM: │ │
3:18:56 PM: │ SyntaxError: /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: │
3:18:56 PM: │ Unexpected string in JSON at position 157 │
3:18:56 PM: │ │
3:18:56 PM: ╰──────────────────────────────────────────────────────────────────────────────────╯
3:18:56 PM:
3:18:56 PM: error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums )
3:18:56 PM: info Visit yarn run | Yarn for documentation about this command.
3:18:56 PM:
3:18:56 PM: “build.command” failed
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: Error message
3:18:56 PM: Command failed with exit code 1: yarn generate (Search results for '"non-zero exit code: 1"' - Netlify Support Forums )
3:18:56 PM:
3:18:56 PM: Error location
3:18:56 PM: In build.command from netlify.toml:
3:18:56 PM: yarn generate
3:18:56 PM:
3:18:56 PM: Resolved config
3:18:56 PM: build:
3:18:56 PM: command: yarn generate
3:18:56 PM: commandOrigin: config
3:18:56 PM: publish: /opt/build/repo/dist
3:18:56 PM: publishOrigin: config
3:18:57 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:18:57 PM: Failing build: Failed to build site
3:18:57 PM: Finished processing build request in 21.689s
3:18:57 PM: Failed during stage “building site”: Build script returned non-zero exit code: 2
3:18:56 PM: Netlify Build
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: ❯ Version
3:18:56 PM: @netlify/build 29.35.1
3:18:56 PM:
3:18:56 PM: ❯ Flags
3:18:56 PM: baseRelDir: true
3:18:56 PM: buildId: 65ce6373b4ffcc295455ff67
3:18:56 PM: deployId: 65ce6373b4ffcc295455ff69
3:18:56 PM:
3:18:56 PM: ❯ Current directory
3:18:56 PM: /opt/build/repo
3:18:56 PM:
3:18:56 PM: ❯ Config file
3:18:56 PM: /opt/build/repo/netlify.toml
3:18:56 PM:
3:18:56 PM: ❯ Context
3:18:56 PM: production
3:18:56 PM:
3:18:56 PM: build.command from netlify.toml
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: $ yarn generate
3:18:56 PM: yarn run v1.22.19
3:18:56 PM: $ nuxt-ts generate
3:18:56 PM: [fatal] /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: SyntaxError: app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: at JSON.parse (<anonymous>)
3:18:56 PM: at Object.Module._extensions..json (internal/modules/cjs/loader.js:1009:27)
3:18:56 PM: at Generator.next (<anonymous>)
3:18:56 PM: tput: No value for $TERM and no -T specified
3:18:56 PM:
3:18:56 PM: ╭──────────────────────────────────────────────────────────────────────────────────╮
3:18:56 PM: │ │
3:18:56 PM: │ ✖ Nuxt Fatal Error │
3:18:56 PM: │ │
3:18:56 PM: │ SyntaxError: /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: │
3:18:56 PM: │ Unexpected string in JSON at position 157 │
3:18:56 PM: │ │
3:18:56 PM: ╰──────────────────────────────────────────────────────────────────────────────────╯
3:18:56 PM:
3:18:56 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
3:18:56 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
3:18:56 PM:
3:18:56 PM: "build.command" failed
3:18:56 PM: ────────────────────────────────────────────────────────────────
3:18:56 PM:
3:18:56 PM: Error message
3:18:56 PM: Command failed with exit code 1: yarn generate (https://ntl.fyi/exit-code-1)
3:18:56 PM:
3:18:56 PM: Error location
3:18:56 PM: In build.command from netlify.toml:
3:18:56 PM: yarn generate
3:18:56 PM:
3:18:56 PM: Resolved config
3:18:56 PM: build:
3:18:56 PM: command: yarn generate
3:18:56 PM: commandOrigin: config
3:18:56 PM: publish: /opt/build/repo/dist
3:18:56 PM: publishOrigin: config
3:18:57 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:18:57 PM: Failing build: Failed to build site
3:18:57 PM: Finished processing build request in 21.689s
3:18:57 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
````Preformatted text`
@dfx2 This isn’t a Netlify specific error, if you had run your build locally you almost certainly would encounter the same.
The root error is mentioned three times in that log:
3:18:56 PM: [fatal] /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: SyntaxError: app/content/blog/meditation-pop-up-forage.json: Unexpected string in JSON at position 157
3:18:56 PM: │ Nuxt Fatal Error │
3:18:56 PM: │ │
3:18:56 PM: │ SyntaxError: /opt/build/repo/app/content/blog/meditation-pop-up-forage.json: │
3:18:56 PM: │ Unexpected string in JSON at position 157 │
My guess is you’ve edited the /app/content/blog/meditation-pop-up-forage.json
file and broken the syntax at position 157
.
You’ll need to fix that json file as your build depends on it.
dfx2
February 16, 2024, 8:02pm
5
Thank you for your response Nathanmartin,
My site is only in Gitub and netlifly.
I discover the tools.
I think when trying to add text and images, this syntax error
has arrived.
The problem is that I don’t know what position 157 is.
The things I wanted to test was adding text and an image.
I got the image displayed on the site, but no change for the texts that
I tried to insert.
I don’t know what this syntax error is in position 57.
Here’s what I tried to change:
Update meditation-pop-up-forage.json
{
"title": "After the Stock Market, you have a life!"
"publishedAt": "14th Feb 2024"
"content": "Everything you should know about jj"
"featuredImage": "/images/uploads/youtube_banniere 1.png"
}```
But the changes are not displayed?
How to do it please?
Thanks for your patience.
@dfx2 If there are other entries in the file and you look closely you should spot the error easily.
What you have isn’t valid JSON, you’re missing commas.
You want:
{
"title": "After the Stock Market, you have a life!",
"publishedAt": "14th Feb 2024",
"content": "Everything you should know about jj",
"featuredImage": "/images/uploads/youtube_banniere 1.png"
}
If you don’t know how to use anything more technical you could always just copy and paste your JSON into an online validator which will point out the error.
For example https://jsonlint.com shows:
Making the change I’ve said you need, it shows that it’s valid:
dfx2
February 17, 2024, 2:18pm
7
WhaOOU ! Thank you that changes everything!
On the other hand, I tried to insert an image in the content with , image, url and ![… I couldn’t find anything else, it didn’t work.
Where can I find the instructions to be able to underline text, make it bold. Is it possible ?
This will help me greatly, thanks in advance.
dfx2
February 17, 2024, 9:42pm
9
Thanks Hrishikesh,
It’s very well documented, which will allow me to better understand what I need to do.
I discovered this tool and I appreciate the openings that are offered to me.
Thanks again.