Home
Support Forums

Deployment failed for a hugo theme

10:14:54 AM: Build ready to start
10:14:56 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
10:14:56 AM: build-image tag: v4.3.0
10:14:56 AM: buildbot version: d2795bf5a96b85e585e90944f15f15381ce164a7
10:14:56 AM: Fetching cached dependencies
10:14:56 AM: Failed to fetch cache, continuing with build
10:14:56 AM: Starting to prepare the repo for build
10:14:56 AM: No cached dependencies found. Cloning fresh repo
10:14:56 AM: git clone https://github.com/Ashwath-Shetty/toha_source
10:14:58 AM: Preparing Git Reference refs/heads/main
10:14:59 AM: Parsing package.json dependencies
10:15:00 AM: Starting build script
10:15:00 AM: Installing dependencies
10:15:00 AM: Python version set to 2.7
10:15:01 AM: Downloading and installing node v16.8.0...
10:15:01 AM: Downloading https://nodejs.org/dist/v16.8.0/node-v16.8.0-linux-x64.tar.xz...
10:15:01 AM: Computing checksum with sha256sum
10:15:01 AM: Checksums matched!
10:15:05 AM: Now using node v16.8.0 (npm v7.21.0)
10:15:05 AM: Started restoring cached build plugins
10:15:05 AM: Finished restoring cached build plugins
10:15:05 AM: Attempting ruby version 2.7.2, read from environment
10:15:06 AM: Using ruby version 2.7.2
10:15:07 AM: Using PHP version 8.0
10:15:07 AM: Installing Hugo 0.87.0
10:15:08 AM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
10:15:08 AM: Started restoring cached go cache
10:15:08 AM: Finished restoring cached go cache
10:15:08 AM: go version go1.16.5 linux/amd64
10:15:08 AM: go version go1.16.5 linux/amd64
10:15:08 AM: Installing missing commands
10:15:08 AM: Verify run directory
10:15:09 AM: ​
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM:   Netlify Build                                                 
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM: ​
10:15:09 AM: ❯ Version
10:15:09 AM:   @netlify/build 18.5.0
10:15:09 AM: ​
10:15:09 AM: ❯ Flags
10:15:09 AM:   baseRelDir: true
10:15:09 AM:   buildId: 61271c4682d9c500088aab6a
10:15:09 AM:   deployId: 61271c4682d9c500088aab6c
10:15:09 AM: ​
10:15:09 AM: ❯ Current directory
10:15:09 AM:   /opt/build/repo
10:15:09 AM: ​
10:15:09 AM: ❯ Config file
10:15:09 AM:   /opt/build/repo/netlify.toml
10:15:09 AM: ​
10:15:09 AM: ❯ Context
10:15:09 AM:   production
10:15:09 AM: ​
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM:   1. build.command from netlify.toml                            
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM: ​
10:15:09 AM: $ hugo --gc --minify
10:15:09 AM: Start building sites …
10:15:09 AM: hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
10:15:09 AM: ERROR 2021/08/26 04:45:09 render of "page" failed: execute of template failed: template: notes/single.html:6:8: executing "notes/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/themes/toha/layouts/partials/header.html:23:33": execute of template failed: template: partials/header.html:23:33: executing "partials/header.html" at <$favicon.MediaType.SubType>: nil pointer evaluating resource.Resource.MediaType
10:15:09 AM: ERROR 2021/08/26 04:45:09 render of "page" failed: execute of template failed: template: notes/single.html:6:8: executing "notes/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/themes/toha/layouts/partials/header.html:23:33": execute of template failed: template: partials/header.html:23:33: executing "partials/header.html" at <$favicon.MediaType.SubType>: nil pointer evaluating resource.Resource.MediaType
10:15:09 AM: ERROR 2021/08/26 04:45:09 render of "page" failed: execute of template failed: template: notes/single.html:6:8: executing "notes/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/themes/toha/layouts/partials/header.html:23:33": execute of template failed: template: partials/header.html:23:33: executing "partials/header.html" at <$favicon.MediaType.SubType>: nil pointer evaluating resource.Resource.MediaType
10:15:09 AM: ERROR 2021/08/26 04:45:09 render of "page" failed: execute of template failed: template: notes/single.html:6:8: executing "notes/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/themes/toha/layouts/partials/header.html:23:33": execute of template failed: template: partials/header.html:23:33: executing "partials/header.html" at <$favicon.MediaType.SubType>: nil pointer evaluating resource.Resource.MediaType
10:15:09 AM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: notes/single.html:6:8: executing "notes/single.html" at <partial "header.html" .>: error calling partial: "/opt/build/repo/themes/toha/layouts/partials/header.html:23:33": execute of template failed: template: partials/header.html:23:33: executing "partials/header.html" at <$favicon.MediaType.SubType>: nil pointer evaluating resource.Resource.MediaType
10:15:09 AM: Total in 126 ms
10:15:09 AM: ​
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM:   "build.command" failed                                        
10:15:09 AM: ────────────────────────────────────────────────────────────────
10:15:09 AM: ​
10:15:09 AM:   Error message
10:15:09 AM:   Command failed with exit code 255: hugo --gc --minify
10:15:09 AM: ​
10:15:09 AM:   Error location
10:15:09 AM:   In build.command from netlify.toml:
10:15:09 AM:   hugo --gc --minify
10:15:09 AM: ​
10:15:09 AM:   Resolved config
10:15:09 AM:   build:
10:15:09 AM:     command: hugo --gc --minify
10:15:09 AM:     commandOrigin: config
10:15:09 AM:     environment:
10:15:09 AM:       - HUGO_ENABLEGITINFO
10:15:09 AM:       - HUGO_ENV
10:15:09 AM:       - HUGO_THEME
10:15:09 AM:       - HUGO_VERSION
10:15:09 AM:     publish: /opt/build/repo/public
10:15:09 AM:     publishOrigin: config
10:15:10 AM: Caching artifacts
10:15:10 AM: Started saving build plugins
10:15:10 AM: Finished saving build plugins
10:15:10 AM: Started saving pip cache
10:15:10 AM: Finished saving pip cache
10:15:10 AM: Started saving emacs cask dependencies
10:15:10 AM: Finished saving emacs cask dependencies
10:15:10 AM: Started saving maven dependencies
10:15:10 AM: Finished saving maven dependencies
10:15:10 AM: Started saving boot dependencies
10:15:10 AM: Finished saving boot dependencies
10:15:10 AM: Started saving rust rustup cache
10:15:10 AM: Finished saving rust rustup cache
10:15:10 AM: Started saving go dependencies
10:15:10 AM: Finished saving go dependencies
10:15:13 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:15:13 AM: Creating deploy upload records
10:15:13 AM: Failing build: Failed to build site
10:15:13 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:15:13 AM: Finished processing build request in 17.053034415s

i was building my portfolio using a hugo theme called toha here is the authors original repo and here is my repo but I’m getting the above error while deploying and I’m scratching my head for a week and tried everything, still not able to fix it, can someone please help. it works fine in local host.

In you config.yaml you have

favicon: /images/site/favicon.png

however it appears favicon.png is in images/.
Compare the path of the original repository /assets/images/site/ with yours /assets/images/