Netlify and Hugo not communicating

I need advice to debug deploy https://app.netlify.com/sites/keen-easley-1e5dba/deploys/5fba0788ec6a9b3db91f7640
Their Netlify deployment site (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/) doesn’t say anything about the Netlify build command besides what’s in the netlify.toml. I’m not sure if they need to update their info, or where I’m going wrong. Thanks in advance!

Kindly post the build log here as it doesn’t seem to be publicly available.

11:39:04 PM: Build ready to start
11:39:06 PM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41
11:39:06 PM: build-image tag: v3.5.0
11:39:06 PM: buildbot version: 172aa31cb336bae73f9eb30159b9f95fe46f2e63
11:39:07 PM: Fetching cached dependencies
11:39:07 PM: Starting to download cache of 18.0MB
11:39:07 PM: Finished downloading cache in 243.309034ms
11:39:07 PM: Starting to extract cache
11:39:07 PM: Finished extracting cache in 179.964235ms
11:39:07 PM: Finished fetching cache in 428.76175ms
11:39:07 PM: Starting to prepare the repo for build
11:39:07 PM: Preparing Git Reference refs/heads/main
11:39:10 PM: Starting build script
11:39:10 PM: Installing dependencies
11:39:10 PM: Python version set to 2.7
11:39:11 PM: v12.18.0 is already installed.
11:39:12 PM: Now using node v12.18.0 (npm v6.14.4)
11:39:12 PM: Started restoring cached build plugins
11:39:12 PM: Finished restoring cached build plugins
11:39:12 PM: Attempting ruby version 2.7.1, read from environment
11:39:13 PM: Using ruby version 2.7.1
11:39:14 PM: Using PHP version 5.6
11:39:14 PM: Started restoring cached go cache
11:39:14 PM: Finished restoring cached go cache
11:39:14 PM: go version go1.14.4 linux/amd64
11:39:14 PM: go version go1.14.4 linux/amd64
11:39:14 PM: Installing missing commands
11:39:14 PM: Verify run directory
11:39:16 PM: ​
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM:   Netlify Build                                                 
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM: ​
11:39:16 PM: ❯ Version
11:39:16 PM:   @netlify/build 5.3.2
11:39:16 PM: ​
11:39:16 PM: ❯ Flags
11:39:16 PM:   deployId: 5fba0788ec6a9b3db91f7640
11:39:16 PM:   mode: buildbot
11:39:16 PM: ​
11:39:16 PM: ❯ Current directory
11:39:16 PM:   /opt/build/repo
11:39:16 PM: ​
11:39:16 PM: ❯ Config file
11:39:16 PM:   No config file was defined: using default values.
11:39:16 PM: ​
11:39:16 PM: ❯ Context
11:39:16 PM:   production
11:39:16 PM: ​
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM:   1. Build command from Netlify app                             
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM: ​
11:39:16 PM: $ hugo --gc --minify
11:39:16 PM: ERROR 2020/11/22 06:39:16 SOMRAT theme does not support Hugo version 0.54.0. Minimum version required is 0.60.0
11:39:16 PM: Building sites … Total in 323 ms
11:39:16 PM: Error: Error building site: stat /opt/build/repo/content/english: no such file or directory
11:39:16 PM: ​
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM:   "build.command" failed                                        
11:39:16 PM: ────────────────────────────────────────────────────────────────
11:39:16 PM: ​
11:39:16 PM:   Error message
11:39:16 PM:   Command failed with exit code 255: hugo --gc --minify
11:39:16 PM: ​
11:39:16 PM:   Error location
11:39:16 PM:   In Build command from Netlify app:
11:39:16 PM:   hugo --gc --minify
11:39:16 PM: ​
11:39:16 PM:   Resolved config
11:39:16 PM:   build:
11:39:16 PM:     command: hugo --gc --minify
11:39:16 PM:     commandOrigin: ui
11:39:16 PM:     publish: /opt/build/repo/public
11:39:16 PM: Caching artifacts
11:39:16 PM: Started saving build plugins
11:39:16 PM: Finished saving build plugins
11:39:16 PM: Started saving pip cache
11:39:16 PM: Finished saving pip cache
11:39:16 PM: Started saving emacs cask dependencies
11:39:16 PM: Finished saving emacs cask dependencies
11:39:16 PM: Started saving maven dependencies
11:39:16 PM: Finished saving maven dependencies
11:39:16 PM: Started saving boot dependencies
11:39:16 PM: Finished saving boot dependencies
11:39:16 PM: Started saving go dependencies
11:39:16 PM: Finished saving go dependencies
11:39:19 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:39:19 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:39:19 PM: Failing build: Failed to build site
11:39:19 PM: Finished processing build request in 12.989674794s

Add this:

[build]
	base = "/"
	command = "hugo --gc --minify"
	context = "production"
	publish = "public"
[context.production.environment]
	HUGO_VERSION = "0.78.2"
	HUGO_ENV = "production"

Forgot to mention, add it to your netlify.toml.

This worked! Thank you!
It might be an issue for another topic, but now I’m getting a 403 error with my CSS. Running Hugo works fine with the site. Is this another Netlify build issue or what am I missing?
thanks!

403 is forbidden. There’s no reason to be getting that if you’re hosting the CSS yourself. Mind sharing the site address?

jessicajorgenson.site
As you can see, it’s hideous

All the 403 URLs are from examplesite.com. You need to change the source code to make it relative to your domain.

An example:

Check the request URL in that.

1 Like

Oh, I am SO dumb. You’re right. Thank you!