#13492 closed defect (fixed)
Uploading an attachment fails with "AssertionError: write() before start_response()" (mod_fcgid)
Reported by: | arroz | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.5.4 |
Component: | web frontend | Version: | 1.5.3 |
Severity: | critical | Keywords: | fcgi, attachment |
Cc: | miguel.arroz@… | Branch: | trunk |
Release Notes: |
Fix internal server error when uploading files using fcgi. |
||
API Changes: | |||
Internal Changes: |
Description
Running Trac 1.5.4.dev0 (0182158c5cb676af5b40cf1714c3d29c28a9d632
from the git repository). Not sure if the problem actually happens in 1.5.3, I need to be on trunk due to a different issue, so consider this 1.5dev (that version isn't available in the list).
When uploading an attachment to a ticket, I get the following error on the browser. This doesn't seem to depend on either the name or size of the attachment (a one byte file with a name with no special chars or spaces triggers the problem).
Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/trac/web/_fcgi.py", line 572, in run protocolStatus, appStatus = self.server.handler(self) File "/usr/local/lib/python3.9/site-packages/trac/web/_fcgi.py", line 1250, in handler write(b'') # in case body was empty File "/usr/local/lib/python3.9/site-packages/trac/web/_fcgi.py", line 1203, in write assert headers_set, 'write() before start_response()' AssertionError: write() before start_response()
Attachments (0)
Change History (5)
comment:1 by , 2 years ago
Cc: | added |
---|
comment:2 by , 2 years ago
Component: | attachment → web frontend |
---|---|
Keywords: | fcgi added |
Milestone: | → 1.5.4 |
Owner: | set to |
Status: | new → assigned |
comment:3 by , 2 years ago
Thanks for the super quick feedback.
Yeah, that patch works perfectly! I can now upload attachments without issues. Thank you! 🙏 Sorry for not including the more detailed trace originally.
comment:4 by , 2 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [17604]. Thanks for the reporting, again!
Thanks for the report! I get the following traceback on reproducing the issue:
I've fixed fcgi issue #13403 but the fix was incomplete.
Could you please try the following patch?
trac/web/_fcgi.py
'\n', self._pos)