Skip to content

panic: recovered from errgroup.Group: assignment to entry in nil map #13853

@martinjagodic

Description

@martinjagodic

I get the error in the title with the latest release. It's reported already in #13810, a fix was merged, but it seems it's not fixing the problem. This does not happen on all projects, but I can't identify the reason.

entire log
hugo
Start building sites … 
hugo v0.148.0+extended+withdeploy darwin/arm64 BuildDate=2025-07-08T13:34:49Z VendorInfo=brew

Total in 137 ms
panic: recovered from errgroup.Group: recovered from errgroup.Group: assignment to entry in nil map
        goroutine 25 [running]:
        runtime/debug.Stack()
                runtime/debug/stack.go:26 +0x64
        golang.org/x/sync/errgroup.(*Group).add.func1.1()
                golang.org/x/[email protected]/errgroup/errgroup.go:117 +0x220
        panic({0x1071acb40?, 0x10946a190?})
                runtime/panic.go:792 +0x124
        github.com/gohugoio/hugo/hugolib.(*pageState).setMetaPost.func1(...)
                github.com/gohugoio/hugo/hugolib/page__meta.go:313
        github.com/gohugoio/hugo/common/maps.(*Ordered[...]).Range(...)
                github.com/gohugoio/hugo/common/maps/ordered.go:132
        github.com/gohugoio/hugo/hugolib.(*pageState).setMetaPost(0x14000edd320, 0x1400169a4a0)
                github.com/gohugoio/hugo/hugolib/page__meta.go:305 +0xf78
        github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).applyAggregates.func1({0x140019c6d70, 0x39}, {0x107755e20, 0x14000edd320}, 0x78?)
                github.com/gohugoio/hugo/hugolib/content_map_page.go:1446 +0x3a0
        github.com/gohugoio/hugo/hugolib/doctree.(*NodeShiftTreeWalker[...]).Walk.func1({0x1073f5360, 0x14001d6e678})
                github.com/gohugoio/hugo/hugolib/doctree/nodeshifttree.go:377 +0x108
        github.com/armon/go-radix.recursiveWalk(0x14002251bf0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:523 +0x48
        github.com/armon/go-radix.recursiveWalk(0x14002251bc0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140020479e0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140020476b0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140020e7020, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x14001c12390, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140022504b0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x14002250480, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140019017a0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x14001f6bd40, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x140017083f0, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.recursiveWalk(0x1400028a660, 0x14001125da0)
                github.com/armon/[email protected]/radix.go:532 +0xa0
        github.com/armon/go-radix.(*Tree).Walk(...)
                github.com/armon/[email protected]/radix.go:453
        github.com/gohugoio/hugo/hugolib/doctree.(*NodeShiftTreeWalker[...]).Walk(0x107762f80?, {0x3?, 0x140004772e8?})
                github.com/gohugoio/hugo/hugolib/doctree/nodeshifttree.go:387 +0xf0
        github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).applyAggregates(0x14000429480)
                github.com/gohugoio/hugo/hugolib/content_map_page.go:1523 +0x230
        github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).assemblePagesStep1(0x14000429480, {0x140000b4700?, 0x0?})
                github.com/gohugoio/hugo/hugolib/content_map_page.go:1867 +0x44
        github.com/gohugoio/hugo/hugolib.(*HugoSites).assemble.func1()
                github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:304 +0x28
        github.com/gohugoio/hugo/common/para.(*errGroupRunner).Run.func1()
                github.com/gohugoio/hugo/common/para/para.go:52 +0x2c
        golang.org/x/sync/errgroup.(*Group).add.func1()
                golang.org/x/[email protected]/errgroup/errgroup.go:128 +0x88
        created by golang.org/x/sync/errgroup.(*Group).add in goroutine 23
                golang.org/x/[email protected]/errgroup/errgroup.go:96 +0x80

        goroutine 23 [running]:
        runtime/debug.Stack()
                runtime/debug/stack.go:26 +0x64
        golang.org/x/sync/errgroup.(*Group).add.func1.1()
                golang.org/x/[email protected]/errgroup/errgroup.go:117 +0x220
        panic({0x107459de0?, 0x14001609b90?})
                runtime/panic.go:792 +0x124
        golang.org/x/sync/errgroup.(*Group).Wait(0x140012bfe60)
                golang.org/x/[email protected]/errgroup/errgroup.go:70 +0x7c
        github.com/gohugoio/hugo/hugolib.(*HugoSites).assemble(0x140007a4c60, {0x10774c968, 0x1095717c0}, {0x107759eb0?, 0x140001191a0?}, 0x140014e8bc0)
                github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:307 +0x338
        github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func4(...)
                github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:152
        github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0x140007a4c60, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, {0x0, ...})
                github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:159 +0x58c
        github.com/gohugoio/hugo/commands.(*hugoBuilder).buildSites(0x0?, 0x0)
                github.com/gohugoio/hugo/commands/hugobuilder.go:425 +0xcc
        github.com/gohugoio/hugo/commands.(*hugoBuilder).fullBuild.func3()
                github.com/gohugoio/hugo/commands/hugobuilder.go:542 +0x24
        golang.org/x/sync/errgroup.(*Group).add.func1()
                golang.org/x/[email protected]/errgroup/errgroup.go:128 +0x88
        created by golang.org/x/sync/errgroup.(*Group).add in goroutine 1
                golang.org/x/[email protected]/errgroup/errgroup.go:96 +0x80


goroutine 1 [running]:
golang.org/x/sync/errgroup.(*Group).Wait(0x14000118fc0)
        golang.org/x/[email protected]/errgroup/errgroup.go:70 +0x7c
github.com/gohugoio/hugo/commands.(*hugoBuilder).fullBuild(0x14000a01980, 0x0)
        github.com/gohugoio/hugo/commands/hugobuilder.go:564 +0x288
github.com/gohugoio/hugo/commands.(*hugoBuilder).build(0x14000a01980)
        github.com/gohugoio/hugo/commands/hugobuilder.go:397 +0x5c
github.com/gohugoio/hugo/commands.(*rootCommand).Run.func1(0x14000a01980?, 0x14000146380?)
        github.com/gohugoio/hugo/commands/commandeer.go:382 +0x78
github.com/gohugoio/hugo/commands.(*rootCommand).Run(0x14000a36000, {0x0?, 0x0?}, 0x14000146380, {0x0?, 0x4b63c922e655ddbc?, 0x14000a9d9f0?})
        github.com/gohugoio/hugo/commands/commandeer.go:387 +0xf8
github.com/bep/simplecobra.(*Commandeer).compile.func1(0x14000a3c100?, {0x1095717c0?, 0x4?, 0x106614d71?})
        github.com/bep/[email protected]/simplecobra.go:113 +0x54
github.com/spf13/cobra.(*Command).execute(0x14000a38008, {0x140001ac0c0, 0x0, 0x0})
        github.com/spf13/[email protected]/command.go:1015 +0x844
github.com/spf13/cobra.(*Command).ExecuteC(0x14000a38008)
        github.com/spf13/[email protected]/command.go:1148 +0x384
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        github.com/spf13/[email protected]/command.go:1080
github.com/bep/simplecobra.(*Exec).Execute(0x14000a0a220, {0x10774c968?, 0x1095717c0?}, {0x140001ac0c0?, 0x140000b4678?, 0x10432eee4?})
        github.com/bep/[email protected]/simplecobra.go:155 +0xb4
github.com/gohugoio/hugo/commands.Execute({0x140001ac0c0, 0x0, 0x0})
        github.com/gohugoio/hugo/commands/commandeer.go:68 +0x27c
main.main()
        github.com/gohugoio/hugo/main.go:25 +0x70

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

$ hugo version
hugo v0.148.0+extended+withdeploy darwin/arm64 BuildDate=2025-07-08T13:34:49Z VendorInfo=brew

Does this issue reproduce with the latest release?

yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions