Anybody else getting a lot of unnecessary "Change detected, rebuilding site."?

I can’t reproduce this with the Hugo HEAD and the Hugo docs site. Is there a (small?) demo site that reproduces the issue?

PS> .\hugo.exe version
Hugo Static Site Generator v0.77.0-DEV-F9E798E8 windows/amd64 BuildDate: 2020-10-14T18:59:32-0500

PS> fsutil behavior query disableLastAccess
DisableLastAccess = 1  (Enabled)

PS> code -v
1.49.3
2af051012b66169dde0c4dfae3f5ef48f787ff69
x64

PS> [Environment]::OSVersion.VersionString
Microsoft Windows NT 10.0.18363.0

It’s happening with my website here: https://github.com/Hrishikesh-K/Portfolio. However, I’m not sure if this is the problem of the website or my system.

1 Like

I’m not able to reproduce the issue with your Portfolio site. Based upon your earlier description, it sounds like it only happens when running VSC. Is that correct? If so, what VSC extensions are you using?

I do get the same unnecessary rebuilds on Windows. I have not investigated this further. I am using Emacs which runs inside WSL2. If I get these multiple rebuilds it is always the same file type. Usually a couple SVGs oder JSON-files. So I guess some program or routine is touching or indexing them. Not sure if this info is of interest here.

As I said, it doesn’t necessarily occur when I open individual files in VSC. It happens when I’ve the folder opened and then open one of the files from my website.

Here are my extensions anyways:

Ok, I did a file audit (Windows). What I found was that these changes come from Hugo, not another program. They are triggered by a normal server update and happen exactly one second later:

Me saving an md file:

Change detected, rebuilding site.
2020-10-16 11:28:09.277 +0200

One Second later a change on a couple other files is detected. For example all my svg or all my json

Change detected, rebuilding site.
2020-10-16 11:28:10.277 +0200

This is the Handle Manipulation, which comes from an attempt to duplicate a handle to an object. This belongs to the first saving.

Protokollname: Security
Quelle:        Microsoft-Windows-Security-Auditing
Datum:         16/10/2020 11:28:09
Ereignis-ID:   4690
Aufgabenkategorie:Handle Manipulation
Ebene:         Informationen
Schlüsselwörter:Überwachung erfolgreich
Benutzer:      Nicht zutreffend
Computer:      PC
Beschreibung:
Es wurde versucht, ein Handle zu einem Objekt zu duplizieren.

Quellhandleinformationen:
	Quellhandle-ID:	0xb9c
	Quellprozess-ID:	0xb98

Neue Handleinformationen:
	Zielhandle-ID:	0x6114
	Zielprozess-ID:	0x4

Source Process ID 0xb98 is PID 2968 and this was Hugo
Target Process ID 0x4 is PID 4 and this is System

After this, each file gets four Event IDs, 4658, 4656, 4663, and 4658 from Task Category File System.

1 second later, the procedure is repeated.

To sum up, I have no idea whats going on, but the files are not really changed though a change is detected. I assume it relates to this Handle Manipulation. Maybe it has something todo with caching.

Well, to add to the above reply, when I monitored file access in my post, I also got some hugo.exe entries in the list of programs that wrote to my files. But, I ignored (and later filtered the it from the list) thinking that’s how Hugo works maybe.

Hey folks,

I seem to be having the same issue as HenrySkup. Hugo seems to be rebuilding constantly. I can’t seem to figure out what is causing it. I did not encounter this issue with Hugo previously. I’m curious why this has started to happen with recent versions. I may to revert back to an early version.

Remedies Attempted

I’ve tried running hugo server inside of the VS Code terminal, Terminal and iTerm2. The issue persists for all terminals. I’ve also tried disabling all extensions inside of VS Code.

Tech Stack

OS: macOS Catalina (10.15.6)
Browser: Firefox (81.0.2)
Editor: VS Code (1.50.1)
Hugo version: v0.76.5

Has anyone found a solution for this issue?

I am pretty sure that the linked post will have updates if updates are found to this issue. Please add your findings to that post to keep people already involved updated. New posts will not send them notifications.

Will do.

@jacobproffer

I moved all the posts from the other topic to this one, as you asked.

@jacobproffer

I also suggest that you either share the actual project or if that’s not possible then share a minimal repo that reproduces the problem on MacOS, for people to see what’s going on.

Here are a few public Hugo projects that I’ve worked on recently:

Most of my other projects are private.

I also want to note that I’ve checked for auto-saving in VS Code and that has been off.

I’m home for lunch at the moment and brought up my blog in VS Code (1.50.0 / Latest version) on my personal laptop.

The Hugo version is still on 0.70.0 on this laptop and I am not experiencing the constant rebuilding.

Hi all,

I’m joining this discussion a little late, but I am getting these rebuild loops too, using Hugo version 0.101.0 in a Docker image klakegg/hugo:0.101.0.

Was there ever a resolution to these issues?

EDIT 1:

To clarify, I am developing in VS Code, but am running Hugo from an independent Terminal window. I have tried closing VS Code before starting the docker image but the looping persists.