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 when home page is drafted #6927

Closed
Tnze opened this issue Feb 21, 2020 · 8 comments · Fixed by #6936
Closed

Panic when home page is drafted #6927

Tnze opened this issue Feb 21, 2020 · 8 comments · Fixed by #6936

Comments

@Tnze
Copy link

Tnze commented Feb 21, 2020

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

Installed by brew.

$ hugo version
Hugo Static Site Generator v0.65.1/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

yes

$ hugo server
Building sites … panic: BUG: parent not set for "/categories"

goroutine 90 [running]:
github.com/gohugoio/hugo/hugolib.(*pageMap).assembleTaxonomies.func1(0xc00067b330, 0xb, 0x563f8a0, 0xc000894c30, 0xc000644100)
        /private/tmp/hugo-20200220-49331-1p75klb/hugo-0.65.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:526 +0x79c
github.com/armon/go-radix.recursiveWalk(0xc000894c60, 0xc000833de8, 0x563f800)
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/github.com/armon/[email protected]/radix.go:519 +0xf0
github.com/armon/go-radix.recursiveWalk(0xc000894cc0, 0xc000833de8, 0xc000833d00)
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/github.com/armon/[email protected]/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc000271020, 0xc000833de8, 0xc000833e00)
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/github.com/armon/[email protected]/radix.go:525 +0x7e
github.com/armon/go-radix.(*Tree).Walk(...)
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/github.com/armon/[email protected]/radix.go:447
github.com/gohugoio/hugo/hugolib.(*pageMap).assembleTaxonomies(0xc0004eba70, 0x0, 0x0)
        /private/tmp/hugo-20200220-49331-1p75klb/hugo-0.65.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:514 +0x92
github.com/gohugoio/hugo/hugolib.(*pageMaps).AssemblePages.func1(0xc0004eba70, 0x0, 0x0)
        /private/tmp/hugo-20200220-49331-1p75klb/hugo-0.65.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:724 +0xd4
github.com/gohugoio/hugo/hugolib.(*pageMaps).withMaps.func1(0x0, 0x0)
        /private/tmp/hugo-20200220-49331-1p75klb/hugo-0.65.1/src/github.com/gohugoio/hugo/hugolib/content_map_page.go:772 +0x2e
github.com/gohugoio/hugo/common/para.(*errGroupRunner).Run.func1(0xc0007c9f68, 0x0)
        /private/tmp/hugo-20200220-49331-1p75klb/hugo-0.65.1/src/github.com/gohugoio/hugo/common/para/para.go:52 +0x2f
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0008946c0, 0xc0008b0100)
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
        /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:54 +0x66
@bep
Copy link
Member

bep commented Feb 21, 2020

Do you have your site source somewhere where I can have a look?

@Tnze
Copy link
Author

Tnze commented Feb 21, 2020

Do you have your site source somewhere where I can have a look?

That's a private repo. But I have successfully reproduced it in the following steps:

  1. Create a new site: hugo new site .
  2. Download hermit theme.
hugo new posts/first_post.md
hugo new posts/_index.md
hugo new _index.md
  1. edit config.toml
baseURL = "http://example.org/"
languageCode = "zh-cn"
title = "My Site"
theme = "hermit"
hasCJKLanguage = true
copyright = ''

enableRobotsTXT = true

pygmentsStyle = "solarized-dark"
pygmentsCodeFences = true
pygmentsCodefences  = true
pygmentsUseClasses  = true

[[menu.main]]
    identifier = "posts"
    name = "Posts"
    url = "/posts"
    weight = 2

[author]
    name = "Tnze"

[params]
    author = "Tnze"
    bio = "There are 10 kinds of people in the world, one knows binary, the other don't."
    subtitle = "Record what I learned at ordinary times"
    homeSubtitle = "Record what I learned at ordinary times"
    
    dateform        = "Jan 2, 2006"
    dateformShort   = "Jan 2"
    dateformNum     = "2006-01-02"
    dateformNumTime = "2006-01-02 15:04 -0700"
    themeColor = "#494f5c"
    footerCopyright = ''

And then it's panic.

@Tnze
Copy link
Author

Tnze commented Feb 22, 2020

I am waiting…… ʕ •ᴥ•ʔ
Should I package and upload this test site?
I think this must be a bug.

@Tnze
Copy link
Author

Tnze commented Feb 22, 2020

The source code of the website can be downloaded from this temporary link: site-test.7z

@bep bep added Bug and removed NeedsUserFeedback labels Feb 22, 2020
@bep bep added this to the 0.65.3 milestone Feb 22, 2020
@bep
Copy link
Member

bep commented Feb 22, 2020

@Tnze It's not like we/I work on this project 24/7. We will eventually get to this. Until then I suggest you use an older Hugo version.

@Tnze
Copy link
Author

Tnze commented Feb 22, 2020

I see. Thanks for your help. ^_^

@bep bep changed the title Panic when using "hugo server" after I update the hugo. Panic when home page is drafted Feb 22, 2020
@bep
Copy link
Member

bep commented Feb 22, 2020

It is a bug, and I will fix this, but having the home page as draft=true is rather unusual. If you remove that draft flag it will work.

Note that before the latest release we did not care about the draft flag on list pages, now we do.

@github-actions
Copy link

github-actions bot commented Feb 6, 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 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants