Problem with Sync errors and conflicts after NC server and/or client update

Nextcloud version: 19.0.3.1
Operating system and version: NextCloudPi version v1.30.0 (Raspbian GNU/Linux 10)
Apache or nginx version: Apache/2.4.38 (Raspbian)
PHP version: PHP 7.3.19
Database: 10.3.23-MariaDB-0+deb10u1 Raspbian 10

The issue you are facing:

A little more than a week ago, my Nextcloud server automatically updated itself to version 19.0.3.1 at the same time as I updated one of my computers with Next Cloud client to version 3.0.1 from 2.6.5. Now something strange happened! From having worked perfectly for a long time, files that did NOT sync started to appear and also a lot of sync conflicts.
Initially, I thought something was wrong with NC when I found the same problem on another of my computers that I also updated the client to version 3.0.1 from 2.6.5. This resulted in a smaller number of files with similar problems as the first time. It seems that the serious sync error according to the client log is due to a “400 Bad request” response from the server or a “Connection Closed” error in addition to sync conflicts.
I uninstalled client version 3.0.1 on PC number 2 above and reinstalled 2.6.5 but with the same problem.
Now I focused on the NC server but this one passed all my tests and worked without problems in the web interface. The web server seems OK and NC also seems to do what it should if I juggle a bit with files via the web interface. Have searched a bit in some logs but have not found anything that I think may be the cause … So WHAT is the problem? All suggestions and insights are gratefully received!

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

Steps to replicate it:

  1. Don’t know how to replicate other than having done the updates mentioned.

The output of your Nextcloud log in Admin > Logging:

