Modify

Opened 4 years ago

Closed 4 years ago

Last modified 23 months ago

#7695 closed defect (fixed)

Submit results in `AssertionError: Response already started`

Reported by: sue.sml2006@… Owned by: hasienda
Priority: high Component: TracFormsPlugin
Severity: blocker Keywords: HTTP header missing
Cc: manolo.wolder@…, j.beilicke@…, rjollos Trac Release: 0.12

Description (last modified by rjollos)

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 hasienda 4 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 4 years ago by anonymous

  • Cc manolo.wolder@… added

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 4 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 4 years ago by rjollos

  • Description modified (diff)
  • Summary changed from tracforms submit for example not working to Submit results in `AssertionError: Response already started`

Changed 4 years ago by hasienda

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

comment:4 Changed 4 years ago by hasienda

  • 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 4 years ago by hasienda

  • Priority changed from normal to high
  • Severity changed from normal to blocker
  • Trac Release changed from 0.11 to 0.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 4 years ago by rjollos

  • Cc rjollos added

comment:7 Changed 4 years ago by hasienda

  • Owner changed from rharkins to hasienda

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

comment:8 Changed 4 years ago by hasienda

  • Resolution set to fixed
  • Status changed from new to closed

(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 follow-up: Changed 4 years ago by 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?

comment:10 in reply to: ↑ 9 Changed 4 years ago by hasienda

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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.