TracError: Genshi UnicodeEncodeError error while rendering template (fresh Trac install)

434 views
Skip to first unread message

Derek Simkowiak

unread,
Apr 10, 2011, 8:18:09 PM4/10/11
to trac-...@googlegroups.com
I have installed Trac like I have several times before, using 0.11 and
0.12, under Ubuntu 8.04 and Ubuntu 10.04. Today I installed 0.12.2
fresh, using this command:

sudo easy_install Trac

But when I visit my Trac site, I get this error in my web page:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/api.py", line 440, in send_error
data, 'text/html')
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/chrome.py", line 885, in render_template
location=location))
TracError: Genshi UnicodeEncodeError error while rendering template '/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/templates/layout.html', line 12, char -1


I have several plugins installed, but the exception seems to be coming
from the core Trac code, not one of the plugins. (Again, this all worked
before.)

How do I troubleshoot this issue? Is possible this error is coming from
one of my Trac plugins? There is no additional information in the
Apache logs (I'm using mod_python).


Thanks,
Derek

P.S.> A possibly related problem: When I visit my "/projects" URL, I get
an internal server error and this Unicode error is in my Apache error.log:

[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] mod_python
(pid=4934, interpreter='main_interpreter', phase='PythonHandler?',
handler='trac.web.modpython_frontend'): Application error
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] ServerName?:
'derek.example.com'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] DocumentRoot?:
'/var/www'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] URI: '/projects/'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] Location:
'/projects'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] Directory: None
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] Filename:
'/var/www/projects'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] PathInfo?: '/'
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] Traceback (most
recent call last):
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in
HandlerDispatch?\n default=default_handler, arg=req, silent=hlist.silent)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in
_process_target\n result = _execute_target(config, req, object, arg)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in
_execute_target\n result = object(arg)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/modpython_frontend.py",
line 149, in handler\n gateway.run(dispatch_request)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/wsgi.py",
line 89, in run\n response = application(self.environ, self._start_response)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py",
line 411, in dispatch_request\n env_paths)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py",
line 703, in send_project_index\n req.send(output, 'text/html')
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/api.py",
line 416, in send\n self.write(content)
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] File
"/usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/web/api.py",
line 534, in write\n raise ValueError?("Can't send unicode content")
[Sun Apr 10 23:58:58 2011] [error] [client 192.168.2.10] ValueError?:
Can't send unicode content

Derek Simkowiak

unread,
Apr 12, 2011, 12:34:14 PM4/12/11
to trac-...@googlegroups.com
Bump?

Is anyone here using Trac 0.12.2 under Ubuntu 10.04 successfully?

Christian Boos

unread,
Apr 12, 2011, 4:10:46 PM4/12/11
to trac-...@googlegroups.com
On 4/12/2011 6:34 PM, Derek Simkowiak wrote:
>
> Bump?
> ...

As you have created a ticket on t.e.o, please also check there ... you
were asked a question
(http://trac.edgewall.org/ticket/10126#comment:1)

-- Christian

Derek Simkowiak

unread,
Apr 12, 2011, 11:18:52 PM4/12/11
to trac-...@googlegroups.com
I believe the problem is caused by an old plugin or a plugin dependency.

Although I installed a few plugins, I had none of them activated. But
one of them seems to break Trac, even when not activated. I don't know
which one.

Here is a list of stuff I did not install this time (on the working
server). But I did install this on the broken server. Many of these
are old .10 or .11 plugins (because there were no .12 versions
available), but I confirmed them working on a Trac .12 release many
months ago.

--Derek

{{{
#!sh
sudo apt-get install libapache2-svn subversion python-subversion

# Needed for bitten's trac 10.4 compatiblity.
sudo apt-get install -y python-clearsilver

# Needed for bitten unitest.
sudo easy_install http://darcs.idyll.org/~t/projects/figleaf-latest.tar.gz

# Enable LDAP authentication (if using LDAP):
# Run this or the default config below will cause Apache not to start:
a2enmod authnz_ldap


sudo apt-get install -y build-essential graphviz
sudo easy_install -U setuptools
sudo easy_install http://svn.edgewall.org/repos/genshi/trunk/

sudo easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
sudo easy_install http://trac-hacks.org/svn/customfieldadminplugin/0.11
sudo easy_install
http://trac-hacks.org/svn/eclipsetracplugin/tracrpcext/0.10
sudo easy_install http://trac-hacks.org/svn/iniadminplugin/0.11
sudo easy_install http://trac-hacks.org/svn/masterticketsplugin/0.11

# NOTE: This is about the PageToPDF plugin:
http://trac-hacks.org/ticket/1056
sudo easy_install http://trac-hacks.org/svn/pagetopdfplugin/0.10/

sudo easy_install http://trac-hacks.org/svn/progressmetermacro/0.11
sudo easy_install http://trac-hacks.org/svn/ticketdeleteplugin/0.11
sudo easy_install http://trac-hacks.org/svn/tracwysiwygplugin/0.11

sudo easy_install pisa
#sudo easy_install PIL
sudo apt-get install -y python-imaging
# Python headers are required:
sudo apt-get install -y python-dev
# Freetype dev:
sudo apt-get install -y libfreetype6-dev msttcorefonts
sudo easy_install http://trac-hacks.org/svn/tracwikiprintplugin
echo "
[components]
wikiprint.* = enabled
" >> /var/lib/trac/projects/$PROJECT/conf/trac.ini

#http://trac-hacks.org/wiki/TimingAndEstimationPlugin
# See also:
http://trac-hacks.org/wiki/TimeEstimationUserManual#Configuration
sudo easy_install
http://trac-hacks.org/svn/timingandestimationplugin/branches/trac0.11-Permissions/

#http://trac-hacks.org/wiki/WorkLogPlugin
sudo easy_install http://trac-hacks.org/svn/worklogplugin/0.11/

#http://trac-hacks.org/wiki/FullBlogPlugin
easy_install --always-unzip http://trac-hacks.org/svn/fullblogplugin/0.11
#[components]
echo "
tracfullblog.* = enabled
" >> /var/lib/trac/projects/$PROJECT/conf/trac.ini

# PrivateWiki plugin, see http://trac-hacks.org/wiki/PrivateWikiPlugin
sudo easy_install http://trac-hacks.org/svn/privatewikiplugin
# Enable this under [components] in trac.ini:
#[components]
echo "
privatewiki.api.privatewikisystem = enabled
" >> /var/lib/trac/projects/$PROJECT/conf/trac.ini
# Now add a new section to the trac.ini:
echo "
[privatewikis]
private_wikis=PRIVATE
" >> /var/lib/trac/projects/$PROJECT/conf/trac.ini

# Enable webadmin
cd /var/lib/trac/projects/$PROJECT/conf
cp -a trac.ini trac.ini-pre-webadmin
sed '
s/\[components\]/\[components\]\nwebadmin\.\* = enabled/
' < trac.ini-pre-webadmin > trac.ini

}}}

P.S.> When I tried to submit this info to my ticket, it got rejected as
Spam despite me entering a Captcha when prompted.

Reply all
Reply to author
Forward
0 new messages