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:
https://app.netlify.com/sites/quizzical-wiles-50bee1/deploys/63c435b8928f8d0009da8d71

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 (https://ntl.fyi/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:
https://app.netlify.com/sites/quizzical-wiles-50bee1/deploys/63c431b28987010008885c28

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

GIT_CONFIG_NOSYSTEM=true
HUGO_VERSION=0.55.6

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

Thanks!

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:
HUGO_ENABLEGITINFO = "true"

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:

[context.production.environment]
HUGO_VERSION = "0.55.6"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "false"