"build.command" failed | Error message Command failed with exit code 1: hugo --gc --minify -b $UR

Hi everyone,
I was crazy trouble shooting this issue:

8:43:06 PM: “build.command” failed
8:43:06 PM: ────────────────────────────────────────────────────────────────
8:43:06 PM: ​
8:43:06 PM: Error message
8:43:06 PM: Command failed with exit code 1: hugo --gc --minify -b $URL (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
8:43:06 PM: ​
8:43:06 PM: Error location
8:43:06 PM: In build.command from netlify.toml:
8:43:06 PM: hugo --gc --minify -b $URL
8:43:06 PM: ​
8:43:06 PM: Resolved config
8:43:06 PM: build:
8:43:06 PM: command: hugo --gc --minify -b $URL
8:43:06 PM: commandOrigin: config
8:43:06 PM: environment:
8:43:06 PM: - CI
8:43:06 PM: - HUGO_VERSION
8:43:06 PM: - HUGO_ENV
8:43:06 PM: publish: /opt/build/repo/public
8:43:06 PM: publishOrigin: config
8:43:06 PM: plugins:
8:43:06 PM: - inputs:
8:43:06 PM: debug: true
8:43:06 PM: origin: config
8:43:06 PM: package: netlify-plugin-hugo-cache-resources
8:43:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:43:07 PM: Failing build: Failed to build site
8:43:08 PM: Finished processing build request in 30.66s

What do I need to do to debug this? Please also view my github link: https://github.com/Anran0716/AnranZheng/blob/master/netlify.toml

Thanks so much!

Please don’t trim the important parts of the build log, and if you do, please share your site name so we can check it.

Sure. It should be https://anranz.netlify.app/

The error is:

access denied: "WC_POST_CSS" is not whitelisted in policy "security.funcs.getenv"

This is not a Netlify issue, but an error with your Hugo configuration. Check: Hugo's Security Model | Hugo

If you need further help, it’s worth contacting theme’s author.

still not sure how to revise … Can you be more specific? Thanks

Referring to documentations is a good idea in general, but in your case, you could possibly try adding the following to your Hugo config:

    getenv = ['^HUGO_', '^CI$', 'WC_POST_CSS']

If it still doesn’t work, as mentioned above, contact the theme’s developer. This is not a Netlify issue.