Possible explanations for "stuck Hugo builds" on Netlify

Hey folks!

I’m writing this post as a Support Engineer from Netlify. Some users are complaining about their builds being “stuck”. The reason why I’m bringing this to Hugo forums is to try and get some possible explanations as to why this can happen.

I’ve tried to narrow down the problems on Netlify end, but haven’t been able to reach to a conclusion. Not saying this is a Hugo problem, could be a change on our build systems, but I’d need some help narrowing it down. So, I’m looking for ideas to try and look for that might be causing this issue. Any advise is going to be super helpful.

For some context, this is the thread:

The problem is, the builds work fine once users trigger it with clearing cache, but if they don’t, they only get this:

> Start building sites …
> hugo v0.85.0-724D5DB5+extended linux/amd64 BuildDate=2021-07-05T10:46:28Z VendorInfo=gohugoio

And that stays frozen for an indefinite time. We tried changing Hugo versions, tried deleting cache with rm -rf, etc. Nothing works except for the clear cache button. More so, this is not happening for each build, some builds do work with cache.

So, is there something specific that might exist in the cache that could prevent Hugo from functioning properly? We usually cache node_modules folder, and the user’s repo. Some of them were using a plugin, so that plugin was likely caching resources folder too.

Are there any other users here with the same issue?

I have a few Hugo sites of myself, even tested a repo of one of the users, but all of it works fine.

Looking forward to any advice that I can collect.

How are they invoking their build script commands?

In the past I’ve also encountered this sort of error.
I think that it happened to me sometime last June or late May and it was due to some change in the command syntax used in netlify.toml.

In the past command = "command.sh"
used to work fine but now one needs to use:
command = “CI= sh ./command.sh”`

I’m not saying that the above is 100% the culprit for the stuck builds in this case, however at least one user in the linked Netlify forum topic does not use the above syntax for the build command.

Try asking your users and let us know.

I’m not able to guess here – none of the many Hugo sites I somehow manage on Netlify (a fair amount) have such an issue.

I would suggest that Netlify allows for a way to get better runtime info about these stuck processes – e.g. a way to do a kill -SIGABRT on the Hugo process in question.

In my cases command="command.sh" still works. I am using #!/usr/bin/env bash as “hashbang” in the command file.

On the other side, I had issues (see my other post) until I updated Hugo to 0.91.0 on Netlify. Maybe something is up in the lower versions?

On Netlify I use Hugo v.0.81.0 for a project that deploys daily, without issue.

February 19, 2021 0.81.0
September 2, 2021 0.88.0

that somehow fits into my “module does not update” issue.

One of the example projects that was getting stuck is:

git clone --recurse-submodules https://github.com/champagnealexandre/alexandrechampagne.io
cd alexandrechampagne.io
while true; do rm -rf public && GOMAXPROCS=1 hugo --debug; done

The build is stuck. This is a Hugo problem, not a Netlify problem. See:

Ctrl + C to kill the process, then:

rm content/_redirects
while true; do rm -rf public && GOMAXPROCS=1 hugo --debug; done

The build is no longer stuck.

Wow, thank you all for contributing. That’s super helpful. So, based on the last comment, currently we just wait for this bug to get fixed?

This should be fixed in fix/freeze 8166 by bep · Pull Request #9314 · gohugoio/hugo · GitHub – I will try to get it out in a release tomorrow.

That said, debugging this myself I had to do a kill -SIGABRT <pid> – which would be superuseful to have on Netlify, too … At least for Go binaries, you get very detailed info (including line numbers).

1 Like

Well, none of the users has come back with a confirmation that it’s working fine for them, but I’d assume it is.

Thank you so much to everyone for their inputs and bep for the quick fix!


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.