Deployed failed with several errors

Hello! I do not manage to deploy my hugo website theme toha using netlify. I am having the following errors:

Deploy failed for playful-frangollo-c344f3

Today at 8:35 PM, by jessdejesus on GitHub.

Production: main@823c134
8:35:39 PM: Build ready to start
8:35:41 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
8:35:41 PM: build-image tag: v4.8.0
8:35:41 PM: buildbot version: f0ff221739bac4de60e9df6aad053e908497725c
8:35:41 PM: Fetching cached dependencies
8:35:41 PM: Failed to fetch cache, continuing with build
8:35:41 PM: Starting to prepare the repo for build
8:35:41 PM: No cached dependencies found. Cloning fresh repo
8:35:41 PM: git clone GitHub - jessdejesus/jessdejesus.github.io: Researcher website
8:35:42 PM: Preparing Git Reference refs/heads/main
8:35:42 PM: Parsing package.json dependencies
8:35:43 PM: Starting build script
8:35:43 PM: Installing dependencies
8:35:43 PM: Python version set to 2.7
8:35:43 PM: Downloading and installing node v16.15.1…
8:35:44 PM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz…
8:35:44 PM: Computing checksum with sha256sum
8:35:44 PM: Checksums matched!
8:35:46 PM: Now using node v16.15.1 (npm v8.11.0)
8:35:46 PM: Started restoring cached build plugins
8:35:46 PM: Finished restoring cached build plugins
8:35:47 PM: Attempting ruby version 2.7.2, read from environment
8:35:48 PM: Using ruby version 2.7.2
8:35:48 PM: Using PHP version 8.0
8:35:48 PM: Installing Hugo 0.100.2
8:35:49 PM: hugo v0.100.2-d25cb2943fd94ecf781412aeff9682d5dc62e284+extended linux/amd64 BuildDate=2022-06-08T10:25:57Z VendorInfo=gohugoio
8:35:49 PM: Started restoring cached go cache
8:35:49 PM: Finished restoring cached go cache
8:35:49 PM: Installing Go version 1.17
8:35:54 PM: unset GOOS;
8:35:54 PM: unset GOARCH;
8:35:54 PM: export GOROOT=β€˜/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64’;
8:35:54 PM: export PATH=β€œ/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64/bin:${PATH}”;
8:35:54 PM: go version >&2;
8:35:54 PM: export GIMME_ENV=β€œ/opt/buildhome/.gimme_cache/env/go1.17.linux.amd64.env”
8:35:54 PM: go version go1.17 linux/amd64
8:35:54 PM: Installing missing commands
8:35:54 PM: Verify run directory
8:35:55 PM: ​
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: Netlify Build
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: ​
8:35:55 PM: ❯ Version
8:35:55 PM: @netlify/build 27.1.4
8:35:55 PM: ​
8:35:55 PM: ❯ Flags
8:35:55 PM: baseRelDir: true
8:35:55 PM: buildId: 62a8d4fbdf2c250009ed1baf
8:35:55 PM: deployId: 62a8d4fbdf2c250009ed1bb1
8:35:55 PM: ​
8:35:55 PM: ❯ Current directory
8:35:55 PM: /opt/build/repo
8:35:55 PM: ​
8:35:55 PM: ❯ Config file
8:35:55 PM: /opt/build/repo/netlify.toml
8:35:55 PM: ​
8:35:55 PM: ❯ Context
8:35:55 PM: production
8:35:55 PM: ​
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: 1. build.command from netlify.toml
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: ​
8:35:55 PM: $ hugo --gc --minify
8:35:55 PM: Start building sites …
8:35:55 PM: hugo v0.100.2-d25cb2943fd94ecf781412aeff9682d5dc62e284+extended linux/amd64 BuildDate=2022-06-08T10:25:57Z VendorInfo=gohugoio
8:35:55 PM: ERROR 2022/06/14 18:35:55 render of β€œhome” failed: β€œ/opt/build/repo/themes/toha/layouts/index.html:41:8”: execute of template failed: template: index.html:41:8: executing β€œindex.html” at <partial β€œsections/home.html” .>: error calling partial: β€œ/opt/build/repo/themes/toha/layouts/partials/sections/home.html:111:29”: execute of template failed: template: partials/sections/home.html:111:29: executing β€œpartials/sections/home.html” at <$authorImage.RelPermalink>: nil pointer evaluating resource.Resource.RelPermalink
8:35:55 PM: Error: Error building site: failed to render pages: render of β€œpage” failed: β€œ/opt/build/repo/themes/toha/layouts/_default/single.html:49:46”: execute of template failed: template: _default/single.html:49:46: executing β€œcontent” at <partial β€œhelpers/get-author-image.html” .>: error calling partial: β€œ/opt/build/repo/themes/toha/layouts/partials/helpers/get-author-image.html:29:22”: execute of template failed: template: partials/helpers/get-author-image.html:29:22: executing β€œpartials/helpers/get-author-image.html” at <$authorImage.RelPermalink>: nil pointer evaluating resource.Resource.RelPermalink
8:35:55 PM: Total in 147 ms
8:35:55 PM: ​
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: β€œbuild.command” failed
8:35:55 PM: ────────────────────────────────────────────────────────────────
8:35:55 PM: ​
8:35:55 PM: Error message
8:35:55 PM: Command failed with exit code 255: hugo --gc --minify (Search results for '"non-zero exit code: 255"' - Netlify Support Forums)
8:35:55 PM: ​
8:35:55 PM: Error location
8:35:55 PM: In build.command from netlify.toml:
8:35:55 PM: hugo --gc --minify
8:35:55 PM: ​
8:35:55 PM: Resolved config
8:35:55 PM: build:
8:35:55 PM: command: hugo --gc --minify
8:35:55 PM: commandOrigin: config
8:35:55 PM: environment:
8:35:55 PM: - HUGO_ENABLEGITINFO
8:35:55 PM: - HUGO_ENV
8:35:55 PM: - HUGO_THEME
8:35:55 PM: - HUGO_VERSION
8:35:55 PM: publish: /opt/build/repo/public
8:35:55 PM: publishOrigin: config
8:35:56 PM: Caching artifacts
8:35:56 PM: Started saving build plugins
8:35:56 PM: Finished saving build plugins
8:35:56 PM: Started saving pip cache
8:35:56 PM: Finished saving pip cache
8:35:56 PM: Started saving emacs cask dependencies
8:35:56 PM: Finished saving emacs cask dependencies
8:35:56 PM: Started saving maven dependencies
8:35:56 PM: Finished saving maven dependencies
8:35:56 PM: Started saving boot dependencies
8:35:56 PM: Finished saving boot dependencies
8:35:56 PM: Started saving rust rustup cache
8:35:56 PM: Finished saving rust rustup cache
8:35:56 PM: Started saving go dependencies
8:35:57 PM: Finished saving go dependencies
8:35:59 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:35:59 PM: Creating deploy upload records
8:35:59 PM: Failing build: Failed to build site
8:35:59 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)
8:36:00 PM: Finished processing build request in 18.997220575s

Could someone help, please? Thank you!

Hello @jesssss ,

I believe the issue was introduced in this PR Allow setting GIFS as author image by Rihoj Β· Pull Request #394 Β· hugo-toha/toha Β· GitHub
I made a comment to the author there. You could fix it if you fix the assignment lines to use β€œ:=” instead of β€œ=”.

Here are the relevant docs for variable declaration in go’s template language Short Variable Declaration (:= Operator) in GoLang - GoLang Docs

There’s an issue using the same variable when using the short declaration operator and trying to change it’s value type.

Hope that helps.

The error was in the path of the image for the author actually: ./assets/images/author/jess.jpg to images/author/jess.jpg
When this change was done, then it worked :slight_smile:

1 Like

Thanks for coming back and sharing your solution :tada: Happy building!