Ticket #10870 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

ERROR: Exception caught while checking for upgrade

Reported by: alillards Assigned to: falkb
Priority: normal Component: SimpleMultiProjectPlugin
Severity: normal Keywords:
Cc: rjollos, hasienda, jun66j5 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

t10870-r12666.diff (2.5 kB) - added by jun66j5 on 02/28/13 03:53:11.

Change History

02/22/13 14:58:27 changed 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?

02/27/13 09:32:40 changed by alillards

  • status changed from new to closed.
  • resolution set to fixed.

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!

(follow-up: ↓ 4 ) 02/27/13 09:40:59 changed by falkb

  • cc set to rjollos, hasienda, jun66j5.

Excuse me, does anybody know what the right way is to print such messages to console?

(in reply to: ↑ 3 ) 02/28/13 03:52:57 changed by jun66j5

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).

02/28/13 03:53:11 changed by jun66j5

  • attachment t10870-r12666.diff added.

02/28/13 07:54:11 changed by falkb

  • status changed from closed to reopened.
  • resolution deleted.

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

03/01/13 12:19:36 changed by falkb

  • owner changed from crossroad to falkb.
  • status changed from reopened to new.

03/01/13 12:22:13 changed by falkb

  • status changed from new to closed.
  • resolution set to fixed.

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

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

Add/Change #10870 (ERROR: Exception caught while checking for upgrade)




Change Properties
Action