Fatal Error: Sabre\Xml\LibXMLException: Document is empty on line 1, column 1

I have these Error once or twice the day in my error log. I don’t have a clue where it comes from. My Nextcloud is running and It seems like all devices sync it’s data. i have no clue if there is really an impact. Anyway it is a fatal error and maybe there fore I want to find the culprit.

[/details]

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

The issue you are facing:

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

Steps to replicate it:

Can’t say. I have the Nextcloud server freshly installed since three days. After setting all things up, I recognized this error in the Logs. I haven’t found out, when it really occurs. The connected devices sync every 30 Minutes. But the error occurs only once or twice a day. I also haven’t recognized, that data wasn’t synced.

The output of your Nextcloud log in Admin > Logging:

> Fatal	webdav	Sabre\Xml\LibXMLException: Document is empty on line 1, column 1
> /var/www/nextcloud/3rdparty/sabre/xml/lib/Service.php - line 129:
> Sabre\Xml\Reader->parse()
> /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 680:
> Sabre\Xml\Service->parse()
> /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
> Sabre\DAV\CorePlugin->httpReport()
> /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 472:
> Sabre\DAV\Server->emit()
> /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:
> Sabre\DAV\Server->invokeMethod()
> /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:
> Sabre\DAV\Server->start()
> /var/www/nextcloud/apps/dav/lib/Server.php - line 332:
> Sabre\DAV\Server->exec()
> /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:
> OCA\DAV\Server->exec()
> /var/www/nextcloud/remote.php - line 167:
> require_once("/var/www/ne ... p")

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

> <?php
> $CONFIG = array (
>   'instanceid' => 'oc12x68cjkrl',
>   'passwordsalt' => 'xxxxxx',
>   'secret' => 'xxxxxx',
>   'trusted_domains' =>
>   array (
>     0 => 'xxxxxx.net',
>   ),
>   'datadirectory' => '/var/nextcloud_data',
>   'dbtype' => 'mysql',
>   'version' => '21.0.1.1',
>   'overwrite.cli.url' => 'https://xxxxxx.net',
>   'dbname' => 'nextcloud_db',
>   'dbhost' => 'localhost',
>   'dbport' => '',
>   'dbtableprefix' => 'oc_',
>   'mysql.utf8mb4' => true,
>   'dbuser' => 'nextcloud_db_user',
>   'dbpassword' => 'xxxxxx',
>   'installed' => true,
>   'memcache.local' => '\\OC\\Memcache\\APCu',
>   'default_phone_region' => 'DE',
>   'overwriteprotocol' => 'https',
>   'logtimezone' => 'Europe/Berlin',
>   'auth.bruteforce.protection.enabled' => false,
>   'filelocking.enabled' => 'true',
>   'memcache.locking' => '\\OC\\Memcache\\Redis',
>   'redis' =>
>   array (
>     'host' => '/var/run/redis/redis-server.sock',
>     'port' => 0,
>     'timeout' => 0.0,
>   ),
>   'mail_smtpmode' => 'smtp',
>   'mail_smtpsecure' => 'tls',
>   'mail_sendmailmode' => 'smtp',
>   'mail_from_address' => 'mail',
>   'mail_domain' => 'xxxxxx',
>   'mail_smtpauthtype' => 'LOGIN',
>   'mail_smtpauth' => 1,
>   'mail_smtphost' => 'smtp.ionos.de',
>   'mail_smtpport' => '587',
>   'mail_smtpname' => 'xxxxxx',
>   'mail_smtppassword' => 'xxxxxx',
>   'maintenance' => false,
> );
> ~

The output of your Apache/nginx/system log in /var/log/____: I restarted the server today, so it’s somewhat short. But the above error occurred once while the server start (at 16:31:30)

> 2021/05/01 13:17:48 [warn] 1131#1131: *18 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/1/00/0000000001 while reading upstream, client: 109.250.140.103, server: xxxxxx.net, request: "GET /apps/theming/image/background HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> 2021/05/01 13:22:46 [warn] 1131#1131: *94 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 109.250.140.103, server: xxxxxx.net, request: "REPORT /remote.php/dav/addressbooks/users/Uli/kontakte/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> 2021/05/01 13:33:49 [error] 1132#1132: *4 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 109.250.140.103, server: xxxxxx.net, request: "GET /apps/logreader/poll?lastReqId=ypyUCK6FdmulNFo9ZRs9 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> 2021/05/01 16:32:38 [warn] 1150#1150: *133 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/1/00/0000000001 while reading upstream, client: 109.250.140.103, server: xxxxxx.net, request: "REPORT /remote.php/dav/addressbooks/users/Uli/kontakte/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> 2021/05/01 17:02:59 [crit] 1150#1150: *944 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 192.241.214.44, server: 0.0.0.0:443
> 2021/05/01 17:34:52 [warn] 1150#1150: *1582 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 109.250.140.103, server: xxxxxx.net, request: "GET /apps/theming/image/background HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> 2021/05/01 17:35:13 [warn] 1150#1150: *1615 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/3/00/0000000003 while reading upstream, client: 109.250.140.103, server: xxxxxx.net, request: "GET /apps/theming/image/background HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xxxxxx.net"
> ~

Seems like the problem is solved. There was a corrupted contact, which led to this problem. After repairing it. My log looks fine now.