Hugo: panic: invalid taxonomy state for ...

Created on 28 Apr 2019  路  3Comments  路  Source: gohugoio/hugo

I just upgraded to the latest version of hugo:

$ hugo version
Hugo Static Site Generator v0.55.4-57900417 linux/amd64 BuildDate: 2019-04-25T07:38:50Z

And this is the error which I am getting while running the build:

$ hugo

panic: invalid taxonomy state for "/tmp/site/content/predavane/_index.md" with sections [predavane]

goroutine 70 [running]:
github.com/gohugoio/hugo/hugolib.(*HugoSites).createMissingPages(0xc0000b30a0, 0x0, 0x0)
    /root/project/hugo/hugolib/hugo_sites.go:663 +0x10f3
github.com/gohugoio/hugo/hugolib.(*HugoSites).assemble(0xc0000b30a0, 0xc0005a8200, 0xc00006fc70, 0x20)
    /root/project/hugo/hugolib/hugo_sites_build.go:245 +0x13a
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2.2()
    /root/project/hugo/hugolib/hugo_sites_build.go:98 +0x3c
runtime/trace.WithRegion(0x1243840, 0xc0005a6c90, 0xfec3da, 0x8, 0xc00006fd20)
    /usr/local/go/src/runtime/trace/annotation.go:137 +0xe9
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2(0xc0004525c0, 0x20)
    /root/project/hugo/hugolib/hugo_sites_build.go:100 +0x23d
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func3()
    /root/project/hugo/hugolib/hugo_sites_build.go:109 +0x2f
runtime/trace.WithRegion(0x1243840, 0xc0005a6c90, 0xfe93f9, 0x7, 0xc0004526c8)
    /usr/local/go/src/runtime/trace/annotation.go:137 +0xe9
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc0000b30a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /root/project/hugo/hugolib/hugo_sites_build.go:111 +0x7bd
github.com/gohugoio/hugo/commands.(*commandeer).buildSites(...)
    /root/project/hugo/commands/hugo.go:763
github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3(0x8, 0x1099548)
    /root/project/hugo/commands/hugo.go:313 +0x79
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0005a6c30, 0xc000549980)
    /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:58 +0x57
created by golang.org/x/sync/errgroup.(*Group).Go
    /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:55 +0x66

_index.md contains only:

{
   "title": "Predavane" 
}

and in config.toml i have

[taxonomies]
  predavane = "Predavane"
Bug

All 3 comments

I'm not sure exactly why it fails for you (it should not have panicked, and I'll fix that), but I do suspect that this is a section and not a taxonomy.

Try to remove the taxonomy config (if I misunderstand this and this really is a taxonomy, try to make it lowercase: "Prevadane" => "prevadane")

Can confirm that removing the [taxonomies] section from the config worked.
Thank you for the quick reply.

@bep I get a similar panic if I make an _index.md file, containing a title, for a taxonomy term that's not used in any posts.

In my case, a tag is only used in some future-dated or draft posts. I can build the site if I enable drafts, otherwise hugo panics.

Was this page helpful?
0 / 5 - 0 ratings