Modify

Opened 12 years ago

Closed 12 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)

t10870-r12666.diff (2.5 KB) - added by Jun Omae 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by falkb

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

python setup.py clean bdist_egg

Did this help?

comment:2 Changed 12 years ago by alillards

Resolution: fixed
Status: newclosed

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 Changed 12 years ago by falkb

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 in reply to:  3 Changed 12 years ago by Jun Omae

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 12 years ago by Jun Omae

Attachment: t10870-r12666.diff added

comment:5 Changed 12 years ago by falkb

Resolution: fixed
Status: closedreopened

Thanks a lot for this patch! I'm going to apply and test it these days.

comment:6 Changed 12 years ago by falkb

Owner: changed from Christopher Paredes to falkb
Status: reopenednew

comment:7 Changed 12 years ago by falkb

Resolution: fixed
Status: newclosed

(In [12674]) fixed #10870: applied patch of jun66j5

  • reviewed upgrade
  • proper usage of console print to prevent access probs and timeouts with mod_wsgi

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain falkb.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.