Zim

"Internal Server Error" when Parent pages have "space" in their name

Bug #1692207 reported by Shivam Sharma
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
New
Undecided
Unassigned

Bug Description

I am using Zim 0.66.

When I try to run Zim Web server, accessing parent pages with space character in their name shows this error : "Internal Server Error"

It is very easy to reproduce this bug. Just create a new notebook and have 2 pages in it -- one with no "space" in its name and other having space(s). Then, start Zim Web Server, and open it in your browser. The page having no spaces in its name would open while the page having space(s) would throw the error.

Furthermore, this is true only for Parent pages. If a parent has space, all child pages will throw error. While if a parent page doesn't have a space, no child page will throw error (even if the child page has space in its name).

This is the debugging output I captured by running `zim -D`:

INFO: Serving HTTP on some-laptop port 8080...
127.0.0.1 - - [20/May/2017 16:27:35] "GET / HTTP/1.1" 200 27398
127.0.0.1 - - [20/May/2017 16:27:41] "GET /MAIN.html HTTP/1.1" 200 12629
127.0.0.1 - - [20/May/2017 16:27:47] "GET /MAIN/2012-12-15_UK_Trip.html HTTP/1.1" 200 8531
ERROR: Unexpected error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/zim/www.py", line 230, in __call__
    content = self.render_page(page)
  File "/usr/lib/python2.7/dist-packages/zim/www.py", line 295, in render_page
    prevpage=self.notebook.pages.get_previous(page) if not page.isroot else None,
  File "/usr/lib/python2.7/dist-packages/zim/notebook/index/pages.py", line 541, in get_previous
    raise IndexNotFoundError, 'No such page: %s', path
TypeError: raise: arg 3 must be a traceback or None
127.0.0.1 - - [20/May/2017 16:27:55] "GET /IMP_DETAILS.html HTTP/1.1" 500 21

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

There is at least an bug hiding in the error reporting, but that is not the issue

Can't reproduce the trigger - the error message suggests that the real issue is that the index is not up-to-date, from above sequence I can't figure out why not.

tags: added: 0.67
Changed in zim:
status: New → Incomplete
Revision history for this message
Shivam Sharma (shivam-src) wrote :

I created a new virtual machine, and installed an older Zim (version 0.60) in that and created a new notebook with 2 pages. One having no "space" character in its name, and other having "space" character(s). I then started the web-server, and opened it in my browser. All the pages were opening fine.

I then upgraded the version of Zim to 0.66 in that virtual machine. Then, I opened my notebook and ran the web-server. The same problem as described in the bug happened. Page with "space" character(s) shows: "Internal Server Error".

So, I can confirm that this bug is definitely there. Updating index doesn't help either.

Changed in zim:
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.