Skip Menu |

This queue is for tickets about the HTTP-DAV CPAN distribution.

Report information
The Basics
Id: 75011
Status: open
Priority: 0/
Queue: HTTP-DAV

People
Owner: Nobody in particular
Requestors: tmack0 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: HTTP::DAV bug in propfind, dies on XML Parser getting invalid/incomplete xml
Date: Tue, 14 Feb 2012 14:56:54 -0800
To: bug-HTTP-DAV [...] rt.cpan.org
From: Tmack <tmack0 [...] gmail.com>
I am using HTTP::Dav to implement a spider for indexing. It works nicely most of the time, but I have come across a problem where it dies on a $dav->propfind, killing the spider, leaving an error from XML::Parser regarding a missing element (error pasted below) on stderr. I haven't yet dug deeper into it, but believe this is from the webserver (Apache) being restarted mid prop-find (or other general failure on the webserver), causing the propfind to get an incomplete return, and then passing it to the XML Parser without verifying its completeness. Perhaps the XML should be validated prior to sending it to XML::parser and either return an error on invalid XML or it should retry the propfind request to the server and warn on the problem? To get around this I currently am wrapping all $dav->propfind calls in an eval block and retrying on failure. Error output: no element found at line 14393, column 0, byte 622696 at /usr/lib/perl5/XML/Parser.pm line 187 Thanks Theral Mackey
I am not sure it is a good idea to retry WebDAV requests. Plus, if the XML is invalid, it is indeed an exception, so I think the correct behavior is to let HTTP::DAV throw an exception, like it is happening. Then if the final user wants to trap that because he knows what he's doing, then he can use eval blocks to catch such errors. Thoughts?
Subject: Re: [rt.cpan.org #75011] HTTP::DAV bug in propfind, dies on XML Parser getting invalid/incomplete xml
Date: Fri, 23 Mar 2012 14:07:48 -0700
To: bug-HTTP-DAV [...] rt.cpan.org
From: Tmack <tmack0 [...] gmail.com>
eval{} is how I continued with the script, I was just not expecting such a low-level error being thrown up the stack, and with all the XML I was dealing with in other places in the script, it threw me off track of what was going on. What does a missing element in XML have to do with DAV->propfind()? and what could I do with the line/column/byte counts when I dont even know the context of what is being called? I would have expected a more in-context error reported from the module I called, something like "malformed reponse from server, propfind failed". On Fri, Mar 23, 2012 at 10:05 AM, Cosimo Streppone via RT <bug-HTTP-DAV@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=75011 > > > I am not sure it is a good idea to retry WebDAV requests. > Plus, if the XML is invalid, it is indeed an exception, so I think the > correct behavior is to let HTTP::DAV throw an exception, like it is > happening. > > Then if the final user wants to trap that because he knows what he's > doing, then he can use eval blocks to catch such errors. > > Thoughts? >
Subject: Re: [rt.cpan.org #75011] HTTP::DAV bug in propfind, dies on XML Parser getting invalid/incomplete xml
Date: Sat, 24 Mar 2012 14:55:58 +0100
To: bug-HTTP-DAV [...] rt.cpan.org
From: "Cosimo Streppone" <cosimo [...] streppone.it>
Show quoted text
> I would have expected a more in-context error reported from the module I > called, something like "malformed reponse from server, propfind > failed".
I have tried to apply your suggestion to HTTP::DAV 0.47 and pushed it out to CPAN just a few minutes ago. If you want to give it a shot, it's also on github, tag "0.47": https://github.com/cosimo/perl5-http-dav/tarball/0.47 Thanks, and let me know how it goes. -- Cosimo
Subject: Re: [rt.cpan.org #75011] HTTP::DAV bug in propfind, dies on XML Parser getting invalid/incomplete xml
Date: Mon, 26 Mar 2012 15:57:03 -0700
To: bug-HTTP-DAV [...] rt.cpan.org
From: Tmack <tmack0 [...] gmail.com>
I will see if I can cook something up... though I have since changed companies and no longer have access to what I was working on then. It should be fairly easy to replicate: call a propfind on something over and over, stop/start the dav server repeatedly (gracefully and maybe not) and see if it gets a partial xml, triggering the error. Thanks! -Theral On Sat, Mar 24, 2012 at 6:56 AM, Cosimo Streppone via RT <bug-HTTP-DAV@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=75011 > >
>> I would have expected a more in-context error reported from the module I >> called, something like "malformed reponse from server, propfind >> failed".
> > I have tried to apply your suggestion to HTTP::DAV 0.47 > and pushed it out to CPAN just a few minutes ago. > > If you want to give it a shot, it's also > on github, tag "0.47": > > https://github.com/cosimo/perl5-http-dav/tarball/0.47 > > Thanks, and let me know how it goes. > > -- > Cosimo >