Possible Bug: Hugo complains about duplicate menu entries in 0.55.5

I just updated Hugo to 0.55.5 from 0.55.0. Previously my website built correctly, but now i get the following build errors,

Building sites … 
ERROR 2019/05/03 16:39:33 "/ckc/lib/cottagepainter/site/content/resources/spraying.md:1:1": duplicate menu entry with identifier "Spraying" in menu "resources"
ERROR 2019/05/03 16:39:33 "/ckc/lib/cottagepainter/site/content/resources/equipment.md:1:1": duplicate menu entry with identifier "Equipment" in menu "resources"
ERROR 2019/05/03 16:39:33 "/ckc/lib/cottagepainter/site/content/services/exterior-painting.md:1:1": duplicate menu entry with identifier "Exterior Painting" in menu "services"
ERROR 2019/05/03 16:39:33 "/ckc/lib/cottagepainter/site/content/services/gutter-cleaning.md:1:1": duplicate menu entry with identifier "Gutter Cleaning" in menu "services"
Total in 263 ms

I do not have duplicate entires. As i said, my site built fine in 0.55.0. Perhaps i am using some outdated syntax? What exactly would have changed in Hugo to cause this?

Thank you for any insights.

EDITS:

  • I previously posted that i had upgraded from 0.54.0 -> 0.55.5, but actually i upgraded from
    0.55.0 -> 0.55.5.
  • I have built hugo at commit tags v0.55.0, v0.55.1, v0.55.2, v0.55.3, v0.55.4, and v0.55.5 and the build error occurs on every one other then v0.55.0

Can’t really confirm without your code but, from past experience, I have caused an error like this by having duplicate entries in my config.toml file, and in content post/page frontmatter.

In Hugo 0.55.0, the site compiles perfectly. Only after updating it does not. My site did not change, hugo did. Obviously something in the new hugo update is causing this to happen. My question is what could that thing be?

yep, you made that clear & yes, it is possible it’s a bug. Did you check the release notes to see if anything rings a bell?

I did, and nothing stands out to me.

The build fail begins here https://github.com/gohugoio/hugo/commit/8b73644d81a81e82851b7f7c90aa8ab5524fbe93

git log -n 1 8b73644d81a81e82851b7f7c90aa8ab5524fbe93
commit 8b73644d81a81e82851b7f7c90aa8ab5524fbe93 (HEAD)
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Tue Apr 9 23:59:13 2019 +0200

    Squashed 'docs/' changes from acf70cdd9..0f2bf195e

    0f2bf195e Adjust shortcodes for 0.55
    48c577121 Fix deprecation warnings
    ed95a341a Update index.md
    e4bc8981f Release 0.55.0
    25acacb91 Merge branch 'temp55'
    b240e321a releaser: Add release notes to /docs for release of 0.55.0
    86a190c92 docs: Add information about summary front matter variable
    9d94f4340 integrity: Add support for sha384
    dd3fe9f92 Add HUGO_NUMWORKERMULTIPLIER
    968372d86 Add trace.out to .gitignore
    660772713 Add the Fireship images to cache
    41a3e19cb hugolib: Allow page-relative aliases
    4497e4b12 Update faq.md
    b0ee3dccc output: Add missing JSON tag
    173dac0b7 docs: Regenerate docshelper data
    e30473062 docs: Regenerate CLI docs
    8cb775be2 Merge commit 'c2037f0c9a3a35b9db9c404f6b5f94ec8b690a53'
    5bc64bf44 Make Page an interface
    371ff6c12 Add skipHTML option to blackfriday config

    git-subtree-dir: docs
    git-subtree-split: 0f2bf195ef549013cc843199fb50317b0d1a5e85

Again, nothing really stands out to me.

Ok i found the issue.

I’ve been using the variable name ‘menu’ in the front-matter of some of my content files. Changing this name resolved the errors.

In my config.toml, i define menus like so

[[menu.resources]]
	name = "Equipment"
	weight = 1
	url = "/resources/equipment"
[[menu.resources]]
	name = "Spraying"
	weight = 2
	url = "/resources/spraying"
[[menu.resources]]
	name = "Paint"
	weight = 3
	url = "/resources/paint"
[[menu.resources]]
	name = "Glossary"
	weight = 4
	url = "/resources/glossary"

I guess in previous versions, hugo didn’t care about namespace clashes between arrays and variables.
Now it looks like it does.

Things like this should be made transparent in the docs and commit logs!

1 Like

Hear hear!

Also, when you ask support questions, you should include a link to your repo. Yeah! :slight_smile:

Thanks for this, it was super frustrating , lost half a day trying to figure out what was going on. It was the name clash… cheers.