Opened 13 years ago
Closed 13 years ago
#10870 closed defect (fixed)
ERROR: Exception caught while checking for upgrade
| Reported by: | alillards | Owned by: | falkb |
|---|---|---|---|
| Priority: | normal | Component: | SimpleMultiProjectPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Ryan J Ollos, Steffen Hoffmann, Jun Omae | Trac Release: | 0.12 |
Description
Hi!
First of all, thanks for your efforts making this plugin possible, you are doing a great job!
I have a little problem: After having installed the plugin, I noticed a 3-4 second delay in every TRAC page refresh in my browser. After discarding apache or network problems, I checked the TRAC logs and got this:
2013-02-13 11:07:39,817 Trac[env] ERROR: Exception caught while checking for upgrade:
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/trac/env.py", line 664, in open_environment
needs_upgrade = env.needs_upgrade()
File "build/bdist.linux-i686/egg/trac/env.py", line 498, in needs_upgrade
if participant.environment_needs_upgrade(db):
File "build/bdist.linux-i686/egg/simplemultiproject/environmentSetup.py", line 78, in environment_needs_upgrade
print "SimpleMultiProject database schema version: %s initialized." % db_version
IOError: sys.stdout access restricted by mod_wsgi
2013-02-13 11:07:39,848 Trac[api] WARNING: Discarding duplicate repository 'mine'
If I try to upgrade the db I get this response:
# trac-admin /TRAC_PATH/ upgrade SimpleMultiProject database schema version: 4 initialized. SimpleMultiProject database schema version: 4 installed. SimpleMultiProject database schema is out of date: False Database is up to date, no upgrade necessary.
Apart from that, the plugin works ok, but the lag is so annoying the team asks me daily to remove it. Can you please help?
Thanks!
Attachments (1)
Change History (8)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Looks right, I disabled it (in the wsgi module), and works fine now.
In case someone needs it, what I did was add the following lines to /etc/httpd/conf.d/wsgi.conf:
WSGIRestrictStdout Off WSGIRestrictStdin Off
Thanks a lot for your help falkb!
comment:3 follow-up: 4 Changed 13 years ago by
| Cc: | Ryan J Ollos Steffen Hoffmann Jun Omae added; anonymous removed |
|---|
Excuse me, does anybody know what the right way is to print such messages to console?
comment:4 Changed 13 years ago by
Excuse me, does anybody know what the right way is to print such messages to console?
No way. environment_needs_upgrade() shouldn't use print statement because the method is called from not only trac-admin but also httpd server. If it use, this issue will occurs. Use self.log instead.
And, upgrade_environment() and environment_created() should use trac.util.text.printout and printerr instead of print. These methods converts unicode string to the encoding of console.
Patch, t10870-r12666.diff, here (untested, sorry).
Changed 13 years ago by
| Attachment: | t10870-r12666.diff added |
|---|
comment:5 Changed 13 years ago by
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Thanks a lot for this patch! I'm going to apply and test it these days.
comment:6 Changed 13 years ago by
| Owner: | changed from Christopher Paredes to falkb |
|---|---|
| Status: | reopened → new |
comment:7 Changed 13 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |



Seems, WSGI blocks the print function for several seconds, doesn't it? Please, try to comment out that line in the sources and regenerate your .egg file again with
Did this help?