My hugo deployment has started to fail and I am not sure why or where to go to diagnose. I can build locally just fine without error. But when deployed via AWS Amplify it fails and doesn’t really provide a useful error.
2022-06-22T06:24:52.008Z [INFO]: ## Starting Frontend Build
2022-06-22T06:24:52.008Z [INFO]: # Starting phase: preBuild
# Executing command: curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*hugo_extended.*_Linux-64bit\.tar\.gz" | cut -d ":" -f 2,3 | tr -d '\"' | wget -qi -
2022-06-22T06:24:52.628Z [INFO]: # Executing command: tar -xzf ""
2022-06-22T06:24:53.003Z [INFO]: # Executing command: chmod +x hugo
2022-06-22T06:24:53.004Z [INFO]: # Executing command: mv hugo /usr/bin/hugo
2022-06-22T06:24:53.066Z [INFO]: # Executing command: rm -rf "./hugo_extended_0.101.0_Linux-64bit.tar.gz"
2022-06-22T06:24:53.094Z [INFO]: # Executing command: hugo version
2022-06-22T06:24:53.119Z [INFO]: hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
2022-06-22T06:24:53.121Z [INFO]: # Completed phase: preBuild
# Starting phase: build
2022-06-22T06:24:53.121Z [INFO]: # Executing command: hugo
2022-06-22T06:24:53.325Z [INFO]: Start building sites …
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
2022-06-22T06:27:21.622Z [WARNING]: /codebuild/output/src207717135/src/mysite.net/amplify.sh: line 33: 2362 Killed hugo
2022-06-22T06:27:21.683Z [ERROR]: !!! Build failed
2022-06-22T06:27:21.684Z [ERROR]: !!! Non-Zero Exit Code detected
2022-06-22T06:27:21.684Z [INFO]: # Starting environment caching...
2022-06-22T06:27:21.696Z [INFO]: # Uploading environment cache artifact...
2022-06-22T06:27:21.805Z [INFO]: # Environment caching completed
Terminating logging...
Because my theme requires Hugo extended, i use the following amplify config:
version: 1
frontend:
phases:
preBuild:
commands:
- curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*hugo_extended.*_Linux-64bit\.tar\.gz" | cut -d ":" -f 2,3 | tr -d '\\"' | wget -qi -
- tar -xzf "$(find . -name "*Linux-64bit.tar.gz")"
- chmod +x hugo
- mv hugo /usr/bin/hugo
- rm -rf "$(find . -name '*Linux-64bit.tar.gz')"
- hugo version
build:
commands:
- hugo version
- hugo --cleanDestinationDir
artifacts:
baseDirectory: public
files:
- '**/*'
cache:
paths: []
This would be so much easier if i could get it to fail locally but it just doesn’t.