# Deploy via Amplify - How to debug?

**URL:** <https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229>\
**Category:** support\
**Created:** [June 24, 2022, 5:44am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229 "2022-06-24T05:44:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [June 24, 2022, 5:44am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/1 "2022-06-24T05:44:22Z")

</div>

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.

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 24, 2022, 3:49pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/2 "2022-06-24T15:49:00Z")

</div>

> [@Nogi](#):
>
> My hugo deployment has started to fail

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

Please share a public link to your project repository.

---

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [June 25, 2022, 4:41am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/3 "2022-06-25T04:41:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 25, 2022, 4:47am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/4 "2022-06-25T04:47:34Z")

</div>

Which version are running locally?

---

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [June 25, 2022, 4:53am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/5 "2022-06-25T04:53:46Z")

</div>

Same for both v0.101.0-extended

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 25, 2022, 4:48pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/6 "2022-06-25T16:48:12Z")

</div>

Please post the complete output from running `hugo` locally.

---

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [June 30, 2022, 11:01am UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/7 "2022-06-30T11:01:58Z")

</div>

```auto
% 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

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 30, 2022, 5:16pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/8 "2022-06-30T17:16:47Z")

</div>

This appears somewhere in your content files:

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

```

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

---

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [June 30, 2022, 7:04pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/9 "2022-06-30T19:04:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [July 1, 2022, 3:53pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/10 "2022-07-01T15:53:46Z")

</div>

> [@Nogi](#):
>
> 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](https://levelup.gitconnected.com/how-to-debug-trace-problems-aws-codebuild-ad73c8e62bb8)

---

<div class="post-metadata">

**Author:** ![Nogi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nogi/32/16792_2.png) [@Nogi](https://discourse.gohugo.io/u/Nogi)\
**Post date:** [July 1, 2022, 8:12pm UTC](https://discourse.gohugo.io/t/deploy-via-amplify-how-to-debug/39229/11 "2022-07-01T20:12:22Z")

</div>

Hi, yes I can share privately
