Hey Ryan,
Nailed it! :-D
The issue was with the wsgi.conf file in /etc/apache2/mods-enabled –
WSGIPythonOptimize 2 was set on the server that rendered pages without headers
/ footers, but was WSGIPythonOptimize 0 on the 2 servers (including the new
built-from-scratch virtual machine) where Genshi was working.
It looks like the Trac / Genshi has an issue with optimizations turned on. The
comment for this setting indicates that this might be the case:
#WSGIPythonOptimize: Enables basic Python optimisation features.
#
#Sets the level of Python compiler optimisations. The default is '0'
#which means no optimisations are applied.
#Setting the optimisation level to '1' or above will have the effect
#of enabling basic Python optimisations and changes the filename
#extension for compiled (bytecode) files from .pyc to .pyo.
#When the optimisation level is set to '2', doc strings will not be
#generated and retained. This will result in a smaller memory footprint,
#but may cause some Python packages which interrogate doc strings in some
#way to fail.
I changed the setting to 0 and headers and footers began rendering once again.
Thanks for staying with me through this. Appreciate your patience a ton.
Should I edit the wiki and put in a note to indicate that when running Trac
under WSGI, python optimizations should be turned off?
Cheers,
Vijay
From: [email protected] [mailto:[email protected]] On
Behalf Of Ryan Ollos
Sent: Monday, February 15, 2016 3:16 AM
To: Trac Users <[email protected]>
Subject: Re: [Trac] Re: Missing header and footer when running with WSGI
On Sun, Feb 14, 2016 at 1:44 PM, Vijay Varadan <[email protected]
<mailto:[email protected]> > wrote:
Hey Ryan,
Does "fresh install" mean that this is a new virtual machine that is guaranteed
to have no other modifications other than the changes you've made in setting up
Trac?
No, it’s an existing server where I primarily run Wordpress instances. But this
is the first python/WSGI site I’m running.
That said, I spent the better part of today setting up a new virtual machine
with the same configuration as the one that has missing headers & footers.
Everything works fine on the new server.
I did directory comparisons of trac and genshi between the two machines to
ensure nothing was messed up. Things match exactly, including ownership and
permissions. I tried debugging and single stepping through the code using
“import pid; pid.set_trace()”, but that only resulted in a BdbQuit error [
sorry I’ve never done python web debugging before ].
I guess it’s not an issue with Trac / Genshi, so much as it is with that
specific server. I’m not sure how to debug this. If you have any pointers, I’d
appreciate it.
Thanks.
-Vijay
I might look at differences between the /etc/apache2 directories, particularly
/etc/apache2/apache.conf.
- Ryan
--
You received this message because you are subscribed to a topic in the Google
Groups "Trac Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/trac-users/AQpVWTXVwsg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]> .
To post to this group, send email to [email protected]
<mailto:[email protected]> .
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.