ZFN

Finder can't copy to ZFN share

Bug #253117 reported by Ross Light
4
Affects Status Importance Assigned to Milestone
Twisted
Fix Released
Unknown
ZFN
Fix Released
High
Ross Light

Bug Description

Although the Finder (and Mac OS X) can write to a ZFN share, the Mac OS X Finder itself cannot copy a file to the disk. The directory hierarchy is preserved, but all files are zero-length files. It should also be noted that using "cp" at the command line will work properly.

Ross Light (quartz25)
Changed in zfilenet:
importance: Undecided → High
milestone: none → release-0.2
status: New → Confirmed
Revision history for this message
Ross Light (quartz25) wrote :

After much research, it seems that the problem is this: when the Finder performs a copy, it always writes to the server in chunked transfer encoding, causing the Content-Length to be not specified. Twisted Web does not support chunked encoding, and assumes that the Finder is not sending anything. This is a known bug in Twisted Web, and should theoretically be solved by Twisted Web2, but that's still experimental.

In short, this is one ugly bug to fix. The only three ways of fixing this behavior on the server end are: including Twisted Web2, hacking the request object ourselves to make chunked encoding with the current Twisted Web, or ripping out our beautiful code and trying to do HTTP by hand. The second option seems the most likely.

The current workaround is to always use "cp" from the Terminal, but this is far from ideal.

At this point, it doesn't look we will have this bug fixed for the 0.2 release. However, it should be restated that Mac OS X can still write to the WebDAV disk, copying in the Finder is the action that does not work.

Changed in zfilenet:
assignee: nobody → quartz25
status: Confirmed → Triaged
Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

Hi,

I'm a Twisted developer. I'd be very interested in a patch to twisted.web to add support for chunked encoded request bodies. I know you'll probably have to do something else to get this fixed more quickly for your project, but I hope you also contribute the improvement upstreams. I'd be happy to help out with this by providing pointers on the implementation or help with unit testing or anything else that would make this more likely to happen. :)

Ross Light (quartz25)
Changed in zfilenet:
status: Triaged → In Progress
Revision history for this message
Ross Light (quartz25) wrote :

This is now fixed in r165 from the associated branch. I'll be merging soon, see the branch page for details.

Changed in zfilenet:
status: In Progress → Fix Committed
Revision history for this message
Andrew Bennetts (spiv) wrote :

JP, you can see the diff to zfilenet at http://bazaar.launchpad.net/~quartz25/zfilenet/bug-chunked_encoding/revision/165?remember=163&compare_revid=163. It's done by subclassing HTTPChannel and adding chunk-encoding handling to that subclass. At a glance it looks like something that could be integrated into twisted.web directly.

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

Thanks Andrew, but Twisted contributions must be MIT licensed, so we need direct permission from Ross to use this fix.

Revision history for this message
Ross Light (quartz25) wrote :

I'd be more than glad to let you use the involved code; I tried to write it so that it would be almost immediately usable for Twisted. The only caveat you might wish to consider is that this code will probably break when presented with a client that actually uses extensions to the chunk encoding, particularly with footers. However, I have confirmed it working with normal chunked encoding.

How would you prefer me to send you the code, do you just want to copy it from the branch, or do you want me to file a ticket on the Twisted Trac and attach a diff?

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

Thanks, Ross!

I looked around for tickets related to chunked encoding, but the only things I could find were this http://twistedmatrix.com/trac/ticket/1157 and this http://twistedmatrix.com/trac/ticket/2951 - there's nothing for server-side stuff, so please feel free to file one.

Attaching a patch would be good, but we won't be able to consider it for inclusion until somebody writes tests. (Apologies if you already have tests somewhere; I didn't see them in the diff Andrew linked to.)

Revision history for this message
Ross Light (quartz25) wrote :

Released in ZFN 0.2.0b1.

Changed in zfilenet:
status: Fix Committed → Fix Released
Revision history for this message
Ross Light (quartz25) wrote :

This has now been reported as Twisted Ticket #3385 <http://twistedmatrix.com/trac/ticket/3385>

Ross Light (quartz25)
Changed in twisted:
status: New → Unknown
Changed in twisted:
status: Unknown → New
Changed in twisted:
status: New → Confirmed
Changed in twisted:
status: Confirmed → New
Changed in twisted:
status: New → Fix Released
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.