Hugo

Netlify build returned non-zero exit code: 255

I got the similar errors.

netfily failed during stage 'building site': Build script returned non-zero exit code: 255
Here is the deploy log.
11:30:08 AM: Build ready to start
11:30:09 AM: build-image version: 12783d4d177a66bec5a23ad1097ea7bd02931128
11:30:09 AM: buildbot version: 5a64b5cb0ce1ed3ba485935522483a4d39e15107
11:30:09 AM: Fetching cached dependencies
11:30:09 AM: Failed to fetch cache, continuing with build
11:30:09 AM: Starting to prepare the repo for build
11:30:10 AM: No cached dependencies found. Cloning fresh repo
11:30:10 AM: git clone https://github.com/JiaxiangBU/blog_181126
11:30:11 AM: Preparing Git Reference refs/heads/master
11:30:12 AM: Starting build script
11:30:12 AM: Installing dependencies
11:30:12 AM: Downloading and installing node v8.13.0...
11:30:13 AM: Downloading https://nodejs.org/dist/v8.13.0/node-v8.13.0-linux-x64.tar.xz...
11:30:13 AM: 
#
11:30:13 AM:                                                        1.5%
11:30:13 AM: 
##################
11:30:13 AM: ###########                                             40.4%
11:30:13 AM: 
######################
11:30:13 AM: ################################################## 100.0%
11:30:13 AM: Computing checksum with sha256sum
11:30:13 AM: Checksums matched!
11:30:15 AM: Now using node v8.13.0 (npm v6.4.1)
11:30:15 AM: Attempting ruby version 2.3.6, read from environment
11:30:16 AM: Using ruby version 2.3.6
11:30:17 AM: Using PHP version 5.6
11:30:18 AM: Started restoring cached go cache
11:30:18 AM: Finished restoring cached go cache
11:30:18 AM: unset GOOS;
11:30:18 AM: unset GOARCH;
11:30:18 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64';
11:30:18 AM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
11:30:18 AM: go version >&2;
11:30:18 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env';
11:30:18 AM: go version go1.10 linux/amd64
11:30:18 AM: Installing missing commands
11:30:18 AM: Verify run directory
11:30:18 AM: Executing user command: hugo
11:30:18 AM: Started building sites ...
11:30:18 AM: ERROR: 2018/11/26 03:30:17 template.go:132: template: theme/partials/head_highlightjs.html:1:54: executing "theme/partials/head_highlightjs.html" at <.Content>: can't evaluate field Content in type *hugolib.Node in theme/partials/head_highlightjs.html
11:30:18 AM: ERROR: 2018/11/26 03:30:17 general.go:212: Error while rendering taxonomy tag: template: theme/_default/list.html:5:20: executing "theme/_default/list.html" at <.Content>: can't evaluate field Content in type *hugolib.Node
11:30:18 AM: Caching artifacts
11:30:18 AM: Started saving pip cache
11:30:18 AM: Finished saving pip cache
11:30:18 AM: Started saving emacs cask dependencies
11:30:18 AM: Finished saving emacs cask dependencies
11:30:18 AM: Started saving maven dependencies
11:30:18 AM: Finished saving maven dependencies
11:30:18 AM: Started saving boot dependencies
11:30:18 AM: Finished saving boot dependencies
11:30:18 AM: Started saving go dependencies
11:30:18 AM: Finished saving go dependencies
11:30:18 AM: Cached node version v8.13.0
11:30:18 AM: Error running command: Build script returned non-zero exit code: 255
11:30:18 AM: Failing build: Failed to build site
11:30:18 AM: failed during stage 'building site': Build script returned non-zero exit code: 255
11:30:18 AM: Finished processing build request in 9.367841845s

And the publishing docs folder named by public from this github repo

Hi – I split your post into a new topic and referenced the old one.

I cloned your repo and it builds fine locally. So, what hugo version are you using in netlify?

Also, I see you don’t have a netlify.toml file at the root of your site. Try adding one, then kick off another deploy and report back what happens.

Example netlify.toml file:

[build]
publish = "public"
command = "hugo"

[context.production.environment]
HUGO_VERSION = "0.51"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
1 Like

Something else – in your config.toml file, baseurl should be baseURL, and it should be set to the URL of your site, not /

I am also running into the same problem.

I am following the quick start tutorial but I can’t seem to deploy my script (trying Netlify).

I picked a common theme, and built a website.
I used the command “Hugo” to create a Public folder.

I used git to upload everything to github.

I am following the instructions to deploy on Netlify:
https://gohugo.io/hosting-and-deployment/hosting-on-netlify/,
however I am running into the error in the title:

Here is the site I am trying to deploy:

I can’t figure out what I am doing wrong.

I have tried implementing your suggestions as well.

Thank you.

You need to set HUGO_VERSION in Netlify environment to a recent Hugo version.

Ah. Thank you!
So I changed it to my current Hugo version which is:

HUGO_VERSION = "0.55.6"

It seems to have been deployed, but front-end of the site isn’t rendering properly:

This is locally:

Then this is deployed:

Here is the actual website:

https://brave-lalande-a02424.netlify.com/

Going through the tutorial,
Netlify.toml seems to have more configurations,
but It doesn’t seem like it’s all of the configurations are needed.

Is there a setting problem?

Thank you so much.

Hi,

You need to set your baseURL to the actual website url: https://brave-lalande-a02424.netlify.com/.

1 Like

Ah. I feel so dumb.
Thank you so much for the helpful tip.

A post was split to a new topic: Netlify build error