Contacts 4.2.2 - Error 500 with Thunderbird Cardbook

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.6
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version (eg, 7.4): 7.4

The issue you are facing: After updating birthday and anniversary info in contacts in a shared address book replication for that address book fails in Thunderbird Cardbook with HTTP 500 errors on the client and Sabre\XmlLibXMLException: xmlParseEntityRef: no name on line in in NC logs.

I don’t know which entries (if any) are causing the problem. Thunderbird error console shows the request generated a list of .vcf to retrieve so I suspect initial connection is OK but one or more of the requested entries triggered the error.

My first thought is this was related to updates to birthdays and anniversaries, not it looks to be something specific to Contacts 4.2.2. Checking the list from the cardbook sync request appears to be missing 12 contacts, but all the ones listed are accessible via the URLs. No clue what is triggering the sync fail.

Contacts 4.2.0 works fine (checked on test NC install)
Contacts 4.2.2 fails silently with Thunderbird 91 + Cardbook 77
Contacts 4.2.2 errors with brief status message on Thunderbird 102 + Cardbook 82.7

No issues with an Outlook + sync plugin or an phone with Davx5 on any address books on either Contacts version.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Upload contacts, all work for few weeks. No issues with Thunderbird CardBook, DavX5 etc.
  2. Edits to names etc no issues, syncs to all devices.
  3. Started editing birthdays and anniversaries, didn’t notice issues at first.
  4. Adding address book that hasn’t yet been sorted to new laptop works. Adding address book edited birthdays fails to add any contacts. Then found existing syncs now fail as well.

The output of your Nextcloud log in Admin > Logging:

[webdav] Fatal: Sabre\Xml\LibXMLException: xmlParseEntityRef: no name
 on line 1, column 3138 at <<closure>>

 0. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Element/Base.php line 80
    Sabre\Xml\Reader->parseInnerTree()
 1. <<closure>>
    Sabre\Xml\Element\Base::xmlDeserialize()
 2. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php line 235
    call_user_func()
 3. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php line 170
    Sabre\Xml\Reader->parseCurrentElement()
 4. /srv/nextcloud/www/3rdparty/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php line 79
    Sabre\Xml\Reader->parseInnerTree()
 5. <<closure>>
    Sabre\CardDAV\Xml\Request\AddressBookMultiGetReport::xmlDeserialize()
 6. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php line 235
    call_user_func()
 7. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php line 75
    Sabre\Xml\Reader->parseCurrentElement()
 8. /srv/nextcloud/www/3rdparty/sabre/xml/lib/Service.php line 129
    Sabre\Xml\Reader->parse()
 9. /srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 685
    Sabre\Xml\Service->parse()
10. /srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpReport()
11. /srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
12. /srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
13. /srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
14. /srv/nextcloud/www/apps/dav/lib/Server.php line 358
    Sabre\DAV\Server->exec()
15. /srv/nextcloud/www/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
16. /srv/nextcloud/www/remote.php line 166
    require_once("/srv/nextcloud/ ... p")

REPORT /remote.php/dav/addressbooks/users/--userid--/--addressbook name--/
from 192.168.x.x by --userid-- at 2022-10-11T21:32:57+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '...',
  'passwordsalt' => '...',
  'secret' => '...',
  'trusted_domains' => 
  array (
    0 => '...',
  ),
  'datadirectory' => '/srv/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'overwrite.cli.url' => 'http://...',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '...',
  'dbpassword' => '...',
  'installed' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '...-notify',
  'mail_domain' => '...',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '...',
  'mail_smtpport' => '465',
  'mail_smtpname' => '...',
  'mail_smtppassword' => '...',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'default_phone_region' => 'GB',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => '...',
);

The output of your Apache/nginx/system log in /var/log/____:

::1 - - [11/Oct/2022:22:43:58 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f (internal dummy connection)"
::1 - - [11/Oct/2022:23:07:05 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f (internal dummy connection)"

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"yv4T9fnrXXtHK8mV3q0z","level":4,"time":"2022-10-11T22:01:04+00:00","remoteAddr":"--IP--","user":"--userid--","app":"webdav","method":"REPORT","url":"/remote.php/dav/addressbooks/users/--userid--/--calendar--/","message":"xmlParseEntityRef: no name\n on line 1, column 3138","userAgent":"Thunderbird CardBook/82.7","version":"24.0.6.1","exception":{"Exception":"Sabre\\Xml\\LibXMLException","Message":"xmlParseEntityRef: no name\n on line 1, column 3138","Code":0,"Trace":[{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Element/Base.php","line":80,"function":"parseInnerTree","class":"Sabre\\Xml\\Reader","type":"->"},{"function":"xmlDeserialize","class":"Sabre\\Xml\\Element\\Base","type":"::"},{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php","line":235,"function":"call_user_func"},{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php","line":170,"function":"parseCurrentElement","class":"Sabre\\Xml\\Reader","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php","line":79,"function":"parseInnerTree","class":"Sabre\\Xml\\Reader","type":"->"},{"function":"xmlDeserialize","class":"Sabre\\CardDAV\\Xml\\Request\\AddressBookMultiGetReport","type":"::"},{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php","line":235,"function":"call_user_func"},{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php","line":75,"function":"parseCurrentElement","class":"Sabre\\Xml\\Reader","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Service.php","line":129,"function":"parse","class":"Sabre\\Xml\\Reader","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":685,"function":"parse","class":"Sabre\\Xml\\Service","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpReport","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":358,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":166,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/3rdparty/sabre/xml/lib/Reader.php","Line":151,"CustomMessage":"--"}}
root@nextcloud1:/srv/nextcloud/data# 

Thunderbird error console : Request

<?xml version="1.0" encoding="utf-8"?>
<C:addressbook-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
<D:prop>
<D:getetag/>
<C:address-data Content-Type='text/vcard' version='4.0'/>
</D:prop>
<D:href>/remote.php/dav/addressbooks/users/--userid--/--addressbook--/6bfda674-ee8a-4f81-91ee-66b2ae179e7c.vcf</D:href>
<D:href>/remote.php/dav/addressbooks/users/--userid--/--addressbook--/--name---89012892.vcf</D:href>
<D:href>/remote.php/dav/addressbooks/users/--userid--/--addressbook--/{1B3C2E17-1667-423D-9F10-A9FA405DB454}.vcf</D:href>
<D:href>/remote.php/dav/addressbooks/users/--userid--/--addressbook--/{DDB9F690-6AAC-4ED0-A200-DC6198EA2EB7}.vcf</D:href>
<D:href>/remote.php/dav/addressbooks/users/--userid--/--addressbook--/--name---377346644.vcf</D:href>
-- and a load more ---
</C:addressbook-multiget>

Thunderbird error console : Response

XHRREPORThttps://--hostname--/remote.php/dav/addressbooks/users/--userid--/--addressbook--/
[HTTP/1.1 500 Internal Server Error 48ms]

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\Xml\LibXMLException</s:exception>
  <s:message>xmlParseEntityRef: no name
 on line 1, column 2162</s:message>
</d:error>