GenericSetup snapshot redirect does not work

Bug #161697 reported by Wichert Akkerman
4
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned
Zope CMF buildout
Invalid
Medium
Unassigned

Bug Description

Browsers (at least firefox) never notices that the snapshot process has finished. This is due to the response from manage_createSnapshot having a
redirect, but no data. Since there is no Content-Size header in the response the browser will wait forever for the non-existing data.

A simple workaround is to stick a "return 'done'" after the redirect call.

Tags: bug cmfcore
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

I can't reproduce the problem. Using Firefox 2.0.0.2 on OS X against the current GS trunk as part of the CMF trunk, I did the following:

- navigate to the "Snapshot" tab on the portal_setup tool

- click the "Create a Snapshot" button

The request returns correctly and I get back to the Snapshot tab with a status message informing me that the snapshot has been created.

Did you follow the same steps? Do you have more precise informaion about browser version and OS?

Revision history for this message
Wichert Akkerman (wichert) wrote :

I can't seem to reproduce it anymore either..

Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

Status: Pending => Rejected

I'll close this report, if you come against a reproducable problem I'll be happy to help.

Revision history for this message
Wichert Akkerman (wichert) wrote :

Ok, slightly embarrassing: it worked for me since I had a local patch applied. After reverting to current svn trunk the problem returns: when the snapshot is finished my firefox (2.0.0.2 on OS
and Linux) keeps waiting for data after having received the http headers.

Revision history for this message
Wichert Akkerman (wichert) wrote :

Safari 2.0.4 has the same problem as firefox

Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

I don't know what's going on, but I still cannot reproduce the problem, both with Firefox 2.0.0.2 or Safari 2.0.4 on OS X 10.4.8. I tried going through Zope directly, and I tried it through Apache as a proxy, it's all working as expected.

Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

By the way, if I look at my setup under Live HTTP Headers with Firefox I cannot reproduce your initial assertion that there is a redirect without a Content-length header (I assume that's what you meant when you said "Content-size":

HTTP/1.x 302 Moved Temporarily
Server: Zope/(unreleased version, python 2.4.4, darwin) ZServer/1.1
Date: Tue, 06 Mar 2007 12:37:44 GMT
Content-Length: 0
Content-Type: text/xml
Location: http://localhost:8080/portal/portal_setup/manage_snapshots?manage_tabs_message=Snapshot+created.

Do you have any funky interactions with proxies or any cache header manipulation going on that I do not have on a vanilla setup?

Revision history for this message
Wichert Akkerman (wichert) wrote :

I am connecting directly to zope, so no proxies or caches involved. I am testing this from a Plone 3 checkout and not a pure CMF bundle, so I am starting to suspect that there might be something in there affecting this behaviour.

I'll look into it later today.

Revision history for this message
Chris Rossi (chris-christophermrossi) wrote :

I am able to reproduce this error more than a year and a half later. ;) In a vanilla, fresh buildout built Plone, using Firefox 3.0.3 under Ubuntu, go to take a snapshot under portal_setup and, indeed, the browser hangs forever.

I have also confirmed that the OP's fix does indeed work. In GenericSetup/tool.py on line 795 change the return statement to return any non-zero length string.

Revision history for this message
Chris Rossi (chris-christophermrossi) wrote :

Actually it occurs to me that the fix above is actually a work around. The ZPublisher should set the Content-length header to 0 when a response is empty. In ZPublisher/HTTPResponse.py at line 313 I've changed this:

        if not body:
            return self

to this:

        if not body:
            self.setHeader( "Content-length", "0" )
            return self

This fixes the problem nicely for me, but I don't consider myself enough of a Zope expert to know whether this will cause unintended side effects, so I will probably run it by the experienced Zopistas and see what they think.

Chris

Revision history for this message
Wichert Akkerman (wichert) wrote :

This appears to be a correct analysis. We recently tracked down problems with Varnish to this very same bug in ZPublisher.

Revision history for this message
Hanno Schlichting (hannosch) wrote :

Looks like this is still the case and the patch applies.

Changed in zope2:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.