Build and deploy fails for PROD but succeeds for UAT, not sure why?

Website: quizzical-wiles-50bee1
Subject: Build and deploy fails for PROD but succeeds for UAT, not sure why?

Hi, I get an error when building and deploying my PROD site. It points to my ‘master’ GitHub branch, and the site (tries to) build with Hugo. The logs are here:

This is where it fails in the above logs:

6:20:10 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (
6:20:09 PM: $ hugo --gc --minify
6:20:09 PM: Building sites … ERROR 2023/01/15 17:20:09 Failed to read Git log: ccc9ff6b8d3d90338b1852f3cd9e551f784aca3f ccc9ff6 Research

What’s strange is that building and deploying the UAT version works fine. This also points to GitHub (on another branch ‘uat’, in which the content is the same). Here’s a recent successful UAT deploy, and you can see there are no errors in the logs:

I have checked my environment variables, and they look correct:


At this point, I’m stumped. Could you please help me find out what’s going wrong?


I got it working again, and am posting an update for others. The reason seems to be something changed in how Netlify Hugo builds work, or in how Netlify accesses GitHub. Anyway, I’m just happy it’s working! A brief explanation follows below.

It seems the config I pass on to Netlify from Hugo in the file netlify.toml had a config line that wasn’t applicable to the UAT deploy:

I switched that to “false” and now the Hugo build on Netlify doesn’t error out when it interfaces with git. For reference, the PROD-environment related block in my Hugo netlify.toml config file now consists solely of:

HUGO_VERSION = "0.55.6"
HUGO_ENV = "production"