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

panic: interface conversion: interface {} is maps.ParamsMergeStrategy, not maps.Params #11046

Closed
thomasweitzel opened this issue May 30, 2023 · 3 comments

Comments

@thomasweitzel
Copy link

thomasweitzel commented May 30, 2023

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

$ hugo version
hugo v0.112.5-48e33e10af2feb2a0e1c32d04880ed016619f2d8+extended linux/amd64 BuildDate=2023-05-29T07:27:36Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes (0.112.5).

Description

$ hugo --verbose
Total in 0 ms
panic: interface conversion: interface {} is maps.ParamsMergeStrategy, not maps.Params

goroutine 1 [running]:
github.com/gohugoio/hugo/config/allconfig.glob..func20({{0x236449a, 0x9}, 0x2616e90, 0x0, 0x0}, {{0x2a18c30, 0xc0000bde80}, 0xc0009b4800, {0x2a17ce0, 0x3bee260}, ...})
        /root/project/hugo/config/allconfig/alldecoders.go:249 +0x1fb
github.com/gohugoio/hugo/config/allconfig.decodeConfigFromParams({0x2a17ce0, 0x3bee260}, {{0xc00004e084, 0x36}, {0xc00060ea80, 0x10}, {0xc00004fb80, 0x3d}, {0x0, 0x0}}, ...)
        /root/project/hugo/config/allconfig/allconfig.go:866 +0x3e6
github.com/gohugoio/hugo/config/allconfig.fromLoadConfigResult({0x2a17ce0, 0x3bee260}, {0x2a1b170, 0xc0002fd5f0}, {{0x2a18c30, 0xc0000bde80}, {0xc00009ee80, 0x1, 0x1}, {{0xc00004e084, ...}, ...}})
        /root/project/hugo/config/allconfig/allconfig.go:683 +0x231
github.com/gohugoio/hugo/config/allconfig.LoadConfig({{0x2a17ce0, 0x3bee260}, {0x2a1b170, 0xc0002fd5f0}, {0x2a18c30, 0xc0000bde40}, {0x0, 0x0}, {0x2350dbb, 0x6}, ...})
        /root/project/hugo/config/allconfig/load.go:61 +0x49b
github.com/gohugoio/hugo/commands.(*rootCommand).ConfigFromProvider.func1(0x2fd688?)
        /root/project/hugo/commands/commandeer.go:219 +0x358
github.com/bep/lazycache.(*Cache[...]).GetOrCreate(0x2a29ea0, 0x0, 0xc000e7b9c0?)
        /root/project/gomodcache/github.com/bep/lazycache@v0.2.0/lazycache.go:112 +0x142
github.com/gohugoio/hugo/commands.(*rootCommand).ConfigFromProvider(0xc0000bcd00?, 0x2a18c30?, {0x2a18c30, 0xc0000bde40})
        /root/project/hugo/commands/commandeer.go:195 +0x68
github.com/gohugoio/hugo/commands.(*hugoBuilder).loadConfig(0xc0001f5400, 0x0?, 0x0)
        /root/project/hugo/commands/hugobuilder.go:1017 +0x3aa
github.com/gohugoio/hugo/commands.(*rootCommand).Run(0xc000281a40, {0x0?, 0x0?}, 0x0?, {0x0?, 0x0?, 0x0?})
        /root/project/hugo/commands/commandeer.go:339 +0xf1
github.com/bep/simplecobra.(*Commandeer).compile.func1(0xc000005800?, {0xc000615d50?, 0x1?, 0x1?})
        /root/project/gomodcache/github.com/bep/simplecobra@v0.3.1/simplecobra.go:113 +0x52
github.com/spf13/cobra.(*Command).execute(0xc000005800, {0xc0001a4010, 0x1, 0x1})
        /root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000005800)
        /root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        /root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:1001
github.com/bep/simplecobra.(*Exec).Execute(0xc000690258, {0x2a0c718?, 0xc0001a8000?}, {0xc0001a4010?, 0x509b88?, 0xc000182168?})
        /root/project/gomodcache/github.com/bep/simplecobra@v0.3.1/simplecobra.go:155 +0xd9
github.com/gohugoio/hugo/commands.Execute({0xc0001a4010, 0x1, 0x1})
        /root/project/hugo/commands/commandeer.go:65 +0x312
main.main()
        /root/project/hugo/main.go:25 +0x65

I didn't have the problem with 0.111.3. Running hugo config produces the same stacktrace. My config didn't change (still working with 0.111.3), but I suspect it has something to do with it. Here it is (redacted, reduced to the minimal example that produces the panic):

baseURL = "https://example.org"
languageCode = "en-us"
title = "Blog of me"
defaultContentLanguage = "en"

[languages]
  [en]
    lang = "en"
    languageName = "English"
    weight = 1
@thomasweitzel
Copy link
Author

Found the problem. It should be languages.en:

[languages]
  [languages.en]
    lang = "en"
    languageName = "English"
    weight = 1

So it was my fault. Even though it worked without the prefix in 0.111.3.

@bep bep removed the NeedsTriage label May 30, 2023
@bep bep added this to the v0.112.6 milestone May 30, 2023
@bep
Copy link
Member

bep commented May 30, 2023

But we should not panic on these errors. I will fix that.

@bep bep reopened this May 30, 2023
bep added a commit to bep/hugo that referenced this issue May 30, 2023
@bep bep closed this as completed in 6462eec May 30, 2023
@github-actions
Copy link

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 Jun 21, 2023
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