trac-admin deploy gives "TemplateSyntaxError: unexpected char u'!' at 1"

18 views
Skip to first unread message

theultramage

unread,
Mar 3, 2019, 1:36:33 AM3/3/19
to Trac Users
Whenever I do 'trac-admin deploy' on my project, it lists the paths it's deploying from, then says "Creating scripts.", and then displays the following error:
TemplateSyntaxError: unexpected char u'!' at 1

It's been doing it for quite some time now. I don't see any adverse effects, but I assume it's better to fix it anyway. However, I don't know how, since it doesn't even display the name of the file it's complaining about.

Ryan Ollos

unread,
Mar 3, 2019, 11:20:10 AM3/3/19
to Trac Users
That seems very strange since the templates are being generated from source templates in the Trac archive. The first character is expected to be "!", and the error message sounds like the template loader is expecting a template type different from the 'text' type.

Which Trac version and Python version are you running? And which Genshi or Jinja2 version?

- Ryan

theultramage

unread,
Mar 4, 2019, 3:31:44 AM3/4/19
to Trac Users
Python - 2.7.15 freebsd
Trac - 1.3.4 trunk r16891 (yesterday)
Genshi - 0.7
I think I saw this same error show up when I first wrote the maintenance script to deploy the project, over 2 years ago. I just ignored it. But I noticed that it's still there, so I figured I'd ask.

Ryan Ollos

unread,
Mar 4, 2019, 9:40:45 AM3/4/19
to Trac Users
Have you been running Trac 1.3.x since you deployed the project?

What version of Jinja2 is installed?

- Ryan 

theultramage

unread,
Mar 4, 2019, 5:05:08 PM3/4/19
to Trac Users
I think the previous one was 1.3.2, not sure.
The .eggs file says jinja2-2.9.5 from march 2017, which is when I did the first build off of this checkout.

RjOllos

unread,
Jun 11, 2019, 2:33:55 AM6/11/19
to Trac Users


On Monday, March 4, 2019 at 5:05:08 PM UTC-5, theultramage wrote:
I think the previous one was 1.3.2, not sure.
The .eggs file says jinja2-2.9.5 from march 2017, which is when I did the first build off of this checkout.

Sorry for the delayed reply.

The deploy step creates the cgi-bin directory. It should contain:
$ ls cgi-bin/
trac.cgi trac.fcgi trac.wsgi 

What does the directory contain after you run deploy?

It looks like the exception with traceback should be logged at ERROR level, so it will output to the console if you set log_type = stderr, or to the log file if log_type = file. Can you please look for the exception with traceback?

- Ryan
Reply all
Reply to author
Forward
0 new messages