[SOLVED] Netlify deployment errors, yet, nothing errors on localhost

6:06:27 PM: ERROR: 2017/03/23 00:06:27 general.go:212: Error while rendering section : template: theme/_default/list.html:41:45: executing "theme/_default/list.html" at <index .Site.Params.a...>: error calling index: value is nil; should be of type string
6:06:27 PM: Cleaning up docker container
6:04:43 PM: Error running command: Build script returned non-zero exit code: 255
6:06:27 PM: Error running command: Build script returned non-zero exit code: 255
6:06:28 PM: Finished processing build request

I’m getting this error in Netlify, but I don’t have errors in hugo serve -v

The code in question is at the following file:
theme/_default/list.html

Line 41:

{{$author := index .Site.Params.authors .Params.author }}

(localhost log)

stoned@stoned-desktop:~/media/websites/psychedelicsdaily.com$ hugo serve -v
INFO 2017/03/22 22:33:21 Using config file: 
INFO 2017/03/22 22:33:21 using a UnionFS for static directory comprised of:
INFO 2017/03/22 22:33:21 Base: /home/stoned/media/websites/psychedelicsdaily.com/themes/hugo-universal-theme/static
INFO 2017/03/22 22:33:21 Overlay: /home/stoned/media/websites/psychedelicsdaily.com/static/
INFO 2017/03/22 22:33:21 syncing static files to /
Started building sites ...
INFO 2017/03/22 22:33:21 found taxonomies: map[string]string{"tag":"tags", "category":"categories", "author":"authors"}
WARN 2017/03/22 22:33:21 [en] Unable to locate layout for page : [taxonomy/author.terms.html _default/terms.html indexes/indexes.html theme/taxonomy/author.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/taxonomy/author.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/theme/taxonomy/author.terms.html theme/theme/_default/terms.html theme/theme/indexes/indexes.html]
WARN 2017/03/22 22:33:21 authors is rendered empty
WARN 2017/03/22 22:33:21 [en] Unable to locate layout for page : [taxonomy/category.terms.html _default/terms.html indexes/indexes.html theme/taxonomy/category.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/taxonomy/category.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/theme/taxonomy/category.terms.html theme/theme/_default/terms.html theme/theme/indexes/indexes.html]
WARN 2017/03/22 22:33:21 categories is rendered empty
WARN 2017/03/22 22:33:21 [en] Unable to locate layout for page : [taxonomy/tag.terms.html _default/terms.html indexes/indexes.html theme/taxonomy/tag.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/taxonomy/tag.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/theme/taxonomy/tag.terms.html theme/theme/_default/terms.html theme/theme/indexes/indexes.html]
WARN 2017/03/22 22:33:21 tags is rendered empty
Built site for language en:
0 draft content
0 future content
0 expired content
10 regular pages created
14 other pages created
0 non-page files copied
11 paginator pages created
4 tags created
2 categories created
3 authors created
total in 37 ms
WARN 2017/03/22 22:33:21 Skip i18nDir: lstat /home/stoned/media/websites/psychedelicsdaily.com/i18n: no such file or directory
WARN 2017/03/22 22:33:21 Skip layoutDir: lstat /home/stoned/media/websites/psychedelicsdaily.com/layouts: no such file or directory
Watching for changes in /home/stoned/media/websites/psychedelicsdaily.com/{data,content,static,themes}
WARN 2017/03/22 22:33:21 Skip i18nDir: lstat /home/stoned/media/websites/psychedelicsdaily.com/i18n: no such file or directory
WARN 2017/03/22 22:33:21 Skip layoutDir: lstat /home/stoned/media/websites/psychedelicsdaily.com/layouts: no such file or directory
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

I can’t see any error on localhost, and I don’t see anything obviously wrong w/ my code.

Why would netlify fail to deploy? Any ideas? Not sure if I should even be asking here.

Shot in the dark…try using hugo_0.19 as your build command in Netlify.

2 Likes

Hit!

http://accountant-beaver-62358.netlify.com/

@rdwatters Hello sir, here is where I have deployed the test site PsychedelicsDaily.com (with multiple authors and the site organization. I’m still trying to figure out how to open my gitlab repository for you. Soon as that happens I’ll give you a shout. Here we can experiment on the site orgnaizaiton and whatever else.

Now the site builds and is live. I appreciate that, sir. Thank you. Excellent. Flawless Victory for @sethm

:slightly_smiling:

How did you know this? I browsed around quite a bit before I asked here.

EDIT: @rdwatters I’ve sent another PM w/ the public repository for netlify (use the testing branch). Thanks!

I had a similar error not too long ago. It wasn’t the same error, so I wasn’t sure if my solution would work. Hidden away in the Netlify docs it turns out that Netlify is using Hugo version 0.17 by default, so that causes problems for people using features from more recent builds.

1 Like

@sethm and @Hash_Borgir Check out the new “hosting on netlify” docs I put up a couple days ago: it shows the following:

  1. The new UI
  2. A link to the docker file that gives you an idea of all the versions they offer
  3. A bit of advice on what’s already been mentioned w/r/t using hogo_0.19, etc…

https://hugodocs.info/hosting-and-deployment/hosting-on-netlify/

2 Likes

I am having pretty much same issue. How to resolve it? It says: “build script returned non-zero exit code: 255”.

Try setting an environmental variable to the hugo version you’re using on your dev machine. Whatever it is just make sure they match, more details here https://gohugo.io/hosting-and-deployment/hosting-on-netlify/

1 Like

I added to netlify.toml(netlify config) file this lines:

[context.deploy-preview.environment]
HUGO_VERSION = "0.29"

That’s a really old version! The latest version as of today is 0.40.2.