[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":154,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1104,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["Upps\u00e4gning av franchiseavtal (Kommenterad JBM) - Examensarbete inom juristprogrammet - \u00d6rebro universitet.pdf",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":527,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["files/JBM/Home/JBM/Upps\u00e4gning av franchiseavtal (Kommenterad JBM) - Examensarbete inom juristprogrammet - \u00d6rebro universitet.pdf",null,null]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":320,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":238,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/2.6.5stable-Win64 (build 20200710) (Nextcloud)","version":"19.0.3.1"}
{"reqId":"X2yOCP4rmTnTdboPScunWQAAAFQ","level":4,"time":"2020-09-24T12:16:09+00:00","remoteAddr":"192.168.88.17","user":"JBM","app":"webdav","method":"PUT","url":"/remote.php/dav/files/JBM/Home/JBM/Upps%C3%A4gning%20av%20franchiseavtal%20(Kommenterad%20JBM)%20-%20Examensarbete%20inom%20juristprogrammet%20-%20%C3%96rebro%20universitet.pdf","message":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 777929 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":154,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1104,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["Upps\u00e4gning av franchiseavtal (Kommenterad JBM) - Examensarbete inom juristprogrammet - \u00d6rebro universitet.pdf",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":527,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["files/JBM/Home/JBM/Upps\u00e4gning av franchiseavtal (Kommenterad JBM) - Examensarbete inom juristprogrammet - \u00d6rebro universitet.pdf",null,null]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":320,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":238,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/2.6.5stable-Win64 (build 20200710) (Nextcloud)","version":"19.0.3.1"}
{"reqId":"X2yOCP4rmTnTdboPScunWQAAAFQ","level":3,"time":"2020-09-24T12:16:09+00:00","remoteAddr":"192.168.88.17","user":"JBM","app":"PHP","method":"PUT","url":"/remote.php/dav/files/JBM/Home/JBM/Upps%C3%A4gning%20av%20franchiseavtal%20(Kommenterad%20JBM)%20-%20Examensarbete%20inom%20juristprogrammet%20-%20%C3%96rebro%20universitet.pdf","message":"Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#683","userAgent":"Mozilla/5.0 (Windows) mirall/2.6.5stable-Win64 (build 20200710) (Nextcloud)","version":"19.0.3.1"}
{"reqId":"X2yOCP4rmTnTdboPScunWQAAAFQ","level":3,"time":"2020-09-24T12:16:09+00:00","remoteAddr":"192.168.88.17","user":"JBM","app":"PHP","method":"PUT","url":"/remote.php/dav/files/JBM/Home/JBM/Upps%C3%A4gning%20av%20franchiseavtal%20(Kommenterad%20JBM)%20-%20Examensarbete%20inom%20juristprogrammet%20-%20%C3%96rebro%20universitet.pdf","message":"Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#683","userAgent":"Mozilla/5.0 (Windows) mirall/2.6.5stable-Win64 (build 20200710) (Nextcloud)","version":"19.0.3.1"}
{"reqId":"X2yOCP4rmTnTdboPScunWQAAAFQ","level":3,"time":"2020-09-24T12:16:09+00:00","remoteAddr":"192.168.88.17","user":"JBM","app":"PHP","method":"PUT","url":"/remote.php/dav/files/JBM/Home/JBM/Upps%C3%A4gning%20av%20franchiseavtal%20(Kommenterad%20JBM)%20-%20Examensarbete%20inom%20juristprogrammet%20-%20%C3%96rebro%20universitet.pdf","message":"Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#683","userAgent":"Mozilla/5.0 (Windows) mirall/2.6.5stable-Win64 (build 20200710) (Nextcloud)","version":"19.0.3.1"}

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

<?php
$CONFIG = array (
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    11 => '85.XXX.XXX.35',
    1 => '192.168.XXX.65',
    20 => 'XXXXXXXXXXXXXXXX.com',
    21 => 'XXXXXXXXXXXXXXX.org',
  ),
  'datadirectory' => '/media/myCloudDrive/ncdata',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  'overwrite.cli.url' => 'https://XXXXXXXXXXXXXXXXX.com/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXXXXX',
  'dbpassword' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'installed' => true,
  'instanceid' => 'XXXXXXXXXXXXXXXXX',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'webmaster',
  'mail_domain' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'loglevel' => 1,
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',
  'log_type' => 'file',
  'mail_sendmailmode' => 'pipe',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => 'XXXXXXXXXXXXXXXXXXXXXXXXX.com',
   'instanceid' => 'XXXXXXXXXXXXXXXXXXX',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'webmaster',
  'mail_domain' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'loglevel' => 1,
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',
  'log_type' => 'file',
  'mail_sendmailmode' => 'pipe',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => 'XXXXXXXXXXXXXXXXXX.com',
  'mail_smtpport' => '465',
  'theme' => '',
  'simpleSignUpLink.shown' => false,
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'mail_smtppassword' => 'XXXXXXXXXXXXXX',
  'data-fingerprint' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
);

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

[Thu Sep 24 11:49:28.360487 2020] [access_compat:error] [pid 23575:tid 1707504672] [client 85.228.46.2:51988] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Thu Sep 24 11:57:28.331908 2020] [access_compat:error] [pid 23576:tid 1724306464] [client 85.228.46.2:52026] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Thu Sep 24 12:13:28.337446 2020] [access_compat:error] [pid 23576:tid 1715905568] [client 85.228.46.2:52108] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Thu Sep 24 12:21:28.349808 2020] [access_compat:error] [pid 23575:tid 1766302752] [client 85.228.46.2:52152] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Thu Sep 24 12:37:28.355354 2020] [access_compat:error] [pid 23576:tid 1690702880] [client 85.228.46.2:52235] AH01797: client denied by server configuration: /var/www/nextcloud/config
[Thu Sep 24 12:41:41.544282 2020] [proxy_fcgi:error] [pid 23576:tid 1724306464] [client 192.168.88.17:61127] AH01071: Got error 'PHP message: PHP Notice:  Unknown: file created in the system's temporary directory in Unknown on line 0PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'
[Thu Sep 24 12:44:09.247192 2020] [proxy_fcgi:error] [pid 23576:tid 1741108256] [client 192.168.88.17:61162] AH01071: Got error 'PHP message: PHP Notice:  Unknown: file created in the system's temporary directory in Unknown on line 0PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'
[Thu Sep 24 12:44:52.582137 2020] [proxy_fcgi:error] [pid 23576:tid 1724306464] [client 192.168.88.17:61170] AH01071: Got error 'PHP message: PHP Notice:  Unknown: file created in the system's temporary directory in Unknown on line 0PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'
[Thu Sep 24 12:45:38.550405 2020] [proxy_fcgi:error] [pid 23576:tid 1741108256] [client 192.168.88.17:61179] AH01071: Got error 'PHP message: PHP Notice:  Unknown: file created in the system's temporary directory in Unknown on line 0PHP message: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0'
[Thu Sep 24 12:53:28.486857 2020] [access_compat:error] [pid 23576:tid 1799873568] [client 85.228.46.2:52307] AH01797: client denied by server configuration: /var/www/nextcloud/config


Update: For some peculiar reason there where mentioned in one Apache log file (nc-error.log) that the webserver couldn’t access a certain temp directory. From what I understand this was a new temp directory or rather at a new location the server where trying to access.
I have no clue why this was changed all of a sudden after working with the previous setting for like a year or so. But there it was… :wink:

I hope this can help someone else who have similar experiences and I would like to push for that everyone who starts a support thread and obtain a solution one way or the other, also publish the solution for others to benefit from…

Can I be of any help don’t hesitate to reach out! :slightly_smiling_face:

Regards!
/JBM

1 Like