Unable to view a wiki page in Trac 1.5.4

30 views
Skip to first unread message

Roger Oberholtzer

unread,
Oct 17, 2022, 6:42:20 AM10/17/22
to trac-...@googlegroups.com
Unable to view a wiki page in Trac 1.5.4

I have a wiki page that contains only Wiki formatting. No macros or
anything. All just text. The page might be large. But other than that
I cannot think of why there should be an error showing it.

When I try to view the page, I see this in the trac log:

Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/web/main.py",
line 610, in dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/web/main.py",
line 302, in dispatch
raise e
File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/web/main.py",
line 248, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/web/chrome.py",
line 718, in process_request
in provider.get_htdocs_dirs() or []
File "/usr/lib/python3.10/site-packages/TracWikiPrint-4.0.0.dev0-py3.10.egg/tracpdf/admin.py",
line 153, in get_htdocs_dirs
return [('wikiprint', resource_filename(__name__, 'htdocs'))]
File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py",
line 1154, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py",
line 1763, in get_resource_filename
return self._extract_resource(manager, zip_path)
File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py",
line 1785, in _extract_resource
timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
KeyError: 'tracpdf/htdocs'
2022-10-17 12:30:45,256 Trac[main] ERROR: [10.2.10.41] Internal Server
Error: <RequestWithSession "GET '/chrome/tracwysiwyg/wysiwyg.js'">,
referrer 'http://sto-opq-src.scc.se/systems/wiki/StandardLinux/leap15.3/packages'

I see the bits about tracpdf. I am not selecting that here. I never
get to the page so I can do so. All other wiki pages seem fine. Just
the three similar ones to this.

--
Roger Oberholtzer

Jun Omae

unread,
Oct 17, 2022, 10:37:06 AM10/17/22
to trac-...@googlegroups.com
Hi,
That's a TracWikiPrintPlugin issue. It is caused by htdocs/css/*.css files not installed.

$ pip show -f TracWikiPrint
...
Files:
TracWikiPrint-4.0.0.dev0.dist-info/COPYING
TracWikiPrint-4.0.0.dev0.dist-info/INSTALLER
TracWikiPrint-4.0.0.dev0.dist-info/METADATA
TracWikiPrint-4.0.0.dev0.dist-info/RECORD
TracWikiPrint-4.0.0.dev0.dist-info/REQUESTED
TracWikiPrint-4.0.0.dev0.dist-info/WHEEL
TracWikiPrint-4.0.0.dev0.dist-info/direct_url.json
TracWikiPrint-4.0.0.dev0.dist-info/entry_points.txt
TracWikiPrint-4.0.0.dev0.dist-info/top_level.txt
tracpdf/__init__.py
tracpdf/__init__.pyc
tracpdf/admin.py
tracpdf/admin.pyc
tracpdf/pdfbook.py
tracpdf/pdfbook.pyc
tracpdf/templates/wikiprint_admin_parameters.html
tracpdf/templates/wikiprint_parameters.html
tracpdf/util.py
tracpdf/util.pyc
tracpdf/wikiprint.py
tracpdf/wikiprint.pyc

Please create a new ticket using https://trac-hacks.org/newticket?component=TracWikiPrintPlugin

Index: setup.py
===================================================================
--- setup.py (revision 18497)
+++ setup.py (working copy)
@@ -33,8 +33,7 @@
version='4.0.0',
packages=['tracpdf'],
package_data={
- 'tracpdf': ['templates/*.html'
- ]
+ 'tracpdf': ['templates/*.html', 'htdocs/css/*.css'],
},
install_requires=['pdfkit', 'trac'],
author='Cinc-th',


--
Jun Omae <jun...@gmail.com> (大前 潤)

Roger Oberholtzer

unread,
Oct 18, 2022, 6:34:11 AM10/18/22
to trac-...@googlegroups.com
So the correction is to edit the setup.py and reinstall TracWikiPrint?
Or is this just a workaround until TracWikiPrint is corrected?
> --
> You received this message because you are subscribed to the Google Groups "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/99bad53b-757b-2605-69d2-1ac000b57bae%40gmail.com.



