[CalendarServer-users] Report query against CalendarServer always returns [] with "REPORT request body may not be empty" error

Shruti Krishnagiri shruti.krishnagiri at gmail.com
Thu May 5 16:41:53 PDT 2011

The server seems to be finding the request body to be empty, but it's not.
I'm trying to look up *all* events from my calendar (on the Darwin
CalendarServer) but am getting an empty set preceeded by the error "Request
body cannot be empty".
Here's the code:
            log.info("Filter: VEVENT");
            GenerateQuery gq = new GenerateQuery();
            gq = new GenerateQuery(null,Component.VEVENT);
            log.info(printQuery(gq.generate())); //prints good request

            CalDAVCollection col  = new CalDAVCollection();
            col.setMethodFactory(new CalDAV4JMethodFactory());

            List<Calendar> cals = col.queryCalendars(calendarClient,
            log.info(cals);// this is empty

Here is the server output:

<?xml version="1.0"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
    <D:prop xmlns:D="DAV:">
            <C:comp name="VCALENDAR"/>
        <C:comp-filter name="VCALENDAR">
            <C:comp-filter name="VEVENT"/>

ical4j.properties not found.
Preemptively sending default basic credentials
Authenticating with BASIC <any realm>@hp-touch.me.com:8008
Credential charset not configured, using HTTP element charset
Open connection to hp-touch.me.com:8008
>> "REPORT /calendars/__uids__/skris/calendar/ HTTP/1.1[\r][\n]"
Adding Host request header
>> "Authorization: Basic bXljYXJlOm15Y2FyZQ==[\r][\n]"
>> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
>> "Host: hp-touch.me.org:8008[\r][\n]"
>> "Depth: 1[\r][\n]"
>> "Content-Type: text/xml[\r][\n]"
>> "[\r][\n]"
Default charset used: ISO-8859-1
<< "HTTP/1.1 400 Bad Request[\r][\n]"
<< "HTTP/1.1 400 Bad Request[\r][\n]"
<< "Date: Thu, 05 May 2011 23:34:24 GMT[\r][\n]"
<< "DAV: 1, access-control, calendar-access, calendar-schedule,
calendar-auto-schedule, calendar-availability, inbox-availability,
calendar-proxy, calendarserver-private-events,
<< "Content-Type: text/html[\r][\n]"
<< "Content-Length: 128[\r][\n]"
<< "Server: Twisted/8.2.0 TwistedWeb/8.2.0 TwistedCalDAV/?[\r][\n]"
<< "[\r][\n]"
<< "<html><head><title>Bad Request</title></head><body><h1>Bad
Request</h1><p>REPORT request body may not be empty</p></body></html>"
Resorting to protocol version default close connection policy
Should NOT close connection, using HTTP/1.1
Connection is locked.  Call to releaseConnection() ignored.
Releasing connection back to connection manager.
Server returned null
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-users/attachments/20110505/fa617113/attachment.html>

More information about the calendarserver-users mailing list