hugo: Hugo stuck on "Start building sites …"

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.80.0-792EF0F4 linux/amd64 BuildDate: 2020-12-31T13:37:58Z

Does this issue reproduce with the latest release?

Yes

Context

Hugo running as a container in Gitlab pages, container base is klakegg/hugo:debian but it doesn’t seem to matter.

Description

Every once in a while (actually, every single time when run in Gitlab) hugo will be stuck on Start building sites … message.

I was able to run in --debugand got the following :

INFO 2021/01/21 17:14:55 Using config file:
Start building sites …
INFO 2021/01/21 17:14:55 syncing static files to /public/

Then I wanted to reproduce the issue home and it was a little bit trickier, it happens less often, but running site generation in a whileloop does the trick. So here is what I was able to catch with strace, it’s stuck with repeating FUTEX_WAIT_PRIVATE

[...]
newfstatat(AT_FDCWD, "/public/", {st_mode=S_IFDIR|0755, st_size=104, ...}, 0) = 0
futex(0x3134988, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x3134988, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x3134988, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xc000058548, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x3134988, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x3134988, FUTEX_WAIT_PRIVATE, 0, NULL^Cstrace: Process 101 detached

I’m running hugowith the following flags to test :

hugo --debug --noChmod --noTimes -d ../public

Also, the site is bound to the container from a local directory

I’m not sure what other parts of strace would be relevant.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 24 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@jmooring I have found the stupid culprits (2) … Will create a PR soon.

@SMUsamaShah From what I can see, the image in content dir is causing the problem. Try it yourself:

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

The build hangs.

Now move the image and try again.

mv content/me.jpg static/images/
while true; do rm -rf public && GOMAXPROCS=1 hugo --debug; done

The build completes.

Note that a workaround for the above would be to always make sure that /public exists before you start the build.