CalDAV client for iClouds: MKCALEDAR requests stopped working and fail with 412 Precondition Failed
up vote
0
down vote
favorite
I developed a client for iCloud calendar service that uses CalDAV protocol. I use caldav4j library for Java, however the problem I encountered is language/library independent.
Several days ago creating of new calendars in my client stopped working. Now, I get 412 Precondition Failed
status code while sending MKCALENDAR requests to iCloud. Other operations, like getting list of calendar resources, getting events, creating and updating events work the same as before.
I tried also to CURL it and to use Postman to send similar requests and results are always the same - 412 Precondition Failed.
Example request send by my client to create new calendar looks like this:
MKCALENDAR /xxxxxxxxxx/calendars/2321321CH34CHU35Y4UI5YVU31TIBCYTUIYBUI3
HTTP/1.1
Host: caldav.icloud.com
Content-Type: text/xml
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
cache-control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<C:mkcalendar xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set xmlns:D="DAV:">
<D:prop>
<D:displayname>new calendar</D:displayname>
<C:calendar-description xml:lang="en">my description</C:calendar-description>
</D:prop>
</D:set>
</C:mkcalendar>
Parts with xxxxx contains my proper principal id and authorization token.
Does anybody know if Apple has changed there something recently? I'm sure I didn't changed anything in my code and requests like the one in example above worked successfully a few days ago.
java icloud caldav
|
show 1 more comment
up vote
0
down vote
favorite
I developed a client for iCloud calendar service that uses CalDAV protocol. I use caldav4j library for Java, however the problem I encountered is language/library independent.
Several days ago creating of new calendars in my client stopped working. Now, I get 412 Precondition Failed
status code while sending MKCALENDAR requests to iCloud. Other operations, like getting list of calendar resources, getting events, creating and updating events work the same as before.
I tried also to CURL it and to use Postman to send similar requests and results are always the same - 412 Precondition Failed.
Example request send by my client to create new calendar looks like this:
MKCALENDAR /xxxxxxxxxx/calendars/2321321CH34CHU35Y4UI5YVU31TIBCYTUIYBUI3
HTTP/1.1
Host: caldav.icloud.com
Content-Type: text/xml
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
cache-control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<C:mkcalendar xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set xmlns:D="DAV:">
<D:prop>
<D:displayname>new calendar</D:displayname>
<C:calendar-description xml:lang="en">my description</C:calendar-description>
</D:prop>
</D:set>
</C:mkcalendar>
Parts with xxxxx contains my proper principal id and authorization token.
Does anybody know if Apple has changed there something recently? I'm sure I didn't changed anything in my code and requests like the one in example above worked successfully a few days ago.
java icloud caldav
What does the 412 response body contain?
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
Are you hittingcaldav.icloud.com
or the proper partition?MKCALENDAR
orMKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which usesMKCALENDAR
and works just fine against the proper endpoint.
– hnh
yesterday
I have been using randomly chosenpXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to useMKCOL
instead, but I just can't stop wondering whyMKCALENDAR
doesn't work as it should
– Bartek Małachowski
yesterday
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I developed a client for iCloud calendar service that uses CalDAV protocol. I use caldav4j library for Java, however the problem I encountered is language/library independent.
Several days ago creating of new calendars in my client stopped working. Now, I get 412 Precondition Failed
status code while sending MKCALENDAR requests to iCloud. Other operations, like getting list of calendar resources, getting events, creating and updating events work the same as before.
I tried also to CURL it and to use Postman to send similar requests and results are always the same - 412 Precondition Failed.
Example request send by my client to create new calendar looks like this:
MKCALENDAR /xxxxxxxxxx/calendars/2321321CH34CHU35Y4UI5YVU31TIBCYTUIYBUI3
HTTP/1.1
Host: caldav.icloud.com
Content-Type: text/xml
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
cache-control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<C:mkcalendar xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set xmlns:D="DAV:">
<D:prop>
<D:displayname>new calendar</D:displayname>
<C:calendar-description xml:lang="en">my description</C:calendar-description>
</D:prop>
</D:set>
</C:mkcalendar>
Parts with xxxxx contains my proper principal id and authorization token.
Does anybody know if Apple has changed there something recently? I'm sure I didn't changed anything in my code and requests like the one in example above worked successfully a few days ago.
java icloud caldav
I developed a client for iCloud calendar service that uses CalDAV protocol. I use caldav4j library for Java, however the problem I encountered is language/library independent.
Several days ago creating of new calendars in my client stopped working. Now, I get 412 Precondition Failed
status code while sending MKCALENDAR requests to iCloud. Other operations, like getting list of calendar resources, getting events, creating and updating events work the same as before.
I tried also to CURL it and to use Postman to send similar requests and results are always the same - 412 Precondition Failed.
Example request send by my client to create new calendar looks like this:
MKCALENDAR /xxxxxxxxxx/calendars/2321321CH34CHU35Y4UI5YVU31TIBCYTUIYBUI3
HTTP/1.1
Host: caldav.icloud.com
Content-Type: text/xml
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
cache-control: no-cache
<?xml version="1.0" encoding="UTF-8"?>
<C:mkcalendar xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set xmlns:D="DAV:">
<D:prop>
<D:displayname>new calendar</D:displayname>
<C:calendar-description xml:lang="en">my description</C:calendar-description>
</D:prop>
</D:set>
</C:mkcalendar>
Parts with xxxxx contains my proper principal id and authorization token.
Does anybody know if Apple has changed there something recently? I'm sure I didn't changed anything in my code and requests like the one in example above worked successfully a few days ago.
java icloud caldav
java icloud caldav
asked Nov 18 at 19:32
Bartek Małachowski
385
385
What does the 412 response body contain?
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
Are you hittingcaldav.icloud.com
or the proper partition?MKCALENDAR
orMKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which usesMKCALENDAR
and works just fine against the proper endpoint.
– hnh
yesterday
I have been using randomly chosenpXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to useMKCOL
instead, but I just can't stop wondering whyMKCALENDAR
doesn't work as it should
– Bartek Małachowski
yesterday
|
show 1 more comment
What does the 412 response body contain?
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
Are you hittingcaldav.icloud.com
or the proper partition?MKCALENDAR
orMKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which usesMKCALENDAR
and works just fine against the proper endpoint.
– hnh
yesterday
I have been using randomly chosenpXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to useMKCOL
instead, but I just can't stop wondering whyMKCALENDAR
doesn't work as it should
– Bartek Małachowski
yesterday
What does the 412 response body contain?
– hnh
yesterday
What does the 412 response body contain?
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
Are you hitting
caldav.icloud.com
or the proper partition? MKCALENDAR
or MKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which uses MKCALENDAR
and works just fine against the proper endpoint.– hnh
yesterday
Are you hitting
caldav.icloud.com
or the proper partition? MKCALENDAR
or MKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which uses MKCALENDAR
and works just fine against the proper endpoint.– hnh
yesterday
I have been using randomly chosen
pXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to use MKCOL
instead, but I just can't stop wondering why MKCALENDAR
doesn't work as it should– Bartek Małachowski
yesterday
I have been using randomly chosen
pXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to use MKCOL
instead, but I just can't stop wondering why MKCALENDAR
doesn't work as it should– Bartek Małachowski
yesterday
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53364701%2fcaldav-client-for-iclouds-mkcaledar-requests-stopped-working-and-fail-with-412%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does the 412 response body contain?
– hnh
yesterday
Looks like dupe of stackoverflow.com/questions/53305100/…
– hnh
yesterday
@hnh the response body is empty. The stackoverflow.com/questions/53305100/… is about different method (MKCOL vs. MKCALENDAR). In my case, MKCOL works flawlessly. I have problems only with MKCALENDAR requests. They used to work properly, but stopped some short time ago. According to RFC CalDAV document MKCALENDAR is a proper method for creating calendar resources. MKCOL is more general method related to WebDAV protocol and can be used to create different types of resources.
– Bartek Małachowski
yesterday
Are you hitting
caldav.icloud.com
or the proper partition?MKCALENDAR
orMKCOL
(w/ resource-type) should not matter, they are the same thing in both questions. I added an answer to the other question, that should fix it for you as well. Tried it w/ Calendar.app which usesMKCALENDAR
and works just fine against the proper endpoint.– hnh
yesterday
I have been using randomly chosen
pXX-caldav.icloud.com
partitions because I didn't know that I can use calendar-home-set property to get proper url (as you described it in the other topic). However, I quickly made some tests and even with properly obtained pXX I still receive 412 responses. I already changed my client to useMKCOL
instead, but I just can't stop wondering whyMKCALENDAR
doesn't work as it should– Bartek Małachowski
yesterday