Nextcloud not syncing my files from remote server after hard drive replacement

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, 12.0.2): 16.0.1
Operating system and version (eg, Ubuntu 17.04): Debian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.1): 7.3.4-2

The issue you are facing: I had to wipe one of my computer’s hard drive and download my Nextcloud backup back to the fresh hard drive, but the client isn’t syncing anything from the server to the hard drive. The operating system & nextcloud client install hasn’t been changed as it’s on a different hard drive.

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

Steps to replicate it:

  1. Wiped data store hard drive on Linux client (Linux Mint 19.1 Cinnamon) (other hard drives containing OS and Nextcloud client still intact)
  2. Try to restore data from Nextcloud back to the wiped hard drive using the Linux Nextcloud client version 2.5.2git
  3. Nextcloud client seems to say “Sync successful” but nothing got copied back to the client from the server, even though the client shows a list of folders and total file size is 618GB.

The output of your Nextcloud log in Admin > Logging:

Warning	files_versions	D0 is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.	
2019-10-05T13:27:39+0100
Warning	files_versions	D0 is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.	
2019-10-05T13:27:39+0100
Warning	files_versions	D0 is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.	
2019-10-05T13:27:39+0100
Fatal	webdav	Doctrine\DBAL\Exception\DeadlockException: An exception occurred while executing 'UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?)) WHERE (`storage` = ?) AND (`path` LIKE ?)' with params [3, "files_encryption\/keys\/files_trashbin\/files\/monero-blockchain-export.d1570278449", 100, "files_encryption\/keys\/files_trashbin\/files\/monero-blockchain-export.d1570278449", 100, 3, "files\\_encryption\/keys\/files\/Downloads\/monero-wallet-gui.app\/Contents\/MacOS\/monero-blockchain-export\/%"]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction	
2019-10-05T13:27:37+0100
Error	PHP	imagecreatefromstring(): Empty string or invalid image at /var/www/html/nextcloud/lib/private/legacy/image.php#622	
2019-10-05T13:23:33+0100
Error	PHP	file_get_contents(/media/cloud/sync/kit/files/tmp/oc_tmp_OlOL3X-.gif): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#216	
2019-10-05T13:23:33+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df214): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df213): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c89): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c88): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e55): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:17:46+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e54): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:17:46+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:05:11+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e55): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:05:11+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T13:05:11+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e54): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T13:05:11+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:58:38+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c88): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:58:38+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:58:38+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e55): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:58:38+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:58:38+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e54): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:58:38+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c88): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df214): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c89): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df213): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e55): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:50+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e54): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:50+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:08+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df214): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:08+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:08+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000001b14e55): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:08+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:08+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/00000000023df213): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:08+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:08+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c89): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:08+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: Could not open file	
2019-10-05T11:49:08+0100
Error	PHP	fopen(/media/cloud/sync/kit/files/.fseventsd/0000000002283c88): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#284	
2019-10-05T11:49:08+0100

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

<?php
$CONFIG = array (
  
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '192.168.1.6',
  ),
  'datadirectory' => '/media/cloud/sync/',
  'dbtype' => 'mysql',
  'version' => '16.0.1.1',
  'overwrite.cli.url' => 'https://192.168.1.6/nextcloud',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpauthtype' => 'PLAIN',

  'trashbin_retention_obligation' => 'D0, auto',
  'versions_retention_obligation' => 'D0, auto',
  'memcache.local' => '\OC\Memcache\Redis',
  'redis' => array(
  'host' => 'localhost',
  'port' => 6379,),
  'memcache.locking' => '\OC\Memcache\Redis',
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____: (just the error log)

[Sat Oct 05 00:00:01.847431 2019] [ssl:warn] [pid 18975] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Sat Oct 05 00:00:01.847626 2019] [mpm_prefork:notice] [pid 18975] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1c configured -- resuming normal operations
[Sat Oct 05 00:00:01.847635 2019] [core:notice] [pid 18975] AH00094: Command line: '/usr/sbin/apache2'

No-one? I need my files back on my computer - that’s the whole point of Nextcloud!

Are you saying you Nextcloud server and client are on the same device?

… no. Server is running Debian 10 without any desktop environment, I’m using a computer running Linux Mint 19.1. Thank you.

I’m disappointed that no-one is bothering to help me with one of the most fundamental aspect of Nextcloud. I just want to sync my files from a remote server back to my local client, the core functionality of Nextcloud - if I can’t do this, what’s the point?

There are a few errors in your server logs. First, D0 is a variable, so you just have to put in a number (https://docs.nextcloud.com/server/17/admin_manual/configuration_files/file_versioning.html). Then you have the errors that NC can’t open files. Were they deleted manually?

Just to be right, the wipe and restore you did on the client not the server? If you restore a server you need to restore the database as well (https://docs.nextcloud.com/server/17/admin_manual/maintenance/restore.html). For the client it would be best to remove the sync from the client, then wipe the disk, reset it and add a sync point again in the client. The problem can be if the client starts tracking the deletion process and propagates this deletion to the server.

Last point: 16.0.1 is not really up to date. If you check the changelog, you see that they fixed a bunch of bugs since then:

Thank you SO much for replying, I really appreciate it!

Re: D0: whoops! That makes sense now, that explained why it wasn’t working properly!

I did wipe and trying to restore only on the client - I haven’t touched the server. The server is encrypted anyway, I can’t delete anything manually. That’s exactly what I did, I removed the sync, wiped the hard drive, gave it a new label (SYNC instead of UNNAMED) and re-created the sync. Syncing from the server to my laptop (not involved in the hard drive wipe) continue to work perfect.

Have updated server to 16.0.5 and client to 2.6.0git and the problem seems to have gone away. I’m not sure what has changed to fix this issue but hey, whatever, it’s working now.

THANK YOU for your help! I really appreciate it!