Exit code 255 & non-zero exit code: 2

Site Name: antoniopano.netlify.app.
GitHub Repository: GitHub - ap3340/NetlifyAntonio
Tried creating an Environmental variable with key = “CI” & value = “false” but didn’t fix issue.

11:57:15 PM: Build ready to start
11:57:16 PM: build-image version: 9289b698a503f132b265bd089ab40ce1d6f9e65e (focal)
11:57:16 PM: build-image tag: v4.12.0
11:57:16 PM: buildbot version: 2510ae842d7cc96532da2c05a74ba836f3e7f056
11:57:16 PM: Fetching cached dependencies
11:57:16 PM: Failed to fetch cache, continuing with build
11:57:16 PM: Starting to prepare the repo for build
11:57:17 PM: No cached dependencies found. Cloning fresh repo
11:57:17 PM: git clone GitHub - ap3340/NetlifyAntonio
11:57:17 PM: Preparing Git Reference refs/heads/master
11:57:18 PM: Parsing package.json dependencies
11:57:18 PM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘hugo --gc --minify -b $URL’ versus ‘npm run build’ in the Netlify UI
11:57:19 PM: Starting build script
11:57:19 PM: Installing dependencies
11:57:19 PM: Python version set to 2.7
11:57:19 PM: Downloading and installing node v16.18.0…
11:57:19 PM: Downloading https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz
11:57:19 PM: Computing checksum with sha256sum
11:57:19 PM: Checksums matched!
11:57:21 PM: Now using node v16.18.0 (npm v8.19.2)
11:57:21 PM: Started restoring cached build plugins
11:57:21 PM: Finished restoring cached build plugins
11:57:21 PM: Attempting ruby version 2.7.2, read from environment
11:57:22 PM: Using ruby version 2.7.2
11:57:22 PM: Using PHP version 8.0
11:57:22 PM: Installing Hugo 0.81.0
11:57:23 PM: hugo v0.81.0-59D15C97+extended linux/amd64 BuildDate=2021-02-19T17:07:12Z VendorInfo=gohugoio
11:57:23 PM: Started restoring cached go cache
11:57:23 PM: Finished restoring cached go cache
11:57:23 PM: Installing Go version 1.17 (requested 1.17)
11:57:27 PM: unset GOOS;
11:57:27 PM: unset GOARCH;
11:57:27 PM: export GOROOT=‘/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
11:57:27 PM: export PATH=“/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
11:57:27 PM: go version >&2;
11:57:27 PM: export GIMME_ENV=“/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
11:57:27 PM: go version go1.17 linux/amd64
11:57:27 PM: Installing missing commands
11:57:27 PM: Verify run directory
11:57:28 PM: ​
11:57:28 PM: ────────────────────────────────────────────────────────────────
11:57:28 PM: Netlify Build
11:57:28 PM: ────────────────────────────────────────────────────────────────
11:57:28 PM: ​
11:57:28 PM: ❯ Version
11:57:28 PM: @netlify/build 27.20.6
11:57:28 PM: ​
11:57:28 PM: ❯ Flags
11:57:28 PM: baseRelDir: true
11:57:28 PM: buildId: 634b811b735def2a0636e2a4
11:57:28 PM: deployId: 634b811b735def2a0636e2a6
11:57:28 PM: ​
11:57:28 PM: ❯ Current directory
11:57:28 PM: /opt/build/repo
11:57:28 PM: ​
11:57:28 PM: ❯ Config file
11:57:28 PM: /opt/build/repo/netlify.toml
11:57:28 PM: ​
11:57:28 PM: ❯ Context
11:57:28 PM: production
11:57:28 PM: ​
11:57:28 PM: ❯ Installing plugins
11:57:28 PM: - netlify-plugin-hugo-cache-resources@0.2.1
11:57:29 PM: ​
11:57:29 PM: ❯ Loading plugins
11:57:29 PM: - netlify-plugin-hugo-cache-resources@0.2.1 from netlify.toml
11:57:30 PM: ​
11:57:30 PM: ────────────────────────────────────────────────────────────────
11:57:30 PM: 1. netlify-plugin-hugo-cache-resources (onPreBuild event)
11:57:30 PM: ────────────────────────────────────────────────────────────────
11:57:30 PM: ​
11:57:30 PM: Checking if resources exist at “resources”
11:57:30 PM: No cache found for resources folder
11:57:30 PM: ​
11:57:30 PM: (netlify-plugin-hugo-cache-resources onPreBuild completed in 7ms)
11:57:30 PM: ​
11:57:30 PM: ────────────────────────────────────────────────────────────────
11:57:30 PM: 2. build.command from netlify.toml
11:57:30 PM: ────────────────────────────────────────────────────────────────
11:57:30 PM: ​
11:57:30 PM: $ hugo --gc --minify -b $URL
11:57:32 PM: hugo: collected modules in 1355 ms
11:57:32 PM: Start building sites …
11:57:32 PM: Total in 2166 ms
11:57:33 PM: Error: Error building site: failed to render pages: render of “home” failed: execute of template failed: template: index.html:21:5: executing “main” at <partial “widget_page.html” .>: error calling partial: execute of template failed: template: partials/widget_page.html:134:9: executing “partials/widget_page.html” at <partial $widget_path $widget_args>: error calling partial: “/opt/build/cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/wowchemy/wowchemy-hugo-modules/wowchemy@v0.0.0-20210516101231-84e462a5a149/layouts/partials/widgets/experience.html:49:25”: execute of template failed: template: partials/widgets/experience.html:49:25: executing “partials/widgets/experience.html” at <.date_start>: can’t evaluate field Format in type *errors.errorString

