Modify

Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#7695 closed defect (fixed)

Submit results in `AssertionError: Response already started`

Reported by: sue.sml2006@… Owned by: Steffen Hoffmann
Priority: high Component: TracFormsPlugin
Severity: blocker Keywords: HTTP header missing
Cc: manolowolder, j.beilicke@…, Ryan J Ollos Trac Release: 0.12

Description (last modified by Ryan J Ollos)

This may be an installation issue, but not seeing anything amiss. I followed steps to install the plugin. When i attempt to use the laundry list example, i'm seeing this error:

 Trac detected an internal error:

AssertionError: Response already started

It seems to have taken the update, but what is this error? this was usingtracformsplugin-r8671

Thank you, Sue

Attachments (1)

fx_7695.patch (1.4 KB) - added by Steffen Hoffmann 14 years ago.
a quick fix like what had been done by Mikko Rantalainen for TimeVisualizerPlugin before

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by anonymous

Cc: manolowolder added; anonymous removed

I have the same problem, it started to reproduce after upgrading from TRAC 0.11 to TRAC 0.12.

The issue reproduces when you change values in a form and hit the submit button.

After the error "AssertionError: Response already started", refreshing the page/ticket shows that the new values have been updated in the form.

I have tried TracFormsPlugin 0.2.1 and 0.3 with the same issue.

TRAC 0.11 and TracFormsPlugin 0.2.1 worked ok before the upgrade.

comment:2 Changed 14 years ago by anonymous

Cc: j.beilicke@… added

I can confirm comment comment:1. The same happens on my machine (Trac 0.12). After adding a demo form to a ticket without using [[Include(...)]] (IncludeMacro), I get:

Trac detected an internal error: RuntimeError: No Content-Length header set

When going back to the ticket using the browser history and clicking the update button of the form, the AssertionError occurs.

When I include a template form of a wiki page, I only get the AssertionError.

comment:3 Changed 14 years ago by Ryan J Ollos

Description: modified (diff)
Summary: tracforms submit for example not workingSubmit results in `AssertionError: Response already started`

Changed 14 years ago by Steffen Hoffmann

Attachment: fx_7695.patch added

a quick fix like what had been done by Mikko Rantalainen for TimeVisualizerPlugin before

comment:4 Changed 14 years ago by Steffen Hoffmann

Keywords: HTTP header missing added

After some research I found, that Trac 0.12 uses stricter HTTP request handling now.

Requiring a valid Content-Length header has been an issue for other plugins before. I recognized this for TimeVisualizerPlugin and later for AutocompleteUsersPlugin (with a different fix).

Please check proposed change. Hint: notice especially the added length statements in there.

I'll commit that to trunk branch ASAP, provided I'll receive requested privileges.

comment:5 Changed 14 years ago by Steffen Hoffmann

Priority: normalhigh
Severity: normalblocker
Trac Release: 0.110.12

Giving higher priority now, because with Trac 0.12 this is a real show-stopper.

Changeset with fix tested and verified is prepared here.

comment:6 Changed 14 years ago by Ryan J Ollos

Cc: Ryan J Ollos added

comment:7 Changed 14 years ago by Steffen Hoffmann

Owner: changed from Rich Harkins to Steffen Hoffmann

Ok, got a 'GO' and will do it now.

comment:8 Changed 14 years ago by Steffen Hoffmann

Resolution: fixed
Status: newclosed

(In [9580]) TracFormsPlugin: Adapt to stricter HTTP request handling in Trac >= 0.12, closes #7695.

Fixed RuntimeError: No Content-Length header set similar to work on #7442 done by Mikko Rantalainen for TimeVisualizerPlugin.

comment:9 Changed 14 years ago by Ryan J Ollos

Looking at line 55 in the commit, is it not case sensitive to 'Content-type' vs. 'Content-Type' ... or is there something else going on here that I don't understand?

comment:10 in reply to:  9 Changed 14 years ago by Steffen Hoffmann

Replying to rjollos:

Looking at line 55 in the commit, is it not case sensitive to 'Content-type' vs. 'Content-Type' ... or is there something else going on here that I don't understand?

No, certainly not, must have been only me copying from mentioned changeset done by insyte and Mikko. The fix is essentially calculating and adding the missing «Content-Length» header.

I've seen another fix, that doesn't need an explicit calculation, but don't remember now, where to look. I'll announce, if/when I find it, since it looked more elegant to me IIRC.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
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.