--
Roger Oberholtzer

Jun Omae

unread,
Oct 18, 2022, 6:36:19 AM10/18/22
to trac-...@googlegroups.com
Apply the patch and reinstall the plugin.
> To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CANkOqwNTyvo2PS1Wia1H-q1WqZGhE7zEY6cE2mvk6GYr%3D-8YRA%40mail.gmail.com.

Roger Oberholtzer

unread,
Oct 18, 2022, 7:16:25 AM10/18/22
to trac-...@googlegroups.com
On Tue, Oct 18, 2022 at 12:33 PM Roger Oberholtzer
<roger.ob...@gmail.com> wrote:

I have made that change and the page still does not show. I get the
titles and top of it. But no content or footers.

So perhaps that's not the cause of my problem. I really do not know.
But the wiki print log messages are at least gone.
--
Roger Oberholtzer

Jun Omae

unread,
Oct 18, 2022, 7:32:53 AM10/18/22
to trac-...@googlegroups.com
On Tue, Oct 18, 2022 at 8:16 PM Roger Oberholtzer
<roger.ob...@gmail.com> wrote:
>
> On Tue, Oct 18, 2022 at 12:33 PM Roger Oberholtzer
> <roger.ob...@gmail.com> wrote:
>
> I have made that change and the page still does not show. I get the
> titles and top of it. But no content or footers.
>
> So perhaps that's not the cause of my problem. I really do not know.
> But the wiki print log messages are at least gone.

WikiStart and TracWiki pages work fine on my environment with Trac 1.5.4dev.
Please post log files with DEBUG level and the details.

Anyway, PDF Page feature in TracWikiPrintPlugin doesn't work with Trac
both 1.4.3 and 1.5.4dev. The issue has been already files in
https://trac-hacks.org/ticket/14087.

Roger Oberholtzer

unread,
Oct 18, 2022, 9:52:06 AM10/18/22
to trac-...@googlegroups.com
On Tue, Oct 18, 2022 at 1:32 PM Jun Omae <jun...@gmail.com> wrote:
>
> On Tue, Oct 18, 2022 at 8:16 PM Roger Oberholtzer
> <roger.ob...@gmail.com> wrote:
> >
> > On Tue, Oct 18, 2022 at 12:33 PM Roger Oberholtzer
> > <roger.ob...@gmail.com> wrote:
> >
> > I have made that change and the page still does not show. I get the
> > titles and top of it. But no content or footers.
> >
> > So perhaps that's not the cause of my problem. I really do not know.
> > But the wiki print log messages are at least gone.
>
> WikiStart and TracWiki pages work fine on my environment with Trac 1.5.4dev.
> Please post log files with DEBUG level and the details.

Generally all those do for me as well. Except for three pages. Only
containing wiki formatting. No links that I can recall. I can only
think that they contain more text than most.

I will see to getting a proper log with what I hoe are useful messages.



--
Roger Oberholtzer

Roger Oberholtzer

unread,
Oct 19, 2022, 6:40:49 AM10/19/22
to trac-...@googlegroups.com
On Tue, Oct 18, 2022 at 3:51 PM Roger Oberholtzer
<roger.ob...@gmail.com> wrote:

> I will see to getting a proper log with what I hope are useful messages.

I have attached the log for when this happens. I see there are some
reported errors. But I do not know why they are happening.

It seems to pick on three similar pages that are only wiki formatted.
I do not recall that there are any Trac macros called. Just simple
wiki formatting. I have attached the page as well (read from the
trac.db). Nothing unusual in the contents. I have tried adding this
text to a new wiki page. The content does not render in the wiki
editing window. No error given here either. Just no rendered content.



--
Roger Oberholtzer
wiki.txt
tracerr1.log

Jun Omae

unread,
Oct 19, 2022, 6:55:09 AM10/19/22
to trac-...@googlegroups.com
It seems CollapsiblePlugin doesn't support Python 3. Uninstall the plugin.

