Home
Support Forums

Error deploying Hugo blog: Command failed with exit code 255: hugo

Hi,

I’m a novice, and so my apologies if this post isn’t as good as it should be.

I would really appreciate some help with deploying the Papermod Hugo template from my Github repo to Netlify.

I managed to deploy the standard version of the template, but I’m having trouble deploying the template with the example content populated.

Below is a copy of the deployment log.

Here is a link to the Github repo: GitHub - paradigmlegal/papermod3

The Netlify site name is dazzling-dijkstra-1240e9

Many thanks for any assistance with this. I tried to tinker with the netlify.toml file and did a huge amount of Googling, but I can’t figure it out!

The error log is as follows:

12:31:42 AM: Build ready to start
12:31:45 AM: build-image version: 3802cb5fb68688f5cbd80f2e312aa0ce78813b3a
12:31:45 AM: build-image tag: v4.0.4
12:31:45 AM: buildbot version: b7aeb2675f82192daa8545b22bebab9c3b179d0e
12:31:45 AM: Fetching cached dependencies
12:31:45 AM: Failed to fetch cache, continuing with build
12:31:45 AM: Starting to prepare the repo for build
12:31:45 AM: No cached dependencies found. Cloning fresh repo
12:31:45 AM: git clone GitHub - paradigmlegal/papermod3
12:31:46 AM: Preparing Git Reference refs/heads/master
12:31:47 AM: Parsing package.json dependencies
12:31:47 AM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘hugo’ versus ‘hugo --gc --minify -b $URL’ in the Netlify UI
12:31:47 AM: Starting build script
12:31:47 AM: Installing dependencies
12:31:47 AM: Python version set to 2.7
12:31:48 AM: v12.18.0 is already installed.
12:31:49 AM: Now using node v12.18.0 (npm v6.14.4)
12:31:49 AM: Started restoring cached build plugins
12:31:49 AM: Finished restoring cached build plugins
12:31:49 AM: Attempting ruby version 2.7.2, read from environment
12:31:50 AM: Using ruby version 2.7.2
12:31:51 AM: Using PHP version 7.4
12:31:51 AM: Installing Hugo 0.78.0
12:31:52 AM: Hugo Static Site Generator v0.78.0-FD62817B/extended linux/amd64 BuildDate: 2020-11-03T13:22:37Z
12:31:52 AM: Started restoring cached go cache
12:31:52 AM: Finished restoring cached go cache
12:31:52 AM: go version go1.14.4 linux/amd64
12:31:52 AM: go version go1.14.4 linux/amd64
12:31:52 AM: Installing missing commands
12:31:52 AM: Verify run directory
12:31:53 AM: ​
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: Netlify Build
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: ​
12:31:53 AM: ❯ Version
12:31:53 AM: @netlify/build 12.26.0
12:31:53 AM: ​
12:31:53 AM: ❯ Flags
12:31:53 AM: deployId: 60de505e633fd500074bc191
12:31:53 AM: ​
12:31:53 AM: ❯ Current directory
12:31:53 AM: /opt/build/repo
12:31:53 AM: ​
12:31:53 AM: ❯ Config file
12:31:53 AM: /opt/build/repo/netlify.toml
12:31:53 AM: ​
12:31:53 AM: ❯ Context
12:31:53 AM: production
12:31:53 AM: ​
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: 1. build.command from netlify.toml
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: ​
12:31:53 AM: $ hugo
12:31:53 AM: WARN 2021/07/01 23:31:53 Module “hugo-PaperMod” is not compatible with this Hugo version; run “hugo mod graph” for more information.
12:31:53 AM: Start building sites …
12:31:53 AM: ERROR 2021/07/01 23:31:53 render of “page” failed: execute of template failed: template: _default/single.html:5:8: executing “_default/single.html” at <partial “head.html” .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:45:17: executing “partials/templates/opengraph.html” at <index $siteSeries ($name | urlize)>: error calling index: index of untyped nil
12:31:53 AM: ERROR 2021/07/01 23:31:53 render of “page” failed: execute of template failed: template: _default/single.html:5:8: executing “_default/single.html” at <partial “head.html” .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:45:17: executing “partials/templates/opengraph.html” at <index $siteSeries ($name | urlize)>: error calling index: index of untyped nil
12:31:53 AM: ERROR 2021/07/01 23:31:53 render of “page” failed: execute of template failed: template: _default/single.html:5:8: executing “_default/single.html” at <partial “head.html” .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:45:17: executing “partials/templates/opengraph.html” at <index $siteSeries ($name | urlize)>: error calling index: index of untyped nil
12:31:53 AM: Total in 530 ms
12:31:53 AM: Error: Error building site: failed to render pages: render of “page” failed: execute of template failed: template: _default/single.html:5:8: executing “_default/single.html” at <partial “head.html” .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:45:17: executing “partials/templates/opengraph.html” at <index $siteSeries ($name | urlize)>: error calling index: index of untyped nil
12:31:53 AM: ​
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: “build.command” failed
12:31:53 AM: ────────────────────────────────────────────────────────────────
12:31:53 AM: ​
12:31:53 AM: Error message
12:31:53 AM: Command failed with exit code 255: hugo
12:31:53 AM: ​
12:31:53 AM: Error location
12:31:53 AM: In build.command from netlify.toml:
12:31:53 AM: hugo
12:31:53 AM: ​
12:31:53 AM: Resolved config
12:31:53 AM: build:
12:31:53 AM: command: hugo
12:31:53 AM: commandOrigin: config
12:31:53 AM: environment:
12:31:53 AM: - HUGO_VERSION
12:31:53 AM: - HUGO_ENV
12:31:53 AM: publish: /opt/build/repo/public
12:31:53 AM: publishOrigin: config
12:31:53 AM: functions:
12:31:53 AM: ‘*’: {}
12:31:54 AM: Caching artifacts
12:31:54 AM: Started saving build plugins
12:31:54 AM: Finished saving build plugins
12:31:54 AM: Started saving pip cache
12:31:54 AM: Finished saving pip cache
12:31:54 AM: Started saving emacs cask dependencies
12:31:54 AM: Finished saving emacs cask dependencies
12:31:54 AM: Started saving maven dependencies
12:31:54 AM: Finished saving maven dependencies
12:31:54 AM: Started saving boot dependencies
12:31:54 AM: Finished saving boot dependencies
12:31:54 AM: Started saving rust rustup cache
12:31:54 AM: Finished saving rust rustup cache
12:31:54 AM: Started saving go dependencies
12:31:54 AM: Finished saving go dependencies
12:31:56 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:31:56 AM: Creating deploy upload records
12:31:56 AM: Failing build: Failed to build site
12:31:56 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:31:56 AM: Finished processing build request in 11.697498872s

Hi @aceperceive

In your netlify.toml you have

[context.production.environment]
  HUGO_VERSION = "0.78.0"
  HUGO_ENV = "production"

however the repository you have cloned from (GitHub - adityatelange/hugo-PaperMod: A fast, clean, responsive Hugo theme.) has v0.82.0 as minimum

Minimum Hugo Version