Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX calendar sync fails (via caldav) #7519

Closed
dhowe opened this issue Dec 14, 2017 · 33 comments
Closed

OSX calendar sync fails (via caldav) #7519

dhowe opened this issue Dec 14, 2017 · 33 comments

Comments

@dhowe
Copy link

dhowe commented Dec 14, 2017

To reproduce:

  1. Create a calendar on nextcloud
  2. On OSX (10.13), attempt to add a new caldav account in automatic, manual, or advanced mode (using any combination of paths)
  3. It fails with 'Unable to verify account name or password'

Expected behaviour

Should be able to add caldav account and sync events

Actual behaviour

Fails with 'Unable to verify account name or password'

Note that I CAN connect and sync via android, as well as via cadaver from osx

Server configuration detail

Operating system: Linux 4.4.0-103-generic #126-Ubuntu SMP Mon Dec 4 16:23:28 UTC 2017 x86_64

Webserver: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: mysql 10.0.31

PHP version: 7.0.22-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, intl, json, exif, mcrypt, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 12.0.4 - 12.0.4.3

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.5.2
 - audioplayer: 2.2.1
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.7
 - comments: 1.2.0
 - contacts: 2.0.1
 - dav: 1.3.0
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_pdfviewer: 1.1.1
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_versions: 1.5.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - issuetemplate: 0.3.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - news: 11.0.5
 - nextcloud_announcements: 1.1
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - password_policy: 1.2.2
 - provisioning_api: 1.2.0
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - survey_client: 1.0.0
 - systemtags: 1.2.0
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - updatenotification: 1.2.0
 - workflowengine: 1.2.0
Disabled:
 - admin_audit
 - encryption
 - files_external
 - user_external
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "ocvoabiv4udt",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "rednoise.org"
    ],
    "datadirectory": "\/var\/www\/nextcloud\/data",
    "overwrite.cli.url": "https:\/\/rednoise.org\/nextcloud",
    "dbtype": "mysql",
    "version": "12.0.4.3",
    "dbname": "nextcloud",
    "dbhost": "localhost",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "mail_from_address": "nextcloud",
    "mail_smtpmode": "php",
    "mail_smtpauthtype": "LOGIN",
    "mail_domain": "rednoise.org"
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0

Operating system:

Logs

Browser log
Insert your webserver log here 
Nextcloud log
Insert your Nextcloud log here
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@dhowe
Copy link
Author

dhowe commented Dec 16, 2017

In case any is interested, the correct caldav/carddav servers for OS X (10.13) are below (these are different than what is shown in the nextcloud UI):

caldav: https://SERVER/nextcloud/remote.php/dav/calendars/USER/CALENDAR-NAME/
carddav: https://SERVER/nextcloud/remote.php/dav/addressbooks/users/USER/ADDRESSBOOK-NAME/

@MorrisJobke
Copy link
Member

cc @georgehrke @MariusBluem

@georgehrke
Copy link
Member

georgehrke commented Dec 18, 2017

in the settings area of the calendar app (lower left corner), you can find a dedicated url for Mac and iOS. Please use that URL

Edit: I didn't upgrade to High Sierra yet, maybe @MariusBluem can check on 10.13

@dhowe
Copy link
Author

dhowe commented Dec 18, 2017

Yes, that URL is not correct, at least not on 10.13.

iOS/OSX URL from UI: https://SERVER/nextcloud/remote.php/dav/principals/users/USER/

A correct URL: https://SERVER/nextcloud/remote.php/dav/calendars/USER/CALENDAR-NAME/

@georgehrke
Copy link
Member

The correct URL: https://SERVER/nextcloud/remote.php/dav/calendars/USER/CALENDAR-NAME/

That can't be the solution, because macOS supports auto discovery of calendars and that url will only add one calendar, not all.

@dhowe
Copy link
Author

dhowe commented Dec 18, 2017

There may well be an auto-discovery solution as well, but the above is the only one I could get to work (after many dozens of tries w both the UI and cadaver).. The listed URL does not work (and also doesn't give a helpful error message)

@georgehrke
Copy link
Member

@dhowe I managed to get it working on High Sierra if I select the advanced profile when adding a new CalDAV account:

68f024e7-04d3-4157-9470-d306d724ecc8

Be sure to include the https://
Can you check if this works for you?

@aslefnad
Copy link

@georgehrke
thanks. that worked for me

@MorrisJobke
Copy link
Member

@georgehrke Could you check that this is also documented like described?

@georgehrke
Copy link
Member

@MariusBluem We should put this in our documentation ^
(maybe not with georg.cloud though :P)

@georgehrke
Copy link
Member

georgehrke commented Jan 30, 2018

@MorrisJobke No, it's not. This bug was only introduced with High Sierra. You can just use any account type on Sierra and below.

@MariusBluem
Copy link
Member

Will be complicated to document which settings you need to set for Sierra/High Sierra/El Capitan/... Do you have a list of configuration settings for CalDAV and CardDAV - did not managed to add CardDAV resource on my own Mac 😏🤭

@georgehrke
Copy link
Member

@MariusBluem Can you check if https://twitter.com/georgehrke/status/957039451959685120 works for u? It did for me.

@Pirx99
Copy link

Pirx99 commented Mar 17, 2018

I'm using 10.11.6 (El Capitan) and the above solution is not working. Has anybody another hint for me?

@Spritpit
Copy link

Spritpit commented May 14, 2018

@georgehrke

i try your tip and it failed, but maybe i`m too stupid :-)
my nextcloud is in this path:

domain.info/nextcloud

is the serveradress: https//:domain.info/nextcloud

and serverpath: /remote.php/dav/principals/USERNAME/Name of the calendar/
???

Sorry for my english i`m german.. :-)

@ghost
Copy link

ghost commented May 26, 2018

I had a similar problem. The issue was, that I have a self-signed certificate, and that somehow prevented me from adding nextcloud for cal/contacts to mac.

Following these steps fixed it for me:
https://support.apple.com/kb/ph25443?locale=en_US

@barkingbandicoot
Copy link

barkingbandicoot commented Jun 12, 2018

Thank you, thank you @georgehrke !
I have been ripping my hair out over this!
Entries in my nextcloud webserver now download to my mac and iphone.

They do not upload from mac or phone though! ??
How do I get my calendar entries on my mac & iphone to sync with my cloud?
Is there an extra step for this?
Thanks!

EDIT: Ok, it seems you have to click on each individual calendar entry and mark it as nextcloud, rather than the event you had eg. work, birthday etc.

@xshadow
Copy link

xshadow commented Jun 26, 2018

@georgehrke I could not get caldav working with the addition of "https://cloudname.org" and path "/remote.php/dav/principals/USERNAME/" with Mac OS High Sierra, Nextcloud 13.0.4 and Apple Calendar App 10.0.0 . It still fails with "It fails with 'Unable to verify account name or password'" .

The carddav account was added flawlessly.

I can additionally can confirm, that those settings work on the same with fantasical but I assume they do not use the Mac OS X caldav implementation

@georgehrke
Copy link
Member

@Spritpit In that case it would be

is the serveradress: https://domain.info/
and serverpath: /nextcloud/remote.php/dav/principals/users/USERNAME/

and serverpath: /remote.php/dav/principals/USERNAME/Name of the calendar/

Name of calendar is completely wrong here.

@georgehrke
Copy link
Member

georgehrke commented Jun 26, 2018

@georgehrke I could not get caldav working with the addition of "https://cloudname.org" and path "/remote.php/dav/principals/USERNAME/" with Mac OS High Sierra, Nextcloud 13.0.4 and Apple Calendar App 10.0.0 . It still fails with "It fails with 'Unable to verify account name or password'" .

@xshadow Can you please provide more detailed reproduction steps?

  • Which account type did you select (automatic / manual / advanced)?
  • is nextcloud in a subfolder?
  • is it running via https or http?
  • do u you a self signed cert?
  • are you running your web server on standard ports (80/443)?
  • etc ...

@xshadow
Copy link

xshadow commented Jun 27, 2018

Sure thing. I tried it on two similiar Mac's with High Sierra.

  • I selected the "Advanced mode".
  • Nextcloud is not in a subfolder
  • it's only available via https with a valid letsencrypt certificate
  • the webserver is running on Port 443
  • on the user login he/she authenticated via IMAP

Carddav is working with the same settings, that's why I'm confused.

@barkingbandicoot
Copy link

Hi xshadow.
@georgehrke's fix above works for me - (but cardav does not work for me!)
nb You may get "It fails with 'Unable to verify account name or password'" but check and see if it is working anyway!
Also note, that you will need to right click on your individual calendar events, then mark them as a nextcloud calendar otherwise they will not sync with your server and only remain as a calendar on the device.

