CalDAV connection on iOS devices

I have problems connecting iOS devices with my nextcloud calendars using caldav. I have already tried several things from passed topics, but nothing seems to work:

So setting a 301 redirect, using simple passwords, with and without ssl, all the connection tries crashed with an error. The log of a failed connection try looks like this:
{“reqId”:“eLGLrXbKAk9fPuwCyQ3l”,“level”:0,“time”:“2018-10-30T21:48:15+00:00”,“remoteAddr”:“92.107.148.11”,“user”:“–”,“app”:“webdav”,“method”:“PROPFIND”,“url”:“/remote.php/dav/principals/users/Wolfstufe/”,“message”:“Exception: {"Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Message":"No public access to this resource., No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured, No ‘Authorization: Bearer’ header found. Either the client didn’t send one, or the server is mis-configured, No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured","Code":0,"Trace":"#0 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#1 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#2 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(466): Sabre\\Event\\EventEmitter->emit(‘beforeMethod’, Array)\n#3 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/apps\/dav\/lib\/Server.php(293): Sabre\\DAV\\Server->exec()\n#5 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php(35): OCA\\DAV\\Server->exec()\n#6 \/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/remote.php(164): require_once(‘\/home\/pfadimo1\/…’)\n#7 {main}","File":"\/home\/pfadimo1\/public_html\/nextcloud\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php","Line":168}”,“userAgent”:“iOS/12.1 (16B92) dataaccessd/1.0”,“version”:“13.0.6.1”}

Nextcloud: v13.0.6
PHP: v7.1.19

Is there anything I can do to fix this problem?

you definitely need to serve Nextcloud via https. With iOS12 Apple dropped support for caldav sync via plain http.

It also don’t work with https…
It creates exactly the same log with https.

Are you running the latest versions? iOS is at 12.1, and Nextcloud
stable is at 14.0.3. I am running PHP 7.0.30-0+deb9u1 (Debian stable),
so your version of PHP should be good.

Also, be sure you have the trusted_domains array set up correctly in
your config/config.php.

I updated nextcloud today to 14.0.3 and still the same problem…

the array looks like this:
array (
0 => ‘cloud.pfadimorgarten.ch’,
),

Is that correct? What is the mechanism of this array?

I have just seen, sometimes I get another log entry. So there are two kind of logs wehen an iOS produces en error:

