Bug: render IS NULL in DB causes silent HTTP 500 with no recovery path for viewers
#7986
Unanswered
ferr079
asked this question in
Error / Bug Report
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When a page row has
render IS NULLin the database (or an empty string), opening that page returns a silent HTTP 500 "Error | Wiki.js" with no actionable message. The root cause is a thrown error inserver/models/pages.js, but the error text never reaches the viewer, and non-admin users have no recovery path.Affected versions
2.5.312(Node 22.22.2, PostgreSQL 17, Debian 13)main: confirmed viaserver/models/pages.js#L959-L965(same logic)Steps to reproduce
id=31, pathservices/wazuh).Expected behavior
One of the following would be reasonable:
pages.render(id)already exists to regeneraterenderfromcontent. Calling that logic inline whenpage.renderis falsy would self-heal the page on next view."Page has no rendered version. Looks like the Last page render failed. Try to edit the page and save it again."is already defined but swallowed by the generic 500 handler. Rendering it in theerror.pugview would at least tell editors what to do.Actual behavior
getPage()throws and the exception bubbles to the express error handler, which serves a generic "Error | Wiki.js" 500 page. There is no log line pointing to the page ID either (the Wiki.js journald output I captured only shows the generic stack trace line, not the user-facing message).Root cause
server/models/pages.js#L952-L969:The page record is valid (content intact, metadata intact), only
renderis missing. Throwing here is consistent with the comment but the thrown message is never shown to the viewer.Suggested fix
Preferred: call the existing render pipeline when
renderis falsy instead of throwing, so the view endpoint self-heals:At minimum, catch the error in
server/controllers/common.js(the/pageview handler around lines 484-560) and rendererror.pugwith the actionable message rather than returning a generic 500.Why it matters
This failure mode is not theoretical — it happens in several real scenarios:
contentcolumn directly.Each of these turns into an opaque 500 for end-users until an admin manually opens and re-saves the page through the editor. With 50+ pages in a typical wiki, that regression is silent and hard to spot.
Happy to prepare a PR if the approach (A, B, or C) is agreed on.
Beta Was this translation helpful? Give feedback.
All reactions