# Netlify build returned non-zero exit code: 255

**URL:** <https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496>\
**Category:** support\
**Created:** [November 26, 2018, 3:37am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496 "2018-11-26T03:37:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JiaxiangBU](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@JiaxiangBU](https://discourse.gohugo.io/u/JiaxiangBU)\
**Post date:** [November 26, 2018, 3:37am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/1 "2018-11-26T03:37:26Z")

</div>

I got the similar errors.

```auto
netfily failed during stage 'building site': Build script returned non-zero exit code: 255

```

> **Here is the deploy log.**
>
> ```auto
> 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](https://github.com/JiaxiangBU/blog_181126/)

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [November 26, 2018, 4:07am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/2 "2018-11-26T04:07:36Z")

</div>

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:

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

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

```

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [November 26, 2018, 4:32am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/3 "2018-11-26T04:32:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MasayoMusic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/masayomusic/32/9105_2.png) [@MasayoMusic](https://discourse.gohugo.io/u/MasayoMusic)\
**Post date:** [August 9, 2019, 7:39am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/4 "2019-08-09T07:39:39Z")

</div>

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).

> **[Quick Start](https://gohugo.io/getting-started/quick-start/)**
>
> Create a Hugo site using the beautiful Ananke theme.

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/](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:

> **[Moondra/Another-Hugo-Test](https://github.com/Moondra/Another-Hugo-Test)**
>
> Contribute to Moondra/Another-Hugo-Test development by creating an account on GitHub.

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

I have tried implementing your suggestions as well.

Thank you.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 9, 2019, 9:15am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/5 "2019-08-09T09:15:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MasayoMusic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/masayomusic/32/9105_2.png) [@MasayoMusic](https://discourse.gohugo.io/u/MasayoMusic)\
**Post date:** [August 10, 2019, 3:08am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/6 "2019-08-10T03:08:41Z")

</div>

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:

 ![regular](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/f/f939b9bf9e7ed57c73a8f567b8838cc4f11684ed.png)

Then this is deployed:

 ![deployed_](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/8/8841797cfebfd677a6b3072a28706a22e52d65cd.jpeg)

Here is the actual website:

[https://brave-lalande-a02424.netlify.com/](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.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [August 10, 2019, 5:30am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/7 "2019-08-10T05:30:22Z")

</div>

Hi,

You need to set your [`baseURL`](https://github.com/Moondra/Another-Hugo-Test/blob/96ad1957236579edccf64dba856c76cccd7f0ac4/config.toml#L1) to the actual website url: `https://brave-lalande-a02424.netlify.com/`.

---

<div class="post-metadata">

**Author:** ![MasayoMusic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/masayomusic/32/9105_2.png) [@MasayoMusic](https://discourse.gohugo.io/u/MasayoMusic)\
**Post date:** [August 10, 2019, 7:17pm UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/8 "2019-08-10T19:17:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [November 7, 2019, 1:00am UTC](https://discourse.gohugo.io/t/netlify-build-returned-non-zero-exit-code-255/15496/9 "2019-11-07T01:00:01Z")

</div>

A post was split to a new topic: [Netlify build error](https://discourse.gohugo.io/t/netlify-build-error/21657)
