Android 8.1 with iCloud, "No CalDAV/CardDAV service found"



  • Hello,
    I am getting the error “No CalDAV/CardDAV service found” when trying to add an iCloud account. URL, name, and pw are checked. It worked on Android 6, but on Android 8 not. It seems apple blocks this request with new header/http/device information.

    This line

    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] carddav service discovery failed
    

    is different compared to post in
    https://forums.bitfire.at/topic/1302/icloud-login-url/2
    where it is

    2017-01-11 10:24:15 4 [ui.setup.DavResourceFinder] Found carddav service at https://contacts.icloud.com:443
    2017-01-11 10:24:15 4 [ui.setup.DavResourceFinder] Trying to determine principal from initial context path=https://contacts.icloud.com/.well-known/carddav
    
    --- BEGIN DEBUG INFO ---
    
    LOGS:
    2018-11-23 17:26:30 320 [ui.setup.DavResourceFinder] Finding initial carddav service configuration
    2018-11-23 17:26:30 320 [ui.setup.DavResourceFinder] Checking user-given URL: https://icloud.com/
    2018-11-23 17:26:30 320 [HttpClient] --> PROPFIND https://icloud.com/
    2018-11-23 17:26:30 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 290
    2018-11-23 17:26:30 320 [HttpClient] Depth: 0
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><CARD:addressbook-description /><CARD:addressbook-home-set /><current-user-principal /></prop></propfind>
    2018-11-23 17:26:30 320 [HttpClient] --> END PROPFIND (290-byte body)
    2018-11-23 17:26:30 320 [HttpClient] <-- 301 Moved Permanently https://icloud.com/ (173ms)
    2018-11-23 17:26:30 320 [HttpClient] Server: ATS/7.1.4
    2018-11-23 17:26:30 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:30 GMT
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 17
    2018-11-23 17:26:30 320 [HttpClient] Cache-Control: no-cache
    2018-11-23 17:26:30 320 [HttpClient] Pragma: no-cache
    2018-11-23 17:26:30 320 [HttpClient] Location: https://www.icloud.com/
    2018-11-23 17:26:30 320 [HttpClient] via: webedge:am02p00ic-ztde040709:5401:18RC30:Amsterdam, https/1.1 defra3-edge-bx-043.ts.apple.com (ApacheTrafficServer/7.1.4)
    2018-11-23 17:26:30 320 [HttpClient] X-Apple-Request-UUID: 98f7c632-feea-4b22-91f2-d641ea39e221
    2018-11-23 17:26:30 320 [HttpClient] access-control-expose-headers: X-Apple-Request-UUID
    2018-11-23 17:26:30 320 [HttpClient] access-control-expose-headers: Via
    2018-11-23 17:26:30 320 [HttpClient] Age: 0
    2018-11-23 17:26:30 320 [HttpClient] Connection: keep-alive
    2018-11-23 17:26:30 320 [HttpClient] CDNUUID: 21ca9e3c-e5aa-452c-acb5-ba54380fe74c-1180670922
    2018-11-23 17:26:30 320 [HttpClient] X-Cache: skipped
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] Moved Permanently
    2018-11-23 17:26:30 320 [HttpClient] <-- END HTTP (17-byte body)
    2018-11-23 17:26:30 320 [DavResource] Redirected, new location = https://www.icloud.com/
    2018-11-23 17:26:30 320 [HttpClient] --> PROPFIND https://www.icloud.com/
    2018-11-23 17:26:30 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 290
    2018-11-23 17:26:30 320 [HttpClient] Depth: 0
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><CARD:addressbook-description /><CARD:addressbook-home-set /><current-user-principal /></prop></propfind>
    2018-11-23 17:26:30 320 [HttpClient] --> END PROPFIND (290-byte body)
    2018-11-23 17:26:30 320 [HttpClient] <-- 501 Not Implemented https://www.icloud.com/ (145ms)
    2018-11-23 17:26:30 320 [HttpClient] Server: AkamaiGHost
    2018-11-23 17:26:30 320 [HttpClient] Mime-Version: 1.0
    2018-11-23 17:26:30 320 [HttpClient] Content-Type: text/html
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 244
    2018-11-23 17:26:30 320 [HttpClient] Expires: Fri, 23 Nov 2018 16:26:30 GMT
    2018-11-23 17:26:30 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:30 GMT
    2018-11-23 17:26:30 320 [HttpClient] Connection: close
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] <HTML><HEAD>
    <TITLE>Unsupported Request</TITLE>
    </HEAD><BODY>
    <H1>Unsupported Request</H1>
    PROPFIND to http&#58;&#47;&#47;www&#46;icloud&#46;com&#47; not supported.<P>
    Reference&#32;&#35;8&#46;4016068&#46;1542990390&#46;1224ba3c
    </BODY></HTML>
    
    2018-11-23 17:26:30 320 [HttpClient] <-- END HTTP (244-byte body)
    2018-11-23 17:26:30 320 [ui.setup.DavResourceFinder] PROPFIND/OPTIONS on user-given URL failed
    EXCEPTION at.bitfire.dav4android.exception.HttpException: HTTP 501 Not Implemented
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:362)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:338)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:430)
    	at at.bitfire.dav4android.DavResource.propfind(DavResource.kt:325)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.checkUserGivenURL(DavResourceFinder.kt:190)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:125)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:82)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    2018-11-23 17:26:30 320 [HttpClient] --> PROPFIND https://icloud.com/.well-known/carddav
    2018-11-23 17:26:30 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 198
    2018-11-23 17:26:30 320 [HttpClient] Depth: 0
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-principal /></prop></propfind>
    2018-11-23 17:26:30 320 [HttpClient] --> END PROPFIND (198-byte body)
    2018-11-23 17:26:30 320 [HttpClient] <-- 301 Moved Permanently https://icloud.com/.well-known/carddav (96ms)
    2018-11-23 17:26:30 320 [HttpClient] Server: ATS/7.1.4
    2018-11-23 17:26:30 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:30 GMT
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 17
    2018-11-23 17:26:30 320 [HttpClient] Cache-Control: no-cache
    2018-11-23 17:26:30 320 [HttpClient] Pragma: no-cache
    2018-11-23 17:26:30 320 [HttpClient] Location: https://www.icloud.com/.well-known/carddav
    2018-11-23 17:26:30 320 [HttpClient] via: webedge:am02p00ic-ztde040705:5401:18RC30:Amsterdam, https/1.1 defra3-edge-bx-043.ts.apple.com (ApacheTrafficServer/7.1.4)
    2018-11-23 17:26:30 320 [HttpClient] X-Apple-Request-UUID: 9c14388a-a1ba-4690-b944-c0ea042e201a
    2018-11-23 17:26:30 320 [HttpClient] access-control-expose-headers: X-Apple-Request-UUID
    2018-11-23 17:26:30 320 [HttpClient] access-control-expose-headers: Via
    2018-11-23 17:26:30 320 [HttpClient] Age: 0
    2018-11-23 17:26:30 320 [HttpClient] Connection: keep-alive
    2018-11-23 17:26:30 320 [HttpClient] CDNUUID: 21ca9e3c-e5aa-452c-acb5-ba54380fe74c-1180671232
    2018-11-23 17:26:30 320 [HttpClient] X-Cache: skipped
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] Moved Permanently
    2018-11-23 17:26:30 320 [HttpClient] <-- END HTTP (17-byte body)
    2018-11-23 17:26:30 320 [DavResource] Redirected, new location = https://www.icloud.com/.well-known/carddav
    2018-11-23 17:26:30 320 [HttpClient] --> PROPFIND https://www.icloud.com/.well-known/carddav
    2018-11-23 17:26:30 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:30 320 [HttpClient] Content-Length: 198
    2018-11-23 17:26:30 320 [HttpClient] Depth: 0
    2018-11-23 17:26:30 320 [HttpClient] 
    2018-11-23 17:26:30 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-principal /></prop></propfind>
    2018-11-23 17:26:30 320 [HttpClient] --> END PROPFIND (198-byte body)
    2018-11-23 17:26:31 320 [HttpClient] <-- 501 Not Implemented https://www.icloud.com/.well-known/carddav (125ms)
    2018-11-23 17:26:31 320 [HttpClient] Server: AkamaiGHost
    2018-11-23 17:26:31 320 [HttpClient] Mime-Version: 1.0
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: text/html
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 275
    2018-11-23 17:26:31 320 [HttpClient] Expires: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Connection: close
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <HTML><HEAD>
    <TITLE>Unsupported Request</TITLE>
    </HEAD><BODY>
    <H1>Unsupported Request</H1>
    PROPFIND to http&#58;&#47;&#47;www&#46;icloud&#46;com&#47;&#46;well&#45;known&#47;carddav not supported.<P>
    Reference&#32;&#35;8&#46;4016068&#46;1542990391&#46;1224bb6a
    </BODY></HTML>
    
    2018-11-23 17:26:31 320 [HttpClient] <-- END HTTP (275-byte body)
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Well-known URL detection failed
    EXCEPTION at.bitfire.dav4android.exception.HttpException: HTTP 501 Not Implemented
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:362)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:338)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:430)
    	at at.bitfire.dav4android.DavResource.propfind(DavResource.kt:325)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.kt:395)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:129)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:82)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] No principal found at user-given URL, trying to discover
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Looking up SRV records for _carddavs._tcp.icloud.com
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] carddav service discovery failed
    EXCEPTION java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
    	at org.xbill.DNS.ExtendedResolver$Resolution.start(ExtendedResolver.java:102)
    	at org.xbill.DNS.ExtendedResolver.send(ExtendedResolver.java:358)
    	at org.xbill.DNS.Lookup.lookup(Lookup.java:477)
    	at org.xbill.DNS.Lookup.resolve(Lookup.java:529)
    	at org.xbill.DNS.Lookup.run(Lookup.java:543)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.discoverPrincipalUrl(DavResourceFinder.kt:341)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:148)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:82)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Finding initial caldav service configuration
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Checking user-given URL: https://icloud.com/
    2018-11-23 17:26:31 320 [HttpClient] --> PROPFIND https://icloud.com/
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 435
    2018-11-23 17:26:31 320 [HttpClient] Depth: 0
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><n0:calendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL:calendar-timezone /><current-user-privilege-set /><CAL:supported-calendar-component-set /><CAL:calendar-home-set /><current-user-principal /></prop></propfind>
    2018-11-23 17:26:31 320 [HttpClient] --> END PROPFIND (435-byte body)
    2018-11-23 17:26:31 320 [HttpClient] <-- 301 Moved Permanently https://icloud.com/ (89ms)
    2018-11-23 17:26:31 320 [HttpClient] Server: ATS/7.1.4
    2018-11-23 17:26:31 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 17
    2018-11-23 17:26:31 320 [HttpClient] Cache-Control: no-cache
    2018-11-23 17:26:31 320 [HttpClient] Pragma: no-cache
    2018-11-23 17:26:31 320 [HttpClient] Location: https://www.icloud.com/
    2018-11-23 17:26:31 320 [HttpClient] via: webedge:am02p00ic-ztde040623:5401:18RC30:Amsterdam, https/1.1 defra3-edge-bx-043.ts.apple.com (ApacheTrafficServer/7.1.4)
    2018-11-23 17:26:31 320 [HttpClient] X-Apple-Request-UUID: 5a7dcf47-18f3-4165-9b5e-41b3cb47293c
    2018-11-23 17:26:31 320 [HttpClient] access-control-expose-headers: X-Apple-Request-UUID
    2018-11-23 17:26:31 320 [HttpClient] access-control-expose-headers: Via
    2018-11-23 17:26:31 320 [HttpClient] Age: 0
    2018-11-23 17:26:31 320 [HttpClient] Connection: keep-alive
    2018-11-23 17:26:31 320 [HttpClient] CDNUUID: 21ca9e3c-e5aa-452c-acb5-ba54380fe74c-1180671451
    2018-11-23 17:26:31 320 [HttpClient] X-Cache: skipped
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] Moved Permanently
    2018-11-23 17:26:31 320 [HttpClient] <-- END HTTP (17-byte body)
    2018-11-23 17:26:31 320 [DavResource] Redirected, new location = https://www.icloud.com/
    2018-11-23 17:26:31 320 [HttpClient] --> PROPFIND https://www.icloud.com/
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 435
    2018-11-23 17:26:31 320 [HttpClient] Depth: 0
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><resourcetype /><displayname /><n0:calendar-color xmlns:n0="http://apple.com/ns/ical/" /><CAL:calendar-description /><CAL:calendar-timezone /><current-user-privilege-set /><CAL:supported-calendar-component-set /><CAL:calendar-home-set /><current-user-principal /></prop></propfind>
    2018-11-23 17:26:31 320 [HttpClient] --> END PROPFIND (435-byte body)
    2018-11-23 17:26:31 320 [HttpClient] <-- 501 Not Implemented https://www.icloud.com/ (127ms)
    2018-11-23 17:26:31 320 [HttpClient] Server: AkamaiGHost
    2018-11-23 17:26:31 320 [HttpClient] Mime-Version: 1.0
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: text/html
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 244
    2018-11-23 17:26:31 320 [HttpClient] Expires: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Connection: close
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <HTML><HEAD>
    <TITLE>Unsupported Request</TITLE>
    </HEAD><BODY>
    <H1>Unsupported Request</H1>
    PROPFIND to http&#58;&#47;&#47;www&#46;icloud&#46;com&#47; not supported.<P>
    Reference&#32;&#35;8&#46;4016068&#46;1542990391&#46;1224bc70
    </BODY></HTML>
    
    2018-11-23 17:26:31 320 [HttpClient] <-- END HTTP (244-byte body)
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] PROPFIND/OPTIONS on user-given URL failed
    EXCEPTION at.bitfire.dav4android.exception.HttpException: HTTP 501 Not Implemented
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:362)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:338)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:430)
    	at at.bitfire.dav4android.DavResource.propfind(DavResource.kt:325)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.checkUserGivenURL(DavResourceFinder.kt:199)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:125)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:89)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    2018-11-23 17:26:31 320 [HttpClient] --> PROPFIND https://icloud.com/.well-known/caldav
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 198
    2018-11-23 17:26:31 320 [HttpClient] Depth: 0
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-principal /></prop></propfind>
    2018-11-23 17:26:31 320 [HttpClient] --> END PROPFIND (198-byte body)
    2018-11-23 17:26:31 320 [HttpClient] <-- 301 Moved Permanently https://icloud.com/.well-known/caldav (83ms)
    2018-11-23 17:26:31 320 [HttpClient] Server: ATS/7.1.4
    2018-11-23 17:26:31 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 17
    2018-11-23 17:26:31 320 [HttpClient] Cache-Control: no-cache
    2018-11-23 17:26:31 320 [HttpClient] Pragma: no-cache
    2018-11-23 17:26:31 320 [HttpClient] Location: https://www.icloud.com/.well-known/caldav
    2018-11-23 17:26:31 320 [HttpClient] via: webedge:am02p00ic-ztde040621:5401:18RC30:Amsterdam, https/1.1 defra3-edge-bx-043.ts.apple.com (ApacheTrafficServer/7.1.4)
    2018-11-23 17:26:31 320 [HttpClient] X-Apple-Request-UUID: d1fcdfe9-10e4-4a42-b76d-b5c303962ac8
    2018-11-23 17:26:31 320 [HttpClient] access-control-expose-headers: X-Apple-Request-UUID
    2018-11-23 17:26:31 320 [HttpClient] access-control-expose-headers: Via
    2018-11-23 17:26:31 320 [HttpClient] Age: 0
    2018-11-23 17:26:31 320 [HttpClient] Connection: keep-alive
    2018-11-23 17:26:31 320 [HttpClient] CDNUUID: 21ca9e3c-e5aa-452c-acb5-ba54380fe74c-1180671641
    2018-11-23 17:26:31 320 [HttpClient] X-Cache: skipped
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] Moved Permanently
    2018-11-23 17:26:31 320 [HttpClient] <-- END HTTP (17-byte body)
    2018-11-23 17:26:31 320 [DavResource] Redirected, new location = https://www.icloud.com/.well-known/caldav
    2018-11-23 17:26:31 320 [HttpClient] --> PROPFIND https://www.icloud.com/.well-known/caldav
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: application/xml; charset=utf-8
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 198
    2018-11-23 17:26:31 320 [HttpClient] Depth: 0
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <?xml version='1.0' encoding='UTF-8' ?><propfind xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav"><prop><current-user-principal /></prop></propfind>
    2018-11-23 17:26:31 320 [HttpClient] --> END PROPFIND (198-byte body)
    2018-11-23 17:26:31 320 [HttpClient] <-- 501 Not Implemented https://www.icloud.com/.well-known/caldav (130ms)
    2018-11-23 17:26:31 320 [HttpClient] Server: AkamaiGHost
    2018-11-23 17:26:31 320 [HttpClient] Mime-Version: 1.0
    2018-11-23 17:26:31 320 [HttpClient] Content-Type: text/html
    2018-11-23 17:26:31 320 [HttpClient] Content-Length: 274
    2018-11-23 17:26:31 320 [HttpClient] Expires: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Date: Fri, 23 Nov 2018 16:26:31 GMT
    2018-11-23 17:26:31 320 [HttpClient] Connection: close
    2018-11-23 17:26:31 320 [HttpClient] 
    2018-11-23 17:26:31 320 [HttpClient] <HTML><HEAD>
    <TITLE>Unsupported Request</TITLE>
    </HEAD><BODY>
    <H1>Unsupported Request</H1>
    PROPFIND to http&#58;&#47;&#47;www&#46;icloud&#46;com&#47;&#46;well&#45;known&#47;caldav not supported.<P>
    Reference&#32;&#35;8&#46;4016068&#46;1542990391&#46;1224bda3
    </BODY></HTML>
    
    2018-11-23 17:26:31 320 [HttpClient] <-- END HTTP (274-byte body)
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Well-known URL detection failed
    EXCEPTION at.bitfire.dav4android.exception.HttpException: HTTP 501 Not Implemented
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:362)
    	at at.bitfire.dav4android.DavResource.checkStatus(DavResource.kt:338)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:430)
    	at at.bitfire.dav4android.DavResource.propfind(DavResource.kt:325)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.getCurrentUserPrincipal(DavResourceFinder.kt:395)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:129)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:89)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] No principal found at user-given URL, trying to discover
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] Looking up SRV records for _caldavs._tcp.icloud.com
    2018-11-23 17:26:31 320 [ui.setup.DavResourceFinder] caldav service discovery failed
    EXCEPTION java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
    	at org.xbill.DNS.ExtendedResolver$Resolution.start(ExtendedResolver.java:102)
    	at org.xbill.DNS.ExtendedResolver.send(ExtendedResolver.java:358)
    	at org.xbill.DNS.Lookup.lookup(Lookup.java:477)
    	at org.xbill.DNS.Lookup.resolve(Lookup.java:529)
    	at org.xbill.DNS.Lookup.run(Lookup.java:543)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.discoverPrincipalUrl(DavResourceFinder.kt:341)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:148)
    	at at.bitfire.davdroid.ui.setup.DavResourceFinder.findInitialConfiguration(DavResourceFinder.kt:89)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:136)
    	at at.bitfire.davdroid.ui.setup.DetectConfigurationFragment$ServerConfigurationLoader.loadInBackground(DetectConfigurationFragment.kt:120)
    	at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    	at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    	at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    
    
    SOFTWARE INFORMATION
    Package: at.bitfire.davdroid
    Version: 2.0.5-ose (248) from 07.11.2018
    Installed from: com.android.packageinstaller
    JB Workaround installed: no
    
    CONNECTIVITY (at the moment)
    Active connection: WiFi, CONNECTED
    
    CONFIGURATION
    Power saving disabled: yes
    android.permission.READ_CONTACTS permission: granted
    android.permission.WRITE_CONTACTS permission: granted
    android.permission.READ_CALENDAR permission: granted
    android.permission.WRITE_CALENDAR permission: granted
    org.dmfs.permission.READ_TASKS permission: granted
    org.dmfs.permission.WRITE_TASKS permission: granted
    System-wide synchronization: automatically
    
    SQLITE DUMP
    android_metadata
    	|  locale |
    	|  de_DE |
    ----------
    services
    	|  _id | accountName | service | principal |
    ----------
    sqlite_sequence
    	|  name | seq |
    ----------
    homesets
    	|  _id | serviceID | url |
    ----------
    collections
    	|  _id | serviceID | type | url | privWriteContent | privUnbind | forceReadOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | source | sync |
    ----------
    
    SYSTEM INFORMATION
    Android version: 8.1.0 (unknown)
    Device: unknown unknown (unknown)
    
    --- END DEBUG INFO ---
    


  • Somehow the auto-detection in ui.setup.DavResourceFinder does not work for me, however there’s a workaround:

    One account for calendar, basis-URL: https://p45-caldav.icloud.com
    One account for contacts, basis-URL: https://p04-contacts.icloud.com/[uniqueid]/carddavhome/card/

    uniqueid can be found in calendar log or xhr when going to icloud.com


  • developer

    Sounds like iCloud has changed their redirects, maybe temporarily? Sometimes this happens and then it works again some time later…


Log in to reply
 

Maybe you're interested in these topics?

  • 1
  • 5
  • 6
  • 13
  • 2