{“reqId”:“eEPFU931e2OuqKs8UIxQ”,“level”:0,“time”:“2018-11-01T20:12:46+00:00”,“remoteAddr”:“178.197.227.242”,“user”:"–",“app”:“webdav”,“method”:“PROPFIND”,“url”:"/remote.php/dav/principals/users/Wolfstufe/",“message”:{“Exception”:“Sabre\DAV\Exception\NotAuthenticated”,“Message”:“No public access to this resource., No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured, No ‘Authorization: Bearer’ header found. Either the client didn’t send one, or the server is mis-configured, No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured”,“Code”:0,“Trace”:[{“function”:“beforeMethod”,“class”:“Sabre\DAV\Auth\Plugin”,“type”:"->",“args”:[{“absoluteUrl”:“http://cloud.pfadimorgarten.ch/remote.php/dav/principals/users/Wolfstufe/","class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php",“line”:105,“function”:“call_user_func_array”,“args”:[[{“autoRequireLogin”:true,“class”:“Sabre\DAV\Auth\Plugin”},“beforeMethod”],[{“absoluteUrl”:“http://cloud.pfadimorgarten.ch/remote.php/dav/principals/users/Wolfstufe/","class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:466,“function”:“emit”,“class”:“Sabre\Event\EventEmitter”,“type”:"->",“args”:[“beforeMethod”,[{“absoluteUrl”:“http://cloud.pfadimorgarten.ch/remote.php/dav/principals/users/Wolfstufe/","class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:254,“function”:“invokeMethod”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[{“absoluteUrl”:“http://cloud.pfadimorgarten.ch/remote.php/dav/principals/users/Wolfstufe/","class”:“Sabre\HTTP\Request”},{“class”:“Sabre\HTTP\Response”}]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/apps/dav/lib/Server.php",“line”:293,“function”:“exec”,“class”:“Sabre\DAV\Server”,“type”:"->",“args”:[]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\DAV\Server”,“type”:"->",“args”:[]},{“file”:"/home/pfadimo1/public_html/nextcloud/nextcloud/remote.php",“line”:163,“args”:["/home/pfadimo1/public_html/nextcloud/nextcloud/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/home/pfadimo1/public_html/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“Line”:168,“CustomMessage”:"–"},“userAgent”:“iOS/12.1 (16B92) dataaccessd/1.0”,“version”:“14.0.3.0”}

{“reqId”:“eEPFU931e2OuqKs8UIxQ”,“level”:3,“time”:“2018-11-01T20:12:46+00:00”,“remoteAddr”:“178.197.227.242”,“user”:"–",“app”:“PHP”,“method”:“PROPFIND”,“url”:"/remote.php/dav/principals/users/Wolfstufe/",“message”:“You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at /home/pfadimo1/public_html/nextcloud/nextcloud/3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/intl.php#18”,“userAgent”:“iOS/12.1 (16B92) dataaccessd/1.0”,“version”:“14.0.3.0”}

I was able to eliminate the second error log entry (You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead), by activating the php extension intl.

I hope I am one step closer to the solution by now…

Hey everyone,
I need your help cause i can´t add any caldav calendar to my iphone se and I have tried all the solutions of this forum and I have:

  • iPhone Se with IOS 12.1.3
  • Next cloud latest Version 14
  • Server with https:// (My next cloud address is: https://xyz.ocloud.de)
    Please let me know if u need more infos…I´m getting crazy with this Calendar Sync!
    Thanks

What happens, if you visit https://xyz.ocloud.de/.well-known/caldav ?

I have tried on my iPhone on Safari and Firefox Apps and it either says “ Safari can not open the page becuse the server can not be found” or “ A server with the specified host name can not be found - NSURLErrorDomain “

Hm. Maybe that was not clear. You probably visited the link I posted, which only was an example.

I meant to visit your nextcloud-address with appendix /.well-known/caldav like https://[NEXTCLOUD-URL]/.well-known/caldav
If you have Nextcloud installed in a subfolder of webroot, use webroot as [NEXTCLOUD-URL].

Hey @Bernie_O,
sorry I did not understand it before.

I have tried to visit my nextcloud-adress with appendix/.well-known/caldav both from my MacBook Pro (macOS Mojave, V. 10.14.5) and from my iPhone Se (IOS 12.1.3) and Nextcloud it first asks me my login data, and after I insert them I am redirected to a white Webpage where there is the following written:
“This is the WebDAV interface. It can only be accessed by WebDAV clients as the Nextcloud desktop sync client”

Just to let you know, I have a Nextcloud Version 16.0.1 (not 14.0) and a Server hosted from ocloud.de for next cloud users (https://ocloud.de/product/nextcloud.html).
I could succeed in setting up my nextcloud calendar in my MacBook Pro trough CalDav but not in my iPhone.

Looking forward for your answer and thanks in advance for your support!

That’s very good that service discovery is working.

The following works for me and friends of mine very reliable:

  1. delete eventuelly existing caldav accounts using your nextcloud-instance (xyz.ocloud.de) from your client.
  2. to add a caldav-account on your iOS-device:
    go to “settings” --> “accounts+passwords” --> “add account” --> “other” --> “add caldav account”
    As server enter only the domain name nothing else (in your example this would be “xyz.ocloud.de”). Also enter username and password for the nextcloud user and hit “proceed” in the upper right corner.
  3. to add an caldav-account on your Mac:
    go to “system preferences” --> “internet accounts” --> “other” --> “add caldav account” (I am not in front of my Mac right now - might be slightly differently).
    Then choose automatic configuration. As username enter USERNAME@xyz.ocloud.de (where USERNAME is your Nextcloud username) and the according password.

Hey Bernie,

  1. I deleted any caldav account (there is anyway 1 gmail and 1 icloud account saved, which I kept)
  2. I followed your steps, but I get the following message:

I tried either to continue to the ssl interface and than come back (since I have ssl server from ocloud) or to click cancel, but in both cases i get the following message:

I have tried to do not add anything to the “Description” field and also to add the IOS-Mac CalDAV address from Next cloud (/remote.php/dav/principals/users/XYZ%20XYZ/) but I get always the same answer: “CalDAV account verification failed”

Do you have any Idea why this happen? And what can I try?

Just tried with a demo instance of ocloud.de and what worked for me was putting https:// in front of the url:

Hey @Bernie_O,

i tried to do what you wrote, using a https:// in the front of the url:

But when I click save unfortunately I get always the same negative message:

I am sure that the login data (username and password) are correct, because when I use them i can open my Nextcloud in Browser.

Any other Idea? What can I try?
Should I maybe update to the last IOS OS?

I don’t think that the version of iOS is the issue, since this also worked with recent versions of iOS (unless your iOS is really old!).

Another thought I had is, that maybe the bruteforce-protection breaks the connectivity. Could you try to create a new user in your nextcloud, login as that new user and create an calendar test event within Nextcloud. Then logout again and try to setup the caldav account in iOS for that new user.

Hey @Bernie_O,
sorry for not replying to you for so long, but i was so fed up with this problem that I left the battle.

Now I have got a new IPhone but I got the same problem!!
I have tried to do what you advise me creating a new user in nextcloud and try to login in with the new credentials in the Iphone Calendar (see screenshot) but I always get the same answers: “CallDav account camn not be verified”…Any new Idea that I could try?

@Madeo try the following settings:

  • server name without protocol (just server name)
  • only username without domain part @green-fusion.de

Just checked and it works on
Client: IOS 13.4
Server: NC Snap version 17.0.5

PS my environment relies on SSL configuration and http->https forwarding

Hey @nextcloudfun!
I just have tried with the settings you told me for my “test_account” (see screenshot 1) and for my real account (see screenshot 2) but unfortunately I get always the same problem.
I have an IPhone-SE with IOS 13.4.1, also environment in SSl config.

PS: On my Mac Book Pro (macOS Mojave) it works Calendar and E-Mail account, but on my IPhone it doesn´t work either E-Mail account or Calendar.


pity.
Do you have possibility to check what is happening on server side? With tcpdump tool to check if there is any attempt to connect from your device to that server?

I also sent you a test account on one of my servers to check if you experience same issue.