Deploy via Amplify - How to debug?

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.

When did it start to fail?
What changes did you make prior to the failure?

Please share a public link to your project repository.

Only started to fail in the past week. The only changes were the addition of more content.

Configs, Themes, etc… were left untouched.

It’s a private repo atm so unable to share publicly. Is there a way to force a more verbose logging? —verbose or —verboselogs isn’t giving me anymore information than what i have already posted.

Which version are running locally?

Same for both v0.101.0-extended

Please post the complete output from running hugo locally.

% hugo --verbose
Start building sites … 
hugo v0.101.0+extended darwin/amd64 BuildDate=unknown
INFO 2022/06/30 21:01:10 syncing static files to /
INFO 2022/06/30 21:01:11 Downloading: https://publish.twitter.com/oembed?dnt=false&url=https%3A%2F%2Ftwitter.com%2FSanDiegoZoo%2Fstatus%2F1453110110599868418 ...

                   |  EN   
-------------------+-------
  Pages            | 2549  
  Paginator pages  |  538  
  Non-page files   | 3739  
  Static files     |    1  
  Processed images | 2031  
  Aliases          |  881  
  Sitemaps         |    1  
  Cleaned          |    0  

Total in 8485 ms

This appears somewhere in your content files:

{{< tweet user="SanDiegoZoo" id="1453110110599868418" >}}

Remove it, push the changes, and see if the site builds without error.

No same issue. That’s in my elements.md and has always been there. If I remove it altogether still doesn’t build on amplify. Is there a way to get a more detailed log?

You can run hugo with the --debug option, but I suspect that’s not going to help.

Can you share your repository privately? I know you have no problems locally, but I’d like to see if anything catches my attention.

This article about debugging codebuild might be relevant/helpful:
https://levelup.gitconnected.com/how-to-debug-trace-problems-aws-codebuild-ad73c8e62bb8

Hi, yes I can share privately