Home
Support Forums

Deploy didn't work. I got this error message." error Command failed with exit code 255: hugo"

PLEASE can anyone help me?

THANK YOU!

I got that error
Error mesage
Command failed with exit code 255: hugo
Error location
In Build command from Netlify app: hugo

Hey @Bortogit,
Is this site successfully building for you locally?

If not, we’d recommend getting that working first and then we can help you sort out what you need to build and deploy the same site on Netlify.

If this is working for you locally, it’d be great to get your Netlify URL so we can dig in a bit. Thanks!

@jen
I’m having the same problem but I’m using resume-academic for it:

How can I check that it builds locally?
The site deployed before…

Deploy log

4:17:58 PM: Build ready to start
4:18:00 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
4:18:00 PM: build-image tag: v3.7.6
4:18:00 PM: buildbot version: 00e794c8abfdf634e411d5afc169b41bd6a2f9f3
4:18:00 PM: Fetching cached dependencies
4:18:00 PM: Failed to fetch cache, continuing with build
4:18:00 PM: Starting to prepare the repo for build
4:18:01 PM: No cached dependencies found. Cloning fresh repo
4:18:01 PM: git clone git@github.com:shirasal/resume-academic
4:18:03 PM: Preparing Git Reference refs/heads/master
4:18:04 PM: Parsing package.json dependencies
4:18:05 PM: Starting build script
4:18:05 PM: Installing dependencies
4:18:05 PM: Python version set to 2.7
4:18:06 PM: v12.18.0 is already installed.
4:18:06 PM: Now using node v12.18.0 (npm v6.14.4)
4:18:06 PM: Started restoring cached build plugins
4:18:06 PM: Finished restoring cached build plugins
4:18:07 PM: Attempting ruby version 2.7.1, read from environment
4:18:08 PM: Using ruby version 2.7.1
4:18:08 PM: Using PHP version 5.6
4:18:08 PM: Installing Hugo 0.74.3
4:18:09 PM: Hugo Static Site Generator v0.74.3-DA0437B4/extended linux/amd64 BuildDate: 2020-07-23T16:30:30Z
4:18:09 PM: Started restoring cached go cache
4:18:09 PM: Finished restoring cached go cache
4:18:09 PM: go version go1.14.4 linux/amd64
4:18:09 PM: go version go1.14.4 linux/amd64
4:18:09 PM: Installing missing commands
4:18:09 PM: Verify run directory
4:18:10 PM: ​
4:18:10 PM: ────────────────────────────────────────────────────────────────
4:18:10 PM: Netlify Build
4:18:10 PM: ────────────────────────────────────────────────────────────────
4:18:10 PM: ​
4:18:10 PM: ❯ Version
4:18:10 PM: @netlify/build 12.1.0
4:18:10 PM: ​
4:18:10 PM: ❯ Flags
4:18:10 PM: deployId: 60c6058661cb7c4df3525b19
4:18:10 PM: ​
4:18:10 PM: ❯ Current directory
4:18:10 PM: /opt/build/repo
4:18:10 PM: ​
4:18:10 PM: ❯ Config file
4:18:10 PM: /opt/build/repo/netlify.toml
4:18:10 PM: ​
4:18:10 PM: ❯ Context
4:18:10 PM: production
4:18:10 PM: ​
4:18:10 PM: ────────────────────────────────────────────────────────────────
4:18:10 PM: 1. build.command from netlify.toml
4:18:10 PM: ────────────────────────────────────────────────────────────────
4:18:10 PM: ​
4:18:10 PM: $ hugo --gc --minify -b $URL
4:18:12 PM: hugo: collected modules in 1796 ms
4:18:12 PM: Building sites … Total in 1900 ms
4:18:12 PM: Error: Error building site: “/opt/build/repo/content/home/experience.md:64:1”: unmarshal failed: Near line 63 (last key parsed 'experience. [[experience]]
4:18:12 PM: title = “Research Assistant”
4:18:12 PM: company = “HaMaarag”
4:18:12 PM: company_url = “http://www.hamaarag.org.il/en
4:18:12 PM: location = “Tel Aviv”
4:18:12 PM: date_start = “2020-07-01”
4:18:12 PM: date_end = “2020-10-31”
4:18:12 PM: description = '): expected key separator ‘=’, but got ‘\n’ instead​
4:18:12 PM: ────────────────────────────────────────────────────────────────
4:18:12 PM: “build.command” failed
4:18:12 PM: ────────────────────────────────────────────────────────────────
4:18:12 PM: ​
4:18:12 PM: Error message
4:18:12 PM: Command failed with exit code 255: hugo --gc --minify -b $URL
4:18:12 PM: ​
4:18:12 PM: Error location
4:18:12 PM: In build.command from netlify.toml:
4:18:12 PM: hugo --gc --minify -b $URL
4:18:12 PM: ​
4:18:12 PM: Resolved config
4:18:12 PM: build:
4:18:12 PM: command: hugo --gc --minify -b $URL
4:18:12 PM: commandOrigin: config
4:18:12 PM: environment:
4:18:12 PM: - HUGO_VERSION
4:18:12 PM: - HUGO_ENABLEGITINFO
4:18:12 PM: - HUGO_ENV
4:18:12 PM: publish: /opt/build/repo/public
4:18:12 PM: functions:
4:18:12 PM: ‘’: {}
4:18:12 PM: headers:
4:18:12 PM: - for: '
.webmanifest’
4:18:12 PM: values:
4:18:12 PM: Content-Type: application/manifest+json; charset=UTF-8
4:18:12 PM: - for: index.xml
4:18:12 PM: values:
4:18:12 PM: Content-Type: application/rss+xml
4:18:12 PM: Caching artifacts
4:18:12 PM: Started saving build plugins
4:18:12 PM: Finished saving build plugins
4:18:12 PM: Started saving pip cache
4:18:12 PM: Finished saving pip cache
4:18:12 PM: Started saving emacs cask dependencies
4:18:12 PM: Finished saving emacs cask dependencies
4:18:12 PM: Started saving maven dependencies
4:18:12 PM: Finished saving maven dependencies
4:18:12 PM: Started saving boot dependencies
4:18:12 PM: Finished saving boot dependencies
4:18:12 PM: Started saving rust rustup cache
4:18:12 PM: Finished saving rust rustup cache
4:18:12 PM: Started saving go dependencies
4:18:12 PM: Finished saving go dependencies
4:18:15 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:18:15 PM: Creating deploy upload records
4:18:15 PM: Failing build: Failed to build site
4:18:15 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:18:15 PM: Finished processing build request in 15.236179339s

By running hugo locally. It doesn’t work on my laptop.

The reason is, you’ve got incorrectly formatted frontmatter in the file /content/home/experience.md. There are a lot of extra quotes and overall, the file needs a lot of fixing. I’d advise to start fresh for that file. However, there’s a chance that after you fix that file, you’d end up with errors because of other files. I haven’t checked all files, but if you’ve made them exactly like these, the error would exist. However, to fix this file you need to do the following:

Replace +++ with --- to use YAML frontmatter instead of TOML. This is because the Academic documentation website gives examples in YAML, so you could just copy-paste.

Then, following the documentation here: Experience & Education | Wowchemy: Free Website Builder for Hugo, format your description like this:

description: >-
  Responsibilities include:

    * Analysing
    * Modelling
    * Deploying

Thanks very much! I decided to start over