Breaking after hugo upgrade

Hi everyone,
I accidentally ran a script with “brew upgrade” in it. It seems to update hugo and crashes my website. I tried to reinstall hugo with the older version, which is running in my GitHub action, but the site is still showing page not found. I tried both the newest release v0.111.3 and my old version v0.108.0.

I am using the hugo-theme-stack.
How should I fix/prevent this? It happened to me before, and I rebuilt the website anyway because it was much smaller. I can’t now. My site is online.
The current git-repo is: GitHub - chumvan/ personal website built using hugo
I even tried to pull the repo and have it built/serve again. Nothing works.
Appreciate any help, thank you in advance.

I guess you’re creating a fresh clone without updating git submodules, there may be no files located in the themes/hugo-theme-stack folder.

Execute the following commands to update the submodule should fix this issue.

git submodule update --init --recursive

Thanks for your reply, @razon. I thought of that too. I even tried to clone the repo again and have the submodule updated. That did not solve the problem.

Actually, I tried: git clone --recursive <repo> before this one.

I could not reproduce it, works as expected. (Seems to work without updating submodules, just noticed that you’re using Hugo module instead of git submodule, so there is no need to update git submodules).

1 Like

I tested your site, too, and it builds fine with me, so I suspect your problems are not connected to the Hugo version.

My best guess would be some kind of file corruption.

I suggest you try to run

hugo mod clean

Or, if that does not fix it

hugo mod clean --all

A related tip would be to set the HUGO_CACHEDIR to a directory outside of /tmp. Hugo will create a directory inside /tmp if HUGO_CACHEDIR is not set, and I suspect that can be a source of some of these issues (the OS has some scheduled cleanup of temporary files on reboot etc.)


Thank you all for your reply, you are so supportive. I tested cloning the whole project in a linux/amd64 VM, that one works as @razon did. Therefore I assume the problem is with the new release for macOS(darwin). I tried @bep suggestion hugo mod clean with the roll-backed version hugo@0.108.0, it works now. Lesson learned, I should pin hugo and test the new release before doing anything else.

1 Like

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