With hugo --gc, panic: Readdirnames with positive n not implemented

@bep @jmooring Known issue or do you need me to do up a test case, and more details, etc?

Start building sites … 
hugo v0.97.0-c07f3626e7c8160943591f4d209977efa02c3dca+extended linux/amd64 BuildDate=2022-04-14T08:45:07Z VendorInfo=gohugoio
INFO 2022/04/15 12:43:08 syncing static files to /
Total in 1201 ms
panic: Readdirnames with positive n not implemented

goroutine 1 [running]:
github.com/bep/overlayfs.(*Dir).Readdirnames(0x96c96a?, 0x27c4ec0?)
        /go/pkg/mod/github.com/bep/overlayfs@v0.4.0/overlayfs.go:229 +0x11e
github.com/gohugoio/hugo/cache/filecache.(*Cache).Prune.func1({0x0?, 0xc0006a96e0?}, {0x7ff544d046d8, 0xc0001319b0}, {0xc0006a96e0?, 0xc002a1f840?})
        /root/project/hugo/cache/filecache/filecache_pruner.go:73 +0x270
github.com/spf13/afero.walk({0x27c58c0, 0xc0006b0120}, {0x0, 0x0}, {0x7ff544d046d8, 0xc0001319b0}, 0xc002a1f900)
        /go/pkg/mod/github.com/spf13/afero@v1.8.2/path.go:44 +0x78
github.com/spf13/afero.Walk({0x27c58c0, 0xc0006b0120}, {0x0, 0x0}, 0xc002a1f900)
        /go/pkg/mod/github.com/spf13/afero@v1.8.2/path.go:105 +0x88
github.com/gohugoio/hugo/cache/filecache.(*Cache).Prune(0x51101a?, 0x80?)
        /root/project/hugo/cache/filecache/filecache_pruner.go:59 +0x85
github.com/gohugoio/hugo/cache/filecache.Caches.Prune(0xc000b4d700?)
        /root/project/hugo/cache/filecache/filecache_pruner.go:34 +0xae
github.com/gohugoio/hugo/hugolib.(*HugoSites).GC(...)
        /root/project/hugo/hugolib/prune_resources.go:18
github.com/gohugoio/hugo/commands.(*commandeer).fullBuild(0xc0004e7f00, 0x0)
        /root/project/hugo/commands/hugo.go:337 +0x45e
github.com/gohugoio/hugo/commands.(*commandeer).build(0xc0004e7f00)
        /root/project/hugo/commands/hugo.go:502 +0x9a
github.com/gohugoio/hugo/commands.(*commandsBuilder).newHugoCmd.func1(0xc000485180, {0x2214196?, 0x4?, 0x4?})
        /root/project/hugo/commands/commands.go:172 +0x16a
github.com/spf13/cobra.(*Command).execute(0xc000485180, {0xc000126010, 0x4, 0x4})
        /go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000485180)
        /go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/gohugoio/hugo/commands.Execute({0xc000126010, 0x4, 0x4})
        /root/project/hugo/commands/hugo.go:93 +0xb4
main.main()
        /root/project/hugo/main.go:23 +0x57
1 Like

It looks like this issue was already recognized and fixed on the 0.98.0 DEV version: panic: Readdirnames with positive n not implemented · Issue #9783 · gohugoio/hugo · GitHub

2 Likes

I experienced this too after upgrading to 0.97.0 but only in one site.

Command:

hugo server --bind 0.0.0.0 --baseURL http://$yoolocal --liveReloadPort 1313 --buildDrafts --buildExpired --buildFuture --cleanDestinationDir --disableFastRender --gc --printI18nWarnings --ignoreCache --noHTTPCache --printPathWarnings --panicOnWarning --printMemoryUsage

This is the result:

hugo: downloading modules …
hugo: collected modules in 34235 ms
Start building sites … 
hugo v0.97.0-c07f3626e7c8160943591f4d209977efa02c3dca+extended linux/amd64 BuildDate=2022-04-14T08:45:07Z VendorInfo=gohugoio
Built in 1041 ms
panic: Readdirnames with positive n not implemented

goroutine 1 [running]:
github.com/bep/overlayfs.(*Dir).Readdirnames(0x96c96a?, 0x27c4ec0?)
	/go/pkg/mod/github.com/bep/overlayfs@v0.4.0/overlayfs.go:229 +0x11e
github.com/gohugoio/hugo/cache/filecache.(*Cache).Prune.func1({0x0?, 0xc000716ae0?}, {0x7f09bef80368, 0xc0013a11d0}, {0xc000716ae0?, 0xc000c897b0?})
	/root/project/hugo/cache/filecache/filecache_pruner.go:73 +0x270
github.com/spf13/afero.walk({0x27c58c0, 0xc000718760}, {0x0, 0x0}, {0x7f09bef80368, 0xc0013a11d0}, 0xc000c89870)
	/go/pkg/mod/github.com/spf13/afero@v1.8.2/path.go:44 +0x78
github.com/spf13/afero.Walk({0x27c58c0, 0xc000718760}, {0x0, 0x0}, 0xc000c89870)
	/go/pkg/mod/github.com/spf13/afero@v1.8.2/path.go:105 +0x88
github.com/gohugoio/hugo/cache/filecache.(*Cache).Prune(0xc000c89910?, 0x0?)
	/root/project/hugo/cache/filecache/filecache_pruner.go:59 +0x85
github.com/gohugoio/hugo/cache/filecache.Caches.Prune(0x1fdbe80?)
	/root/project/hugo/cache/filecache/filecache_pruner.go:34 +0xae
github.com/gohugoio/hugo/hugolib.(*HugoSites).GC(...)
	/root/project/hugo/hugolib/prune_resources.go:18
github.com/gohugoio/hugo/commands.(*commandeer).fullBuild(0xc000644300, 0x0)
	/root/project/hugo/commands/hugo.go:337 +0x45e
github.com/gohugoio/hugo/commands.(*commandeer).serverBuild(0xc000644300)
	/root/project/hugo/commands/hugo.go:560 +0x7b
github.com/gohugoio/hugo/commands.(*serverCmd).server.func2(0xc000644300, 0x224e0db?)
	/root/project/hugo/commands/server.go:261 +0xb2
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc00007edc0, 0xc00040bb80, {0xc00021a500?, 0x9a0e60?, 0xc000783d00?})
	/root/project/hugo/commands/server.go:266 +0x1eb
github.com/gohugoio/hugo/commands.(*commandsBuilder).newServerCmdSignaled.func1(0xc00040bb80?, {0xc0003f0b40?, 0x12?, 0x12?})
	/root/project/hugo/commands/server.go:95 +0x36
github.com/spf13/cobra.(*Command).execute(0xc00040bb80, {0xc0003f0a20, 0x12, 0x12})
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00062ca00)
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/gohugoio/hugo/commands.Execute({0xc00003c150, 0x13, 0x13})
	/root/project/hugo/commands/hugo.go:93 +0xb4
main.main()
	/root/project/hugo/main.go:23 +0x57

Affected project repo: Yelosan Publishing / hugo-semantic-web-docs · GitLab

EDIT: Since I moved to GitLab with Cloudflare Pages hosting, it’s generally fine since CFP doesn’t use flags in hugo. I only encountered it with one site and when locally testing.

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