11:57:33 PM: ────────────────────────────────────────────────────────────────
11:57:33 PM: “build.command” failed
11:57:33 PM: ────────────────────────────────────────────────────────────────
11:57:33 PM: ​
11:57:33 PM: Error message
11:57:33 PM: Command failed with exit code 255: hugo --gc --minify -b $URL (Search results for '"non-zero exit code: 255"' - Netlify Support Forums)
11:57:33 PM: ​
11:57:33 PM: Error location
11:57:33 PM: In build.command from netlify.toml:
11:57:33 PM: hugo --gc --minify -b $URL
11:57:33 PM: ​
11:57:33 PM: Resolved config
11:57:33 PM: build:
11:57:33 PM: command: hugo --gc --minify -b $URL
11:57:33 PM: commandOrigin: config
11:57:33 PM: environment:
11:57:33 PM: - CI
11:57:33 PM: - HUGO_VERSION
11:57:33 PM: - HUGO_ENABLEGITINFO
11:57:33 PM: - HUGO_ENV
11:57:33 PM: publish: /opt/build/repo/public
11:57:33 PM: publishOrigin: config
11:57:33 PM: plugins:
11:57:33 PM: - inputs:
11:57:33 PM: debug: true
11:57:33 PM: origin: config
11:57:33 PM: package: netlify-plugin-hugo-cache-resources
11:57:33 PM: Caching artifacts
11:57:33 PM: Started saving build plugins
11:57:33 PM: Finished saving build plugins
11:57:33 PM: Started saving pip cache
11:57:33 PM: Finished saving pip cache
11:57:33 PM: Started saving emacs cask dependencies
11:57:33 PM: Finished saving emacs cask dependencies
11:57:33 PM: Started saving maven dependencies
11:57:33 PM: Finished saving maven dependencies
11:57:33 PM: Started saving boot dependencies
11:57:33 PM: Finished saving boot dependencies
11:57:33 PM: Started saving rust rustup cache
11:57:33 PM: Finished saving rust rustup cache
11:57:33 PM: Started saving go dependencies
11:57:33 PM: Finished saving go dependencies
11:57:34 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:57:34 PM: Creating deploy upload records
11:57:34 PM: Failing build: Failed to build site
11:57:34 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)
11:57:34 PM: Finished processing build request in 17.771624761s

Hey, I meet the same issue yesterday. May I know if you solve it? Thank you!

Hi @ap3340

Are you still facing the same issue?

@Byranlee can you post the deploy log and link to the repository you are deploying from?

To me that looks like a problem with the theme. Do you think you can clear cache and deploy?

I cleared cache on the netlify website and no fix.

I’m still facing the same issue, yes :frowning:

I get the same error when trying to build locally, so I don’t believe this is a Netlify issue.

I’m facing the same issue with yarn. I tried following points:

  • Clear cache :x:
  • Rename build commande by build-app :x:

Did those steps solve it?

Hey there, @ap3340 :wave:

Can you please elaborate on the error you are seeing, versus what you are expecting to see? This is what I see when I look at your site:

@Nicolas_Douard :wave:

We will need more information in order to assist you. Please share:

  1. your netlify site url
  2. your most recent build log
  3. your build settings
  4. the error messages you are receiving
  5. the expected behaviour you wish to see

I’ve changed the experience descriptions. That’s the only thing. It gives an error and ultimately, I can’t see the updated experience descriptions.

Please answer all of Hillary’s questions so we can best help you. Your description of what you think changed is not what we asked for and is not what we need to give you more specific advice :slight_smile: The link to your deploy logs is one key aspect we need to see, but we really do want all of those answers.

Thanks in advance for your help in troubleshooting!

  1. your netlify site url
  • antoniopano.netlify.app
  1. your most recent build log
    -pictured above
  2. your build settings

Base directory
Not set

Build command
npm run build

Publish directory
public

Deploy log visibility
Logs are public

Build status
Active

  1. the error messages you are receiving
    – non-zero exist code:2 & Command failed with exit code 255: hugo --gc --minify -b $URL
  2. the expected behaviour you wish to see
    – I’m not sure but the last successful deploy displayed this text:

12:32:05 AM: Netlify Build
Version

12:32:05 AM: @netlify/build 27.18.6

12:32:05 AM: ​

12:32:05 AM: ❯ Flags

12:32:05 AM: baseRelDir: true

12:32:05 AM: buildId: 6337c2b6642b3a0008908042

12:32:05 AM: deployId: 6337c2b6642b3a0008908044

12:32:05 AM: ​

12:32:05 AM: ❯ Current directory

12:32:05 AM: /opt/build/repo

12:32:05 AM: ​

12:32:05 AM: ❯ Config file

12:32:05 AM: /opt/build/repo/netlify.toml

12:32:05 AM: ​

12:32:05 AM: ❯ Context

12:32:05 AM: production

12:32:06 AM: ​

12:32:06 AM: ❯ Loading plugins

12:32:06 AM: - netlify-plugin-hugo-cache-resources@0.2.1 from netlify.toml

As already mentioned, this is not a Netlify problem. Please report this issue to either Hugo or the theme developers.

https://discourse.gohugo.io/t/why-wont-my-website-run/41280/4

Thanks for sharing that, @jmooring!