#13439 closed defect (cantfix)
AssertionError: write() before start_response() on fcgi
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend | Version: | 1.4.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Have error on url
roadmap/admin/general/plugin
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. venvp27/lib/python2.7/site-packages/trac/web/_fcgi.py in run(self=<trac.web._fcgi.Request object>) 569 """Runs the handler, flushes the streams, and ends the request.""" 570 try: => 571 protocolStatus, appStatus = self.server.handler(self) 572 except: 573 traceback.print_exc(file=self.stderr) protocolStatus undefined, appStatus undefined, self = <trac.web._fcgi.Request object>, self.server = <trac.web._fcgi.WSGIServer object>, self.server.handler = <bound method WSGIServer.handler of <trac.web._fcgi.WSGIServer object>> venvp27/lib/python2.7/site-packages/trac/web/_fcgi.py in handler(self=<trac.web._fcgi.WSGIServer object>, req=<trac.web._fcgi.Request object>) 1267 write(data) 1268 if not headers_sent: => 1269 write('') # in case body was empty 1270 finally: 1271 if hasattr(result, 'close'): write = <function write> venvp27/lib/python2.7/site-packages/trac/web/_fcgi.py in write(data='') 1208 def write(data): 1209 assert type(data) is str, 'write() argument must be string' => 1210 assert headers_set, 'write() before start_response()' 1211 1212 if not headers_sent: headers_set = [] <type 'exceptions.AssertionError'>: write() before start_response() args = ('write() before start_response()',) message = 'write() before start_response()'
Not sure about component as mod_wsgi due fcgi
Attachments (0)
Change History (5)
comment:1 by , 3 years ago
Keywords: | needinfo added |
---|---|
Priority: | high → normal |
comment:2 by , 3 years ago
Component: | web frontend/mod_wsgi → general |
---|---|
Keywords: | needinfo removed |
Milestone: | 1.4.4 |
Resolution: | → cantfix |
Status: | new → closed |
PluginIssue (th:SimpleMultiProjectPlugin). roadmap/admin/general/plugin
page is not provide by Trac.
comment:3 by , 3 years ago
It's not about SimpleMultiProjectPlugin just situation when installing, eg. for each, restart screen with trac. Looks like case around .dist-info
pip install svn+https://trac-hacks.org/svn/pydocplugin/0.11/ pip install svn+https://trac-hacks.org/svn/fieldgroupsplugin/1.0/ pip install svn+https://trac-hacks.org/svn/finegrainedpageauthzeditorplugin/0.11/ pip install svn+https://trac-hacks.org/svn/htgroupeditorplugin/0.11/ pip install svn+https://trac-hacks.org/svn/usermanagerplugin/0.11 pip install svn+https://trac-hacks.org/svn/tracdownloaderplugin/0.11/
comment:4 by , 3 years ago
Please provide System Information and Installed Plugins from your about page (see comment:1).
comment:5 by , 3 years ago
Component: | general → web frontend |
---|---|
Summary: | <type 'exceptions.AssertionError'> → AssertionError: write() before start_response() on fcgi |
I tried to reproduce the issue with Trac 1.4.3 and plugins in comment:3 on Apache with mod_fcgid, however unable to reproduce it.
I consider that the situation can happen when a plugin raise RequestDone
without sending status and headers. I think the following assertion is not needed.
-
trac/web/_fcgi.py
diff --git a/trac/web/_fcgi.py b/trac/web/_fcgi.py index b9be9ca4d..315006bb7 100644
a b class WSGIServer(Server): 1207 1207 1208 1208 def write(data): 1209 1209 assert type(data) is str, 'write() argument must be string' 1210 assert headers_set, 'write() before start_response()'1211 1210 1212 1211 if not headers_sent: 1213 1212 status, responseHeaders = headers_sent[:] = headers_set
Please provide System Information and Installed Plugins from your about page.
Also, I believe you don't use mod_wsgi.
trac/web/_fcgi.py
is used only fromtrac/web/fcgi_frontend.py
.