sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.46k stars 284 forks source link

Problems syncing with iPhone #1142

Closed Rainbird-1 closed 7 months ago

Rainbird-1 commented 1 year ago

Is it possible that synchronization with the iPhone no longer works with 0.9.3?

Ubuntu Server 22.04.1 LTS Apache2 (2.4.54) php 8.2.0 phpmyadmin 5.2.0 MariaDB 10.6.11 Baikal 0.9.3

I can normally sync my contacts from Outlook to my Baikal Server, but not to the iPhone (iOS 16.1.2). I reinstalled the Baikal server and now I'm wondering why no contacts arrive on the iPhone. With the appointments it works quite normally.

https://ip/baikal/html/card.php/principals/user/

without function.

https://ip/baikal/html/cal.php/principals/user/

goes quite normally.

Does somebody has any idea?

WalterFaber commented 1 year ago

Hi Rainbird-1,

I have a similar issue. Carddav broken, Caldav works.

I think it is related to php8.2 and Baikal 0.9.3. I recently upgraded to php8.2 and a few weeks ago it worked (when I had php7.4)

Can you check your webserver logs for "Creation of dynamic property ... is deprecated" (details at the end) I'm still investigating, but I think this is the right direction.

The full log entry looks like: 2023/01/09 20:19:27 [error] xxxxx#xxxxx: *xxx FastCGI sent in stderr: "PHP message: ErrorException: Creation of dynamic property Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::$addressDataProperties is deprecated in xxxxxxxxxx/nginx/html/baikal/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php:104

Rainbird-1 commented 1 year ago

Unfortunately, I can no longer deliver the corresponding logs because I switched back to the following installation:

Ubuntu Server 22.04.1 LTS Apache 2.4.52 PHP 8.1.2-1 phpMyAdmin 5.2.0 MariaDB 10.6.11 Baikal 0.9.3

Since the request has not yet been answered and I am dependent on my calendar and contacts on the server.

Sorry!

But with the change everything works again. I could well imagine that it is PHP (too new version).

Nevertheless, thank you very much for the feedback!

WalterFaber commented 1 year ago

Thank you anyway! I made some progress with my investigations and now I'm quite sure the root cause is the error message I mentioned in my comment above "PHP message: ErrorException: Creation of dynamic property Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::$addressDataProperties is deprecated".

Even if this should be no issue for code execution according to this site https://php.watch/versions/8.2/dynamic-properties-deprecated, the application's error handling has also some impact on outcome. And it seems like Baikal ends up with a http 500 error message, even if the deprecated message does not imply that.

I was able to extract a request from Thunderbird's carddav implementation via debug console...

*** REQUEST HEADERS

REPORT /dav.php/addressbooks/<USER>/<ADDRESSBOOK>/ HTTP/2
Host: <SERVER>:<PORT>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Depth: 1
Content-Type: text/xml
Content-Length: 8622
Origin: https://<SERVER>:<PORT>
DNT: 1
Authorization: Basic <SECRET>
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
TE: trailers

*** RESPONSE HEADERS

HTTP/2 500 Internal Server Error
server: nginx/1.18.0
date: Tue, 10 Jan 2023 19:49:21 GMT
content-type: application/xml; charset=utf-8
set-cookie: PHPSESSID=<SESSIONID>; path=/; HttpOnly
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
x-sabre-version: 4.3.1
X-Firefox-Spdy: h2

*** REQUEST

      <d:prop>
        <d:getetag/>
        <card:address-data/>
      </d:prop>
      <d:href>/dav.php/addressbooks/<USER>/<ADDRESSBOOK>/01a63406-cf23-455a-a5df-<XXX>.vcf</d:href>
      <d:href>/dav.php/addressbooks/<USER>/<ADDRESSBOOK>/9e69c244-9da8-4740-b9fa-<XXX>.vcf</d:href>
      <MANY MORE>
    </card:addressbook-multiget>

*** RESPONSE

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:sabredav-version>4.3.1</s:sabredav-version>
  <s:exception>ErrorException</s:exception>
  <s:message>Creation of dynamic property Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::$addressDataProperties is deprecated</s:message>
</d:error>

@ Development team - could you give a rough estimate when you are going to add PHP8.2 compatibility to Baikal? I'm just asking because I think about downgrading to php8.1.

Thank you in advance and also thank you very much for your efforts with this great software!

jzw95 commented 1 year ago

To add a data point, I had the exact same problem. I'm running a local (Apache) web server on MacOS and for the last few months found my iPhone wasn't syncing contacts to Baïkal. I was running PHP8.2. I didn't have time to figure out what was going on until today, and came across this issue. I found the exact log entries that @WalterFaber did, and so downgraded to PHP8.1. Immediately, the iPhone started syncing again. I'm fine running PHP8.1, but it would be great if this issue could eventually be addressed. And thanks for all your great work on Baïkal!

amigainc commented 1 year ago

Hi guys, issue on CalDAV with an iPhone under iOS16, not showing any calendar. Paradaxally, CardDAV seems to work fine. Found this forum: https://developer.apple.com/forums/thread/691818 Has anyone met the same issue?

pnoll1 commented 7 months ago

upgrading dav to 4.5.1 fixes this issue. Download code from https://github.com/sabre-io/dav/releases/tag/4.5.1. Copy new code to baikal/vendor/sabre/dav.


/var/www/html/baikal/vendor/sabre$ sudo cp -r dav-4.5.1/* dav
Rainbird-1 commented 7 months ago

upgrading dav to 4.5.1 fixes this issue. Download code from https://github.com/sabre-io/dav/releases/tag/4.5.1. Copy new code to baikal/vendor/sabre/dav.

/var/www/html/baikal/vendor/sabre$ sudo cp -r dav-4.5.1/* dav

Since November 18th, 2023 I have had a different configuration for the installations which has worked since then.

Ubuntu Server 22.04.3 LTS Apache 2.4.58 PHP 8.3.0 phpMyAdmin 5.2.1 MariaDB 10.11.6 Baikal 0.9.4

Nevertheless, thank you very much for the information!

Rainbird-1 commented 7 months ago

Since November 18th, 2023 I have had a different configuration for the installations which has worked since then.