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

macOS Calendar app NSCocoaErrorDomain error 1570 when sharing a calendar #1034

Closed
ed-cetera opened this issue Mar 20, 2021 · 13 comments
Closed

Comments

@ed-cetera
Copy link

ed-cetera commented Mar 20, 2021

I have a setup running Baïkal 0.8.0 with PHP 8.0 and NGINX. During installation I basically followed the guide on https://sabre.io/baikal/install/. Both CalDAV and CardDAV work fine for independent users accessing the server via macOS and/or iOS Contacts/Calendar apps.

However, the moment I share a calendar with another user, the macOS Calendar app stops working for both users the user the calendar is shared with. The error is "NSCocoaErrorDomain error 1570". I tried both macOS 10.15 "Catalina" and macOS 11 "Big Sur" – same result.
NSCocoaErrorDomain error 1570
This behavior is independent of whether the sharing is configured with the Calendar app or the Baïkal calendar web interface.

There is no error in the PHP logs. The macOS Console is a little more communicative but I have no experience with macOS programming or CalDAV internals. Google didn't help either.

Validation error: Error Domain=NSCocoaErrorDomain Code=1570 "accessLevel is a required value." UserInfo={
    CalManagedObjectType = CalManagedSharee;
    NSLocalizedDescription = "accessLevel is a required value.";
    NSValidationErrorKey = accessLevel;
    NSValidationErrorObject = "<CalManagedSharee: 0x7ff0754dd470> (entity: Sharee; id: 0x2b41148bcdbe232b <x-coredata://7389159A-FD98-408E-8B44-988103C23CFC/Sharee/p686>; data: {\n    accessLevel = nil;\n    address = \"/dav.php/principals/username\";\n    calendar = \"0x2b41148b22be07eb <x-coredata://7389159A-FD98-408E-8B44-988103C23CFC/CalDAVCalendar/p274>\";\n    commonName = nil;\n    status = \"invite-accepted\";\n})";
}

What am I doing wrong? What to check next? Any ideas, how to solve this issue?

Sidenote: When sharing a calendar, the iOS calendar app shows the calendar as shared by the user it is actually shared with.

@Tntdruid
Copy link

Did you use the web ui to share the calendar?

@ed-cetera
Copy link
Author

@Tntdruid Both, the web UI or the macOS Calendar apps ("Catalina" and "Big Sur").

This behavior is independent of whether the sharing is configured with the Calendar app or the Baïkal calendar web interface.

@bjw-s
Copy link

bjw-s commented Apr 7, 2021

I can confirm that I am seeing the same error when sharing a calendar with another user

@UnbekanntesPferd
Copy link

Confirmed.
Tested with Apache/nginx and PHP 7.4 and 8.0.

Anyone found a workaround and/or tested it with baikal 0.7?

@alexBethke
Copy link

I observe the same here. Has anyone found a workaround in the meantime?

@mrzool
Copy link

mrzool commented Jul 11, 2021

Same issue on 0.8.

Subscribed/shared calendars still seem to be a pain with Baikal, a partial workaround (using a completely different workflow) can be found here. Still wrestling with this myself.

@karlitos
Copy link

Same issue on 0.9.1

@karlitos
Copy link

karlitos commented May 28, 2022

As a workaround on MacOs I found following workaround:
In the calendar app go to File -> New Calendar Subscription and enter URL in Format: https://userName:passsword@server.adress/dav.php/calendars/userName/calendarName/?export - then you still need to insert the users credentials, but in such a way, my wife and me managed to have read-only each others calendars in MacOs calendar APP

@vaskozl
Copy link

vaskozl commented Jun 20, 2023

I also just hit this after adding Baikal to a second Mac. The same shared calendar is working fine on the same account but on Android with DavX. The error code I get is the exact same but 1560 instead of 1570.

Edit: After unsharing the calendars via the iOS client, syncing works again, but upon resharing them I get a 1570 on the second MacOS machine.

@vaskozl
Copy link

vaskozl commented Jun 20, 2023

I was able to identify the issue and fix it for my instance. Thanks to @ed-cetera for the Console logs.

If you go to dav.php/calendars/user@domain/ and you click on the shared calendar you'll see that the owner (principal) is listed under cs:invite as an invited user. That by itself is not problematic and is expected, but it is a problem that the access level is not defined and left as a self closing xml tag<cs:access/>. MacOS doesn't like that as it think all invited user should have an access level.

How do we make MacOS mail happy? Give the principals an access level:

$ sqlite config/db/db.sqlite
UPDATE calendarinsatnces SET access = 1 WHERE access IS NULL;

Now the calendars show up fine on all devices. For some reason calendar owners have their access level set to NULL instead of 1 (owner).

@vaskozl
Copy link

vaskozl commented Jun 20, 2023

This only appears to be an issue with sqlite as the DB where the default is not set to 1:

access integer,

The MySQL table sets the default to 1 properly:

access TINYINT(1) NOT NULL DEFAULT '1',

@ByteHamster
Copy link
Member

You are right, there seems to be something wrong there. I don't know if it will fix the issue (I don't have access to a MacOS device), but the difference between MySQL and SQLite should definitely be resolved. I will create a PR for that, testers welcome.

@vaskozl
Copy link

vaskozl commented Apr 4, 2024

I think this issue can now be closed, I haven't had this problem since the fix.

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

No branches or pull requests

9 participants