sabre-io / Baikal

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

HTTP 500 from Evolution & DAVx5 #1197

Closed MarkRS-UK closed 1 year ago

MarkRS-UK commented 1 year ago

Baikal version: 0.9.3 Running on my home web/database server. Linux server running Fedora 38, MariaDB database server 10.5.21 Apache webserver 2.4.57

Current behaviour: Every time I use the Android app DAVx5 to sync my Android contacts and calendar I get this 500 error. I think it's coming from the address book. As you can see there are too many addresses to easily check, but the calendar seems always to be right.

I also occasionally get a 500 error reported from Evolution, which is my desktop address and calendar program, which uses Baikal for this data. It's rare. It happens on simply opening Evolution.

I have the following debug trace from DAVx5

mark@stantoncentral.co.uk (this is my email address, perhaps obviously)

┌──────────────────────────────────┬──────────┬───────────┬──────────┬───────────────────────────────────┐ │ Authority │ Syncable │ Auto-sync │ Interval │ Entries │ ├──────────────────────────────────┼──────────┼───────────┼──────────┼───────────────────────────────────┤ │ at.bitfire.davdroid.addressbooks │ 1 │ true │ — │ — │ │ com.android.calendar │ 1 │ false │ 240 min │ 84 event(s) │ │ at.techbee.jtx.provider │ 0 │ false │ 1440 min │ — │ │ org.dmfs.tasks │ 0 │ false │ 1440 min │ — │ │ org.tasks.opentasks │ 0 │ false │ 1440 min │ — │ │ com.android.contacts │ 0 │ false │ — │ 0 wrongly assigned raw contact(s) │ └──────────────────────────────────┴──────────┴───────────┴──────────┴───────────────────────────────────┘

WiFi only: true Contact group method: GROUP_VCARDS Time range (past days): 90 Default alarm (min before): null Manage calendar colors: true Use event colors: true

DATABASE DUMP

android_metadata

┌────────┐ │ locale │ ├────────┤ │ en_GB │ └────────┘

service

┌────┬───────────────────────────┬─────────┬───────────────────────────────────────────────────────────┐ │ id │ accountName │ type │ principal │ ├────┼───────────────────────────┼─────────┼───────────────────────────────────────────────────────────┤ │ 1 │ mark@stantoncentral.co.uk │ carddav │ http://192.168.1.203/baikal/html/dav.php/principals/Mark/ │ │ 2 │ mark@stantoncentral.co.uk │ caldav │ http://192.168.1.203/baikal/html/dav.php/principals/Mark/ │ └────┴───────────────────────────┴─────────┴───────────────────────────────────────────────────────────┘

sqlite_sequence

┌────────────┬─────┐ │ name │ seq │ ├────────────┼─────┤ │ service │ 2 │ │ homeset │ 2 │ │ collection │ 2 │ │ syncstats │ 963 │ └────────────┴─────┘

homeset

┌────┬───────────┬──────────┬─────────────────────────────────────────────────────────────┬──────────┬─────────────┐ │ id │ serviceId │ personal │ url │ privBind │ displayName │ ├────┼───────────┼──────────┼─────────────────────────────────────────────────────────────┼──────────┼─────────────┤ │ 1 │ 1 │ 1 │ http://192.168.1.203/baikal/html/dav.php/addressbooks/Mark/ │ 1 │ — │ │ 2 │ 2 │ 1 │ http://192.168.1.203/baikal/html/dav.php/calendars/Mark/ │ 1 │ — │ └────┴───────────┴──────────┴─────────────────────────────────────────────────────────────┴──────────┴─────────────┘

collection

┌────┬───────────┬───────────┬──────────────┬─────────────────────────────────────────────────────────────────────────┬──────────────────┬────────────┬───────────────┬─────────────────────┬─────────────┬───────────────────────────────────────────────────────────┬───────┬──────────┬────────────────┬───────────────┬──────────────────┬────────┬──────┐ │ id │ serviceId │ homeSetId │ type │ url │ privWriteContent │ privUnbind │ forceReadOnly │ displayName │ description │ owner │ color │ timezone │ supportsVEVENT │ supportsVTODO │ supportsVJOURNAL │ source │ sync │ ├────┼───────────┼───────────┼──────────────┼─────────────────────────────────────────────────────────────────────────┼──────────────────┼────────────┼───────────────┼─────────────────────┼─────────────┼───────────────────────────────────────────────────────────┼───────┼──────────┼────────────────┼───────────────┼──────────────────┼────────┼──────┤ │ 1 │ 1 │ 1 │ ADDRESS_BOOK │ http://192.168.1.203/baikal/html/dav.php/addressbooks/Mark/default/ │ 1 │ 1 │ 0 │ Mark's address book │ — │ http://192.168.1.203/baikal/html/dav.php/principals/Mark/ │ — │ — │ — │ — │ — │ — │ 1 │ │ 2 │ 2 │ 2 │ CALENDAR │ http://192.168.1.203/baikal/html/dav.php/calendars/Mark/markscalendar0/ │ 1 │ 1 │ 0 │ Mark's calendar │ — │ http://192.168.1.203/baikal/html/dav.php/principals/Mark/ │ — │ — │ 1 │ 1 │ 1 │ — │ 1 │ └────┴───────────┴───────────┴──────────────┴─────────────────────────────────────────────────────────────────────────┴──────────────────┴────────────┴───────────────┴─────────────────────┴─────────────┴───────────────────────────────────────────────────────────┴───────┴──────────┴────────────────┴───────────────┴──────────────────┴────────┴──────┘

syncstats

┌─────┬──────────────┬──────────────────────┬───────────────┐ │ id │ collectionId │ authority │ lastSync │ ├─────┼──────────────┼──────────────────────┼───────────────┤ │ 962 │ 2 │ com.android.calendar │ 1692019381691 │ │ 963 │ 1 │ com.android.contacts │ 1692019381717 │ └─────┴──────────────┴──────────────────────┴───────────────┘

webdav_document: 0 row(s), data not listed here

webdav_mount

┌────┬──────┬─────┐ │ id │ name │ url │ ├────┼──────┼─────┤ └────┴──────┴─────┘

room_master_table

┌────┬──────────────────────────────────┐ │ id │ identity_hash │ ├────┼──────────────────────────────────┤ │ 42 │ 223aa7f0fd53730921ca212a663585d8 │ └────┴──────────────────────────────────┘

APP SETTINGS

  1. SharedPreferencesProvider canWrite=true

┌────────────────────────┬───────────────┐ │ Setting │ Value │ ├────────────────────────┼───────────────┤ │ battery_optimization │ true │ │ distrust_system_certs │ false │ │ foreground_service │ false │ │ time_nextDonationPopup │ 1693218752028 │ └────────────────────────┴───────────────┘

  1. DefaultsProvider canWrite=false

┌──────────────────────────────┬───────────┐ │ Setting │ Value │ ├──────────────────────────────┼───────────┤ │ default_sync_interval │ 14400 │ │ distrust_system_certs │ false │ │ force_read_only_addressbooks │ false │ │ proxy_host │ localhost │ │ proxy_port │ 9050 │ │ proxy_type │ -1 │ │ sync_all_collections │ false │ └──────────────────────────────┴───────────┘

--- END DEBUG INFO ---

Steps to reproduce:

  1. Sync-ing my 'phone contacts and calendar using DAVx5
twikedk commented 1 year ago

Did you upgrade your Baikal server recently?

MarkRS-UK commented 1 year ago

No. In fact, I think this version is the first one I've installed.

twikedk commented 1 year ago

OK mine was caused by the PHP upgrade from 8.1 to 8.2. What is the exact HTTP 500 error you get from DAVx5?

MarkRS-UK commented 1 year ago

I think I misunderstood your question about upgrades. Baikal itself hasn't changed, but the machine the Baikal server is on is frequently updated. It's running Fedora so I update once a week, there are usually many packages updating, and Fedora is updated every six months. It's possible it happened with the PHP 8.1 -> 8.2 upgrade, I didn't notice.

I don't know how to be more exact than the debug trace above, which came from DAVx5. That's all I've seen. Where can I find something else?

twikedk commented 1 year ago

Yep my Baikal installation hadn't changed either but a lot things behind had.

The trace should be fine but you only have '--- END DEBUG INFO ---' no '--- begin debug info ---' which made me think it was not all information that was there.

MarkRS-UK commented 1 year ago

Ah, sorry. I thought I'd got it all, obviously not. I'll look closer if it happens again.

tomamplius commented 1 year ago

I have this issue when i migrate to php 8.2 this issue create error 500

ErrorException: 
Creation of dynamic property Sabre\\CardDAV\\Xml\\Request\\AddressBookMultiGetReport::$addressDataProperties 
is deprecated in /usr/share/baikal/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php:104
Stack trace:
#0 /usr/share/baikal/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php(104): Baikal\\Framework::exception_error_handler()
#1 [internal function]: Sabre\\CardDAV\\Xml\\Request\\AddressBookMultiGetReport::xmlDeserialize()
#2 /usr/share/baikal/vendor/sabre/xml/lib/Reader.php(234): call_user_func()
#3 /usr/share/baikal/vendor/sabre/xml/lib/Reader.php(75): Sabre\\Xml\\Reader->parseCurrentElement()
#4 /usr/share/baikal/vendor/sabre/xml/lib/Service.php(129): Sabre\\Xml\\Reader->parse()
#5 /usr/share/baikal/vendor/sabre/dav/lib/DAV/CorePlugin.php(679): Sabre\\Xml\\Service->parse()
#6 /usr/share/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\\DAV\\CorePlugin->httpReport()
#7 /usr/share/baikal/vendor/sabre/dav/lib/DAV/Server.php(472): Sabre\\DAV\\Server->emit()
#8 /usr/share/baikal/vendor/sabre/dav/lib/DAV/Server.php(253): Sabre\\DAV\\Server->invokeMethod()
#9 /usr/share/baikal/vendor/sabre/dav/lib/DAV/Server.php(321): Sabre\\DAV\\Server->start()
#10 /usr/share/baikal/Core/Frameworks/Baikal/Core/Server.php(119): Sabre\\DAV\\Server->exec()
#11 /usr/share/baikal/html/dav.php(69): Baikal\\Core\\Server->start()
#12 {main}

I have fix the issue in php 8.2 with the bellow code. But it's will not be compatible with php 9 (see here)

class AddressBookMultiGetReport implements XmlDeserializable
{
.......
.......
.......
    public function __set(string $name, mixed $value): void {

    }
.......
.......
.......
ByteHamster commented 1 year ago

This is already tracked in #1154