contacts
contacts copied to clipboard
Fatal errors with macOS clients and CardDAV sync
Describe the bug
Since upgrading to NC 20.0.4 and Contacts 3.4.1, each time an Apple device syncs it produces this fatal error:
Doctrine\DBAL\DBALException: An exception occurred while executing 'INSERT INTO `oc_properties` (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)' with params ["username", "addressbooks\/users\/username", "{http:\/\/calendarserver.org\/ns\/}me-card", {}]: Object of class Sabre\DAV\Xml\Property\Href could not be converted to string
To my knowledge, this was not a recurring error on NC 19 and Contacts 3.3.0, so hopefully it's a matter of reverting a regression?
Not sure if this is related to #213.
To Reproduce Steps to reproduce the behavior:
- Upgrade to NC 20.0.4
- Sync Apple device that has a user-defined Me Card
- View logs
Expected behavior Sync of all contacts, including Me Card, without fatal error
Actual behavior Above fatal error inserted into logs for each sync. Updates to the contact card that is set as the Me Card are unreliable. No issues to other contact cards found yet.
Server configuration
Operating system: Ubuntu 20.04
Web server: Nginx
Database: MariaDB
PHP version: 7.4
Nextcloud version: 20.04
Contacts version: 3.4.2
Updated from an older Nextcloud or fresh install: Upgrading from NC 19.0.6
Signing status: No errors have been found.
Client configuration
Operating system: macOS 10.15.7, iOS/iPadOS 14.3
CardDAV-clients: Macs, iPhones, and iPads
Nextcloud log
The following is an example of the full segment of the log that repeats
{"reqId":"hash","level":4,"time":"2021-01-05T17:35:01+00:00","remoteAddr":"1.1.1.1","user":"username","app":"webdav","method":"PROPPATCH","url":"/remote.php/dav/addressbooks/users/username/","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"An exception occurred while executing 'INSERT INTO `oc_properties` (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)' with params [\"username\", \"addressbooks\\/users\\/username\", \"{http:\\/\\/calendarserver.org\\/ns\\/}me-card\", {}]:\n\nObject of class Sabre\\DAV\\Xml\\Property\\Href could not be converted to string","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","line":149,"function":"wrapException","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1071,"function":"driverExceptionDuringQuery","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/DB/Connection.php","line":222,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":270,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":148,"function":"updateProperties","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":295,"function":"OCA\\DAV\\DAV\\{closure}","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":230,"function":"doCallBackMultiProp","class":"Sabre\\DAV\\PropPatch","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1271,"function":"commit","class":"Sabre\\DAV\\PropPatch","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":393,"function":"updateProperties","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropPatch","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":167,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","Line":172,"Previous":{"Exception":"Error","Message":"Object of class Sabre\\DAV\\Xml\\Property\\Href could not be converted to string","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php","line":81,"function":"bindValue","class":"PDOStatement","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1556,"function":"bindValue","class":"Doctrine\\DBAL\\Driver\\PDOStatement","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1061,"function":"_bindTypedValues","class":"Doctrine\\DBAL\\Connection","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/DB/Connection.php","line":222,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":270,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":148,"function":"updateProperties","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":295,"function":"OCA\\DAV\\DAV\\{closure}","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":230,"function":"doCallBackMultiProp","class":"Sabre\\DAV\\PropPatch","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1271,"function":"commit","class":"Sabre\\DAV\\PropPatch","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":393,"function":"updateProperties","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropPatch","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":167,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php","Line":81},"CustomMessage":"--"},"userAgent":"Mac OS X/10.15.7 (19H114) AddressBookCore/1","version":"20.0.4.0","id":"hash"}
Hey!
Can you link the vcard?
@skjnldsv Sorry for the slow reply. I skimmed through the vcard, but a) removing private information would make it empty, and b) in both cases of exporting the vcard from the macOS Contacts app or Nextcloud, there was no export of a field that seemed problematic. Sorry.
I did do some more digging though, and the only client creating this fatal error is just macOS (in my case 10.15.7) not any iOS clients. It also occurs with any vcard specified as the "Me card" so it has nothing to do with the specific vcard designated as the "Me card". This also suggests it's a problem only with macOS (though not sure why I haven't had it before, so perhaps only with 10.15.7 or similarly recent...). I do not play to upgrade to macOS 11 soon, but we can also wait to see if the error persists with that version...
Also reading the error log more carefully, it seems the issue is not related to updating a particular vcard but instead related to inserting something for the Nextcloud user into oc_properties? Thanks.
@skjnldsv I can confirm this error persists when macOS Big Sur (11.2) clients connect and there is a "Me card" assigned.
I can confirm this error persists on macOS 11.3.
@skjnldsv Confirming that there's still a fatal error with CardDAV sync macOS 11.4 clients and NC 21.0.3 with Contacts 4.0.0.
But the error is now quite different. No mention of a 'me card' and seems to be an issue converting a string among other things.
{"reqId":"XXXXX","level":4,"time":"XXXXX","remoteAddr":"XXXXX","user":"user","app":"webdav","method":"PROPPATCH","url":"/remote.php/dav/addressbooks/users/user/","message":{"Exception":"Error","Message":"Object of class Sabre\\DAV\\Xml\\Property\\Href could not be converted to string","Code":0,"Trace":[{"file":"/var/www/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":82,"function":"execute","class":"PDOStatement","type":"->"},
{"file":"/var/www/3rdparty/doctrine/dbal/src/Connection.php","line":1138,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},
{"file":"/var/www/lib/private/DB/Connection.php","line":257,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/3rdparty/doctrine/dbal/src/Connection.php","line":1747,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/lib/private/DB/Connection.php","line":236,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},
{"file":"/var/www/lib/private/DB/ConnectionAdapter.php","line":75,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},
{"file":"/var/www/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":270,"function":"executeUpdate","class":"OC\\DB\\ConnectionAdapter","type":"->"},
{"file":"/var/www/apps/dav/lib/DAV/CustomPropertiesBackend.php","line":148,"function":"updateProperties","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":288,"function":"OCA\\DAV\\DAV\\{closure}","class":"OCA\\DAV\\DAV\\CustomPropertiesBackend","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/PropPatch.php","line":227,"function":"doCallBackMultiProp","class":"Sabre\\DAV\\PropPatch","type":"->"},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1263,"function":"commit","class":"Sabre\\DAV\\PropPatch","type":"->"},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":373,"function":"updateProperties","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/var/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropPatch","class":"Sabre\\DAV\\CorePlugin","type":"->"},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},
{"file":"/var/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},
{"file":"/var/www/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},
{"file":"/var/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},
{"file":"/var/www/remote.php","line":167,"args":["/var/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":82,"CustomMessage":"--"},"userAgent":"macOS/11.4 (20F71) AddressBookCore/2452.7","version":"21.0.3.1","id":"XXXXX"}
I can confirm this error persists on macOS 12.4, NC 23.0.5, contacts 4.1.1
Persists on macOS 12.4, Nextcloud Server 24.0.1, Contacts 4.1.1.
Error log appears to have changed again, but remains fatal:
[webdav] Fatal: Error: Object of class Sabre\DAV\Xml\Property\Href could not be converted to string at <<closure>>
0. /var/www/html/nextcloud/apps/dav/lib/DAV/CustomPropertiesBackend.php line 186
OCA\DAV\DAV\CustomPropertiesBackend->updateProperties("*** sensitive parameters replaced ***")
1. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php line 288
OCA\DAV\DAV\CustomPropertiesBackend->OCA\DAV\DAV\{closure}("*** sensitive parameters replaced ***")
2. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php line 227
Sabre\DAV\PropPatch->doCallBackMultiProp()
3. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1264
Sabre\DAV\PropPatch->commit()
4. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 373
Sabre\DAV\Server->updateProperties("*** sensitive parameters replaced ***")
5. /var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpPropPatch()
6. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
Sabre\DAV\Server->emit()
7. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
Sabre\DAV\Server->invokeMethod()
8. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
Sabre\DAV\Server->start()
9. /var/www/html/nextcloud/apps/dav/lib/Server.php line 352
Sabre\DAV\Server->exec()
10. /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
11. /var/www/html/nextcloud/remote.php line 166
require_once("/var/www/html/n ... p")
PROPPATCH /remote.php/dav/addressbooks/users/*** sensitive parameters replaced ***/
Still present on MacOS 12.4, Nextcloud Server 24.0.2, Contacts 4.1.1
Fatal webdav Error: Object of class Sabre\DAV\Xml\Property\Href could not be converted to string at 2022-06-29T15:15:32+02:00
apps/dav/lib/DAV/CustomPropertiesBackend.php line 331
0. .../lib/DAV/CustomPropertiesBackend.php line 186
OCA\DAV\DAV\CustomPropertiesBackend->updateProperties("*** sensitive parameters replaced ***")
1. .../sabre/dav/lib/DAV/PropPatch.php line 288
OCA\DAV\DAV\CustomPropertiesBackend->OCA\DAV\DAV\{closure}("*** sensitive parameters replaced ***")
2. 3rdparty/sabre/dav/lib/DAV/PropPatch.php line 227
Sabre\DAV\PropPatch->doCallBackMultiProp(["{http:\/\/calendarserver.org\/ns\/}me-card"], Closure {})
3. 3rdparty/sabre/dav/lib/DAV/Server.php line 1264
Sabre\DAV\PropPatch->commit()
4. 3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 373
Sabre\DAV\Server->updateProperties("*** sensitive parameters replaced ***")
5. 3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpPropPatch(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
6. 3rdparty/sabre/dav/lib/DAV/Server.php line 472
Sabre\DAV\Server->emit("method:PROPPATCH", [Sabre\HTTP\Request {},Sabre\HTTP\Response {}])
7. 3rdparty/sabre/dav/lib/DAV/Server.php line 253
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
8. 3rdparty/sabre/dav/lib/DAV/Server.php line 321
Sabre\DAV\Server->start()
9. apps/dav/lib/Server.php line 352
Sabre\DAV\Server->exec()
10. apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
11. remote.php line 166
require_once("\/var\/www\/html\/apps\/dav\/appinfo\/v2\/remote.php")
The Error is still present in Nextcloud 24.0.3, Contacts App 4.2.0 and latest MacOS 12.5
I no longer see errors in log. Nextcloud 24.0.3 (docker image), Contacts 4.2.0
I just identified a bug in the Apache rewrite rule that do not apply any reverse proxy configuration that would change request scheme from https to http. This may have solve the problem for me.
For more details, see issue nextcloud/server#32826
After a today upgrade to Nextcloud 24.0.4 (docker image) and Contact 4.2.0, the exact same problem is back. Only line numbers of errors have changed due to code changes.
Fatal webdav Error: Object of class Sabre\DAV\Xml\Property\Href could not be converted to string at 2022-08-31T14:54:55+02:00
apps/dav/lib/DAV/CustomPropertiesBackend.php line 323
0. .../lib/DAV/CustomPropertiesBackend.php line 187
OCA\DAV\DAV\CustomPropertiesBackend->updateProperties("*** sensitive parameters replaced ***")
1. .../sabre/dav/lib/DAV/PropPatch.php line 288
OCA\DAV\DAV\CustomPropertiesBackend->OCA\DAV\DAV\{closure}("*** sensitive parameters replaced ***")
2. 3rdparty/sabre/dav/lib/DAV/PropPatch.php line 227
Sabre\DAV\PropPatch->doCallBackMultiProp(["{http:\/\/calendarserver.org\/ns\/}me-card"], Closure {})
3. 3rdparty/sabre/dav/lib/DAV/Server.php line 1264
Sabre\DAV\PropPatch->commit()
4. 3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 373
Sabre\DAV\Server->updateProperties("*** sensitive parameters replaced ***")
5. 3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpPropPatch(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
6. 3rdparty/sabre/dav/lib/DAV/Server.php line 472
Sabre\DAV\Server->emit("method:PROPPATCH", [Sabre\HTTP\Request {},Sabre\HTTP\Response {}])
7. 3rdparty/sabre/dav/lib/DAV/Server.php line 253
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
8. 3rdparty/sabre/dav/lib/DAV/Server.php line 321
Sabre\DAV\Server->start( )
9. apps/dav/lib/Server.php line 358
Sabre\DAV\Server->exec()
10. apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
11. remote.php line 166
require_once("\/var\/www\/html\/apps\/dav\/appinfo\/v2\/remote.php")
Can't figure why this error stopped to appear in logs for some time
Same error for me.
I'm having this issue too - Posted my findings on Nextcloud forum but not getting any response. Not sure what to do with it.
https://help.nextcloud.com/t/this-shows-in-logging-occasionally-something-to-do-with-address-book/
I am experiencing the same issue!
Using Nextcloud 24.0.7 and Contacts 4.2.2 and also using Nextcloud 25.0.1 and Contacts 5.0.1
I would be pleased to provide advanced analysis, but I miss a guide for doing it.
Can anyone tell me roughly how to proceed or point out a document explaining it?
You could try with a loglevel of 0 (debug) and see if you get more insightful data https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html
Thank you @ChristophWurst. Indeed there is no more error in the journal since the migration from NC 24.0.7 to NC 25 (2 weeks ago). I had a quick look to the changelog, without finding anything evident that may have impacted it (like sabre upgrade, etc., bug fixes, etc.).
You have to reproduce the issue one more time after adjusting the log levels. Only then more info will be written.
Indeed before the upgrade to NC 25, the server was logging several dozens of these fatal errors each day. Since the migration, not only one. I should have noticed before, but this is not the case :-/ I guess the problem is now solved, even if I don't know why.