Repository navigation
Description
I'm reopening an issue for the problem we're encountering on hugo serve seems to be different than #5885
It happens on some projects but not all, and after having spent hours trying to isolate it on unaffected projets by trying every possible config variations, I just resigned myself to simply post my findings in the hope this will help.
It does not happen systematically, but if you move around the site, cliking in the nav, back and forth, not necessarily while navigating to the page whose template uses Pagination, but others as well, at some point, the crash is going to happen.
I've run one of our "problem" site with --debug and here is what I notice
It always happens after this line:
DEBUG 2019/05/16 12:09:23 creating alias: /blog/page/1/index.html redirecting to http://localhost:1313/blog/
Here's a complete example:
DEBUG 2019/05/16 12:07:56 creating alias: /blog/page/1/index.html redirecting to http://localhost:1313/blog/
ERROR 2019/05/16 12:07:56 Failed to render "/blog/":
ERROR 2019/05/16 12:07:56 Failed to render pages: render of "section" failed: execute of template failed: template: _internal/pagination.html:2:13: executing "_internal/pagination.html" at <$pag.TotalPages>: error calling TotalPages: runtime error: invalid memory address or nil pointer dereference
or
DEBUG 2019/05/17 08:53:26 creating alias: /blog/page/1/index.xml redirecting to http://localhost:1313/blog/
ERROR 2019/05/17 08:53:26 Failed to render "/blog/":
ERROR 2019/05/17 08:53:26 Failed to render pages: render of "section" failed: "/Users/cheribibi/Boulot/projets/tnd/freshebt/freshebt.com/layouts/article/list.html:12:21": execute of template failed: template: article/list.html:12:21: executing "main" at <$paginator.PageNumber>: error calling PageNumber: runtime error: invalid memory address or nil pointer dereference
DEBUG 2019/05/17 08:53:26 Render XML for "sitemapindex" to "sitemap.xml"
ERROR 2019/05/17 08:53:26 Failed to render "/partners/":
ERROR 2019/05/17 08:53:26 Logged 2 error(s)
I've tried wrapping every project's ref to Paginator's properties inside with statement, but the _internal/pagination template will still produce the error.
We put in place this repo where the problem will sysmetically happen after navigating the site on hugo serve: #5885 (comment)
Activity
[-]Paginator invalid mem. nil pointer[/-][+]Paginator invalid mem. nil pointer on Hugo server[/+]hugolib: Prevent parallel server rebuilds
hugolib: Prevent parallel server rebuilds
github-actions commentedon Feb 18, 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.