Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.65.1 (ubuntu) panic: runtime error: index out of range [0] with length 0 #6924

Closed
knoobie opened this issue Feb 21, 2020 · 2 comments
Closed

Comments

@knoobie
Copy link

knoobie commented Feb 21, 2020

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

Hugo Static Site Generator v0.65.1 linux/amd64 BuildDate: 2020-02-20T17:50:29Z

Sorry, I can't interpret the exception :/ Yesterday everything was okay.

Stacktrace

panic: runtime error: index out of range [0] with length 0

goroutine 48 [running]:
github.com/gohugoio/hugo/hugolib.(*pageState).shiftToOutputFormat(0xc000a34330, 0x1, 0x0, 0xc0009fd798, 0xf78807)
/build/hugo/parts/hugo/build/hugolib/page.go:903 +0x358
github.com/gohugoio/hugo/hugolib.(*pageState).initOutputFormat(0xc000a34330, 0xc0009fd701, 0x0, 0xc0008d4990, 0xc0008d4401)
/build/hugo/parts/hugo/build/hugolib/page.go:448 +0x42
github.com/gohugoio/hugo/hugolib.(*Site).preparePagesForRender.func1(0xc000a34330, 0xf7b2a9)
/build/hugo/parts/hugo/build/hugolib/hugo_sites.go:745 +0x49
github.com/gohugoio/hugo/hugolib.(*pageMap).withEveryBundlePage.func1(0xc0008d2130, 0xd, 0xc0008d43f0, 0xc0009fd9a8)
/build/hugo/parts/hugo/build/hugolib/content_map_page.go:686 +0x37
github.com/gohugoio/hugo/hugolib.contentTrees.Walk.func1(0xc0008d2130, 0xd, 0x18c24e0, 0xc0008d43f0, 0x1b79956)
/build/hugo/parts/hugo/build/hugolib/content_map.go:852 +0x54
github.com/armon/go-radix.recursiveWalk(0xc0008d4420, 0xc0009fd938, 0x18c24e0)
/build/hugo/parts/hugo/go/pkg/mod/github.com/armon/[email protected]/radix.go:519 +0xf0
github.com/armon/go-radix.recursiveWalk(0xc000029560, 0xc0009fd938, 0x203000)
/build/hugo/parts/hugo/go/pkg/mod/github.com/armon/[email protected]/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc0007a3410, 0xc0009fd938, 0x0)
/build/hugo/parts/hugo/go/pkg/mod/github.com/armon/[email protected]/radix.go:525 +0x7e
github.com/armon/go-radix.(*Tree).Walk(...)
/build/hugo/parts/hugo/go/pkg/mod/github.com/armon/[email protected]/radix.go:447
github.com/gohugoio/hugo/hugolib.contentTrees.Walk(0xc0007a97a0, 0x4, 0x4, 0xc0009fd978)
/build/hugo/parts/hugo/build/hugolib/content_map.go:850 +0x67
github.com/gohugoio/hugo/hugolib.(*pageMap).withEveryBundlePage(0xc0007a5100, 0xc0008839b8)
/build/hugo/parts/hugo/build/hugolib/content_map_page.go:684 +0x6d
github.com/gohugoio/hugo/hugolib.(*Site).preparePagesForRender(0xc00077cb40, 0xc00098b201, 0x0, 0x4, 0xc00098b110)
/build/hugo/parts/hugo/build/hugolib/hugo_sites.go:744 +0x84
github.com/gohugoio/hugo/hugolib.(*HugoSites).render(0xc000748be0, 0xc0006f4b80, 0x42fc6a, 0xc000883c01)
/build/hugo/parts/hugo/build/hugolib/hugo_sites_build.go:294 +0x1cc
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func4()
/build/hugo/parts/hugo/build/hugolib/hugo_sites_build.go:133 +0x3c
runtime/trace.WithRegion(0x1fd83e0, 0xc00070ea80, 0x1b85cfc, 0x6, 0xc000883e60)
/snap/go/5364/src/runtime/trace/annotation.go:137 +0x115
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc000748be0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/build/hugo/parts/hugo/build/hugolib/hugo_sites_build.go:135 +0x6d4
github.com/gohugoio/hugo/commands.(*commandeer).buildSites(...)
/build/hugo/parts/hugo/build/commands/hugo.go:710
github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3(0xc000650f68, 0x4)
/build/hugo/parts/hugo/build/commands/hugo.go:322 +0x96
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00070ea50, 0xc000716bb0)
/build/hugo/parts/hugo/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
/build/hugo/parts/hugo/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:54 +0x66

@bep bep added the Bug label Feb 21, 2020
@bep bep added this to the v0.65.2 milestone Feb 21, 2020
@bep bep closed this as completed in 4c2a0de Feb 21, 2020
bep added a commit that referenced this issue Feb 21, 2020
A page needs its output formats even if it should not be rendered or its resources should not be published.

Fixes #6924
@knoobie
Copy link
Author

knoobie commented Feb 21, 2020

@bep Thank you very much for the quick fix! Everything is working again.

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants