Nextcloud sync keeps failing and redownloads server copy

Nextcloud version: Nextcloud 15.0.5
Operating system and version (Server): CentOS 7
Operating system and version (Client): Arch Linux
Apache or nginx version: nginx 1.12.2
PHP version: php 7.0.33

The issue you are facing:

Sync is completely useless as it keeps downloading the server version and renames the one it’s supposed to upload to filename (conflicted copy 2019-06-19 032735).xyz.

NC is configured to access an ‘external storage’ partition, which sometimes gets written to by a normal user. I use the XFS filesystem and created a group (let’s call it “StorageGroup”) to always have all permissions for said folder. So I have the following ACL: default:group:StorageGroup:rwx.

So nextcloud runs as the webserver user, right? Well if I do sudo -u nginx bash on the server, I can remove filename.xyz just fine. But trying to edit the file in the synchronized folder on my client machine just causes it to rename the local copy and download the server version.

The exact wording is “Conflict: Server version downloaded, local copy renamed and not uploaded. Path/To/File/filename (conflicted copy 2019-06-19 032735).xyz”

Is this the first time you’ve seen this error? : No
This happens a lot. I usually just end up deleting the files on the server, and copying them over manually using SSHFS access.

Steps to replicate it:

  1. Set up client to sync a folder with the server
  2. edit file on client
  3. save edited file on client

The output of your Nextcloud log in Admin > Logging:


Warning	core	Login failed: 'null' (Remote IP: 'REDACTED')		2019-06-19T14:13:22+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 8583558 got 1212416		2019-06-19T12:01:28+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 8583558 got 1212416		2019-06-19T12:01:28+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 3137538 got 1474560		2019-06-19T12:01:28+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 8208637 got 933888		2019-06-19T12:01:28+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 8208637 got 933888		2019-06-19T12:01:28+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 3137538 got 1474560		2019-06-19T12:01:28+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 10604399 got 7405568		2019-06-19T03:58:52+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 10604399 got 7405568		2019-06-19T03:58:52+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 8909472 got 2719744		2019-06-19T03:58:52+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 8909472 got 2719744		2019-06-19T03:58:52+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 10324247 got 4096000		2019-06-19T03:58:52+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 10324247 got 4096000		2019-06-19T03:58:52+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: Chunks on server do not sum up to 30283534 but to 20283534 bytes		2019-06-19T03:51:32+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: Chunks on server do not sum up to 18604098 but to 8604098 bytes		2019-06-19T03:49:36+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 0		2019-06-19T03:43:52+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 0		2019-06-19T03:43:52+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 0		2019-06-19T03:42:26+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 10000000 got 0		2019-06-19T03:42:26+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 1376 got 0		2019-06-16T20:58:50+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 1376 got 0		2019-06-16T20:58:50+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:58:23+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:58:23+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:56:35+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:56:35+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:52:06+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:52:06+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:47:44+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 1346 got 0		2019-06-16T20:47:44+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:47:44+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 1346 got 0		2019-06-16T20:47:44+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:43:13+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7694 got 0		2019-06-16T20:43:13+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7641 got 0		2019-06-16T20:41:29+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7641 got 0		2019-06-16T20:41:29+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7538 got 0		2019-06-16T20:37:00+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7538 got 0		2019-06-16T20:37:00+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 1141 got 0		2019-06-16T20:32:32+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 7458 got 0		2019-06-16T20:32:32+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 1141 got 0		2019-06-16T20:32:32+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 7458 got 0		2019-06-16T20:32:32+0100
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 120517 got 0		2019-06-15T03:13:48+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: expected filesize 120517 got 0		2019-06-15T03:13:48+0100

Note: I removed the IP for obvious reasons. I also don’t think the size errors are anything to worry about. I have periods of incredibly bad internet when things just kinda break. I don’t get these types of errors once my connection becomes stable again.

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

<?php
$CONFIG = array (
  'instanceid' => 'REDACTED',
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' =>
  array (
    0 => 'REDACTED.COM',
  ),
  'datadirectory' => '/storageset/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '15.0.5.3',
  'overwrite.cli.url' => 'https://REDACTED.COM/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'REDACTED',
  'filelocking.enabled' => false,
  'installed' => true,
  'updater.release.channel' => 'production',
  'mysql.utf8mb4' => true,
  'maintenance' => false,
);

The output of the error log generaged by nginx:

2019/06/19 14:11:28 [error] 395#0: *5961 "/storageset/www/ocm-provider/index.html" is not found (2: No such file or directory), client: REDACTED, server: REDACTED.COM, request: "GET /ocm-provider/ HTTP/2.0", host: "REDACTED.COM:123456"
2019/06/19 14:11:28 [error] 395#0: *5961 "/storageset/www/ocs-provider/index.html" is not found (2: No such file or directory), client: REDACTED, server: REDACTED.COM, request: "GET /ocs-provider/ HTTP/2.0", host: "REDACTED.COM:123456"

Again, I removed the IP, hostname and port number.

Any help would be appreciated, thanks :slight_smile: