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

Paginator invalid mem. nil pointer on Hugo server #5968

Closed
regisphilibert opened this issue May 17, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@regisphilibert
Copy link

commented May 17, 2019

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)

@regisphilibert regisphilibert changed the title Paginator invalid mem. nil pointer Paginator invalid mem. nil pointer on Hugo server May 17, 2019

@bep bep closed this May 17, 2019

@bep bep reopened this May 17, 2019

bep added a commit to bep/hugo that referenced this issue May 18, 2019

@bep bep added this to the v0.55.6 milestone May 18, 2019

@bep bep closed this in 95ce2a4 May 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.