File "/usr/lib/python3.10/site-packages/TracCollapsiblePlugin-0.1-py3.10.egg/traccollapsible/__init__.py", line 29, in <lambda>
TracError.__str__ = lambda self: unicode(self).encode('ascii', 'ignore')
NameError: name 'unicode' is not defined

According to https://trac-hacks.org/ticket/14155, the plugin should be
unable to install with Python 3. How have you installed it?

Roger Oberholtzer

unread,
Oct 19, 2022, 8:12:37 AM10/19/22
to trac-...@googlegroups.com
On Wed, Oct 19, 2022 at 12:55 PM Jun Omae <jun...@gmail.com> wrote:
>
> On 2022/10/19 19:40, Roger Oberholtzer wrote:
> > On Tue, Oct 18, 2022 at 3:51 PM Roger Oberholtzer
> > <roger.ob...@gmail.com> wrote:
> >
> >> I will see to getting a proper log with what I hope are useful messages.
> >
> > I have attached the log for when this happens. I see there are some
> > reported errors. But I do not know why they are happening.
> >
> > It seems to pick on three similar pages that are only wiki formatted.
> > I do not recall that there are any Trac macros called. Just simple
> > wiki formatting. I have attached the page as well (read from the
> > trac.db). Nothing unusual in the contents. I have tried adding this
> > text to a new wiki page. The content does not render in the wiki
> > editing window. No error given here either. Just no rendered content.
>
> It seems CollapsiblePlugin doesn't support Python 3. Uninstall the plugin.

Shouldn't it be enough to disable it in the Trac admin page? Seems
not. I have disabled it and the pages now load.

> File "/usr/lib/python3.10/site-packages/TracCollapsiblePlugin-0.1-py3.10.egg/traccollapsible/__init__.py", line 29, in <lambda>
> TracError.__str__ = lambda self: unicode(self).encode('ascii', 'ignore')
> NameError: name 'unicode' is not defined

The thing is, this plugin is not used on this page. And, at the places
it is used, it is working fine. And all other pages work. Just not
these three. No matter. I have sorted the issue. I just don't
understand how it presents itself...

> According to https://trac-hacks.org/ticket/14155, the plugin should be
> unable to install with Python 3. How have you installed it?

I just did a regular install. I do not recall there being any
complaint. So it does install. Perhaps it has issues. And it works
where it is used.

Isn't there a new Trac facility for doing this? I see there is a
FoldMacroProcessorMacro. Maybe that's it. It seems to do what I need.
So I will convert to using this.

--
Roger Oberholtzer

Jun Omae

unread,
Oct 19, 2022, 8:23:29 AM10/19/22
to trac-...@googlegroups.com
On 2022/10/19 21:12, Roger Oberholtzer wrote:
> Shouldn't it be enough to disable it in the Trac admin page? Seems
> not. I have disabled it and the pages now load.
>
>> File "/usr/lib/python3.10/site-packages/TracCollapsiblePlugin-0.1-py3.10.egg/traccollapsible/__init__.py", line 29, in <lambda>
>> TracError.__str__ = lambda self: unicode(self).encode('ascii', 'ignore')
>> NameError: name 'unicode' is not defined
>
> The thing is, this plugin is not used on this page. And, at the places
> it is used, it is working fine. And all other pages work. Just not
> these three. No matter. I have sorted the issue. I just don't
> understand how it presents itself...

The root cause is monkey patch from the plugin. The monkey patch is invoked
even if disabling the plugin. Uninstall the plugin rather than disable.

It has been filed in https://trac-hacks.org/ticket/14162.

> Isn't there a new Trac facility for doing this? I see there is a
> FoldMacroProcessorMacro. Maybe that's it. It seems to do what I need.
> So I will convert to using this.

I don't know.

Jun Omae

unread,
Oct 19, 2022, 10:28:15 PM10/19/22
to trac-...@googlegroups.com
On 2022/10/17 23:36, Jun Omae wrote:
> That's a TracWikiPrintPlugin issue. It is caused by htdocs/css/*.css files not installed.
> ...
I just filed this issue, now: https://trac-hacks.org/ticket/14163
Reply all
Reply to author
Forward
0 new messages