sabre-io / dav

sabre/dav is a CalDAV, CardDAV and WebDAV framework for PHP
http://sabre.io
BSD 3-Clause "New" or "Revised" License
1.51k stars 344 forks source link

Newbie: Free-Busy-Report erroring with exception <s:message>This parser only supports VCARD and VCALENDAR files</s:message> #1350

Open dharkintada opened 3 years ago

dharkintada commented 3 years ago

Hello There,

I have installed Sabre/dav for a project of mine on an ubuntu machine and was able to create calendars/events etc.

However, when I do a free-busy report it errors out with following message though (the message below is a debug version from a client called SimpleCalDav. I have spent couple of nights on this one but with not much success.

Could anyone let me know what's wrong with this request/response?

My event data : BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Sabre//Sabre VObject 4.3.3//EN BEGIN:VEVENT UID:4th appointment SUMMARY:1st appointment for bookebot DTSTART:20210827T080000Z DTEND:20210827T083000Z DTSTAMP:20210826T182902Z END:VEVENT END:VCALENDAR

Error:

last request:

REPORT /baikal/html/dav.php/calendars/DK/default/ HTTP/1.1 Host: app.bookebot.com Authorization: Basic xxxxxxxxxxxxxx= User-Agent: cURL based CalDAV client Accept: / Content-type: text/xml Depth: 1 Content-Length: 199

<?xml version="1.0" encoding="utf-8"?>

last response: HTTP/1.1 500 Internal Server Error Date: Thu, 26 Aug 2021 20:47:44 GMT Server: Apache/2.4.41 (Ubuntu) Set-Cookie: PHPSESSID=xxxxxxxxxxxxxxxxxxxx; path=/; HttpOnly Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-Sabre-Version: 4.1.4 Access-Control-Allow-Origin: bookebot.com Content-Length: 292 Connection: close Content-Type: application/xml; charset=utf-8 4.1.4 Sabre\VObject\ParseException This parser only supports VCARD and VCALENDAR files Regards
DeepDiver1975 commented 3 years ago

This error is thrown here https://github.com/sabre-io/vobject/blob/d8a0a9ae215a8acfb51afc29101c7344670b9c83/lib/Parser/MimeDir.php#L163

Please note that the data shall be structured in lines.

From my understanding it should be:


BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.3.3//EN
BEGIN:VEVENT 
UID:4th appointment 
SUMMARY:1st appointment for bookebot 
DTSTART:20210827T080000Z 
DTEND:20210827T083000Z 
DTSTAMP:20210826T182902Z
END:VEVENT
END:VCALENDAR
DeepDiver1975 commented 3 years ago

... leading and trailing whitespaces are also not accepted it seems ....

dharkintada commented 3 years ago

Hi Thomas,

Thank you for the reply.

The data was indeed in separate lines. It was the serialized version that the client printed in this thread.

I have checked for leading/trailing spaces but didn't find any.

Regards Dhar

On Fri, 27 Aug 2021, 10:49 pm Thomas Müller, @.***> wrote:

... leading and trailing whitespaces are also not accepted it seems ....

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sabre-io/dav/issues/1350#issuecomment-907112414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOIP7SEPDZWNEEJ2RQZFQTT65UUDANCNFSM5C4EPTRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

DeepDiver1975 commented 3 years ago

Then the only thing you can do is to attach a debugger to see what is going on. Good luck!