Home
Support Forums

Deploying failed with a hugo theme from github

I tried deploying airspace-hugo theme from github. I am getting this result, please help me;

4:09:30 AM: ​
4:09:30 AM: Error message
4:09:30 AM: Command failed with exit code 255: cd exampleSite && hugo --gc --themesDir …/…
4:09:30 AM: ​
4:09:30 AM: Error location
4:09:30 AM: In build.command from netlify.toml:
4:09:30 AM: cd exampleSite && hugo --gc --themesDir …/…
4:09:30 AM: ​
4:09:30 AM: Resolved config
4:09:30 AM: build:
4:09:30 AM: command: cd exampleSite && hugo --gc --themesDir …/…
4:09:30 AM: commandOrigin: config
4:09:30 AM: environment:
4:09:30 AM: - HUGO_VERSION
4:09:30 AM: - HUGO_THEME
4:09:30 AM: - HUGO_BASEURL
4:09:30 AM: publish: /opt/build/repo/exampleSite/public
4:09:30 AM: publishOrigin: config
4:09:30 AM: redirects:
4:09:31 AM: - from: /de/*
status: 404
to: /de/404.html
- from: /fr/*
status: 404
to: /fr/404.html
- from: /it/*
status: 404
to: /it/404.html
- from: /*
status: 404
to: /404.html
redirectsOrigin: config
Caching artifacts
4:09:31 AM: Started saving build plugins
4:09:31 AM: Finished saving build plugins
4:09:31 AM: Started saving pip cache
4:09:31 AM: Finished saving pip cache
4:09:31 AM: Started saving emacs cask dependencies
4:09:31 AM: Finished saving emacs cask dependencies
4:09:31 AM: Started saving maven dependencies
4:09:31 AM: Finished saving maven dependencies
4:09:31 AM: Started saving boot dependencies
4:09:31 AM: Finished saving boot dependencies
4:09:31 AM: Started saving rust rustup cache
4:09:31 AM: Finished saving rust rustup cache
4:09:31 AM: Started saving go dependencies
4:09:31 AM: Finished saving go dependencies
4:09:33 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:09:33 AM: Creating deploy upload records
4:09:33 AM: Failing build: Failed to build site
4:09:33 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:09:34 AM: Finished processing build request in 15.569454243s

Thanks

Hi @moses

Are you able to share your git repository?
Also your build settings.

1 Like

This is my netlify.toml ;

[build]
command = “hugo --minify --gc”
publish = “public”
[build.environment]
HUGO_VERSION = “0.87.0”
HUGO_THEME = “repo”
HUGO_BASEURL = “/”

[[headers]]
for = “/*”
[headers.values]
Referrer-Policy = “same-origin”
Strict-Transport-Security = “max-age=31536000; includeSubDomains; preload”
X-Frame-Options = “DENY”
X-XSS-Protection = “1; mode=block”

There is a discrepancy in the information you have provided.

You say this is the build command in your netlify.toml

however the build command in the log in your first post shows a different command.

1 Like

Thanks but that is what is in my build settings. And that is the log displayed

Hi there, @moses

Sorry to hear you are stuck. We have lots of great resources that offer some debugging advice for you to work through. I would recommend starting with the following two:

If you work through those and are still having difficulties, please follow up here with the steps you have tried, your Netlify site name, and your git repository.

Thanks!