Internal Server Error Trac
here for a quick overview of the site Help Center Detailed answers to any questions you http://stackoverflow.com/questions/28351886/apache-wsgi-trac-random-http-500-internal-server-error might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://ftputil.sschwarzer.net/trac/ticket/82 posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of internal server 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to debug/log wsgi python app? up vote 3 down vote favorite 1 I tried this: #!/usr/bin/python from wsgiref.simple_server import make_server from cgi import parse_qs, escape import logging import os import sys html = """
internal server error Age: %s
Hobbies: %s
2 years ago Last modified 2 years ago Fix "Internal Server Error"s Reported by: schwa Owned by: schwa Priority: critical Milestone: Component: Website Version: Keywords: Trac, internal server error Cc: Description (last modified by schwa) (diff) Since a while, certain Trac operations cause an "Internal Server Error" with no helpful information in the logs. Often the operation actually succeeded despite the error message, but sometimes not. Even if the operation succeeds, the messages are annoying for all affected users, including me. Other websites on the same virtual server work fine. Find a way, at least a workaround, to avoid the errors. Ideas: Check all log files, again. Do web searches, again. Check new/updated deployment documentation for Trac. If all else fails, try going back to basic cgi deployment. (As it turned out, it was a database issue, so changing the deployment method wouldn't have helped. It was just coincidence that made it seem that the situation had gotten this bad because of the switch to FastCGI.) Change History comment:1 Changed 2 years ago by schwa In the apache error log, I found the messages [Mon Jun 09 11:18:05 2014] [warn] [client 79.253.29.118] mod_fcgid: read data timeout in 40 seconds, referer: http://ftputil.sschwarzer.net/trac/wiki/Download?action=edit [Mon Jun 09 11:18:05 2014] [error] [client 79.253.29.118] Premature end of script headers: trac_ftputil.fcgi, referer: http://ftputil.sschwarzer.net/trac/wiki/Download?action=edit Although it's possible to increase the timeout, it basically doesn't help a bit. The timeout is still used up, and 40 seconds is too long anyway. After enabling logging for the Trac instance, I got 2014-06-09 11:34:40,322 Trac[env] ERROR: Exception caught while checking for upgrade: Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/trac/env.py", line 664, in open_environment needs_upgrade = env.needs_upgrade() File "/usr/lib/python2.6/dist-packages/trac/env.py", line 498, in needs_upgrade if participant.environment_needs_upgrade(db): File "/usr/lib/python2.6/dist-packages/trac/env.py", line 570, in environment_needs_upgrade dbver = self.env.get_version(db) File "/usr/lib/python2.6/dist-packages/trac/env.py", line 418, in get_version (initial and 'initial_' or '')) File "/usr/lib/python2.6/d