@xshadow
Copy link

xshadow commented Jul 24, 2018

@barkingbandicoot I can not confirm. It's not working. I switched those computers to Thunderbirds integrated calendar as a workaround. Apple Calendar is still broken.

@sbug-1bit
Copy link

Thanks for your input.

I have managed to sync calendar but not contacts.
I get macOS to accept my input for Contacts but the Contacts app shows an empty list instead of my contacts.

Nextcloud documentation also only speaks about calendar regarding sync for macOS.
Is it not implemented yet?

@georgehrke
Copy link
Member

No response from @dhowe for many months => Closing.
Issues described by other people almost always end up being configuration / setup issues
=> Documentation needs polishing: nextcloud/documentation#127 (comment)

@nursoda
Copy link

nursoda commented Dec 9, 2018

It seems to me that this is a DOCUMENTATION issue and that the documentation is NOT fixed.
As far as I understood (and am affected myself), the NC 13 user manual is insufficient in case Nextcloud does NOT reside in the root directory of the server, such as "/nextcloud": For that case, choosing "Manual" in the CalDAV account setup (as described in the NC manual) is NOT sufficient. Instead one needs to divide the URL up into server, path and port as described in this forum post. Please make sure that's added to the manual, #127 does NOT cover this (yet) (and is closed meanwhile anyway).

@Pirx99
Copy link

Pirx99 commented Dec 9, 2018

I was able to get it work on Mojave. The right way was to choose the 'Advanced type' and split the path into Server Address and Server Path, take Port 443 and use SSL. However, it didn't work at first although my entries were definitely correct. I tried it again and again. I cant really say how many attempts I made and then out of the sudden it worked. Maybe it was because I closed the setup window and reopened it again ... no idea.... So I can only encourage you to make several attempts, close and open the setup window and try it again.
So my big suspicion is that there is a bug in the code leaving parts of former incorrect entries in internal buffers... or something similar. The result is that even you type in correct values the connection can't be made. It could be a bug in NC client or in CalDAV interface. Since I never ever experienced such problems with other CalDAV connections my suspicions goes into the direction of NC.
IMHO this issue needs to be reopened!

@georgehrke
Copy link
Member

IMHO this issue needs to be reopened!

I strongly disagree here. All cases described above have been configuration issues where the .well-known file was not properly configured in the webroot. If it was, setting up the CalDAV account would work out of the box without using the advanced setup dialog.

We added an additional check to the .well-known file in the Configuration and Security check for Nextcloud 15, that you can see in the settings.

There are many things you can do wrong in the advanced dialog, that's why we need to improve the documentation in that regard. Hence nextcloud/documentation#127 is still open.

@nursoda
Copy link

nursoda commented Dec 15, 2018

Agreed with closing the bug so far, but please consider corner cases such as this:
How do you set .well-known if you serve two (or more) NC instances below one URL, like aserver.com/nc1 and aserver.com/nc2 ?

@georgehrke
Copy link
Member

georgehrke commented Dec 15, 2018

How do you set .well-known if you serve two (or more) NC instances below one URL, like aserver.com/nc1 and aserver.com/nc2 ?

The answer is fairly simple: You don't, if you rely on the automatic CalDAV / CardDAV discovery from iOS/macOS to work. Just use different subdomains for different instances.

Edit: Setting up CalDAV/CardDAV using the "advanced" method will still work if you have two instances in the same domain.

@nursoda
Copy link

nursoda commented Dec 15, 2018

Yes, it does work, and that's what is described in this forum post. I was only suggesting to mention it in the manual.

I understand that one must use different (sub)domains. Unfortunately, I wasn't aware of that when I started with ownCloud ... and to migrate a user base to different base URL is ****. Will have to do that anyway, soon. Thanks.

@ehrlichja
Copy link

Wow. I was unable to sync CardDav, I tried and tried, and then the solution was to remove the trailing slash on "Server Address". It works now.

Apple's Fault.

@RobinFrcd
Copy link

@dhowe I managed to get it working on High Sierra if I select the advanced profile when adding a new CalDAV account:

68f024e7-04d3-4157-9470-d306d724ecc8

Be sure to include the https:// Can you check if this works for you?

This answer is very helpful, may be worth to add it to the official documentation !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests