All my files disapeared, please help

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: 22.2.3
Operating system and version: Raspbian GNU/Linux Version 11 (bullseye)
Apache or nginx version: I don’t really know how to check this, it must be the one that came with the snap.
PHP version: Same here as with the apache or nginx version.

I have a Nextcloud server installed on a snap in a Raspberry Pi 4. I store everything in an external hard drive. This afternoon, when I tried to access my server from a desktop client, it failed to connect to it. After a while, when it reconnected any of the folders that I had in that external hard drive were there anymore, the server synced with my computer and I lost all files from both my computer and the server. I had a file that wasn’t into a folder that survived, but after I tried checking the hard drive from my computer to see if I could see the files from there, it also disappeared. Now the only thing that appears on the hard drive is a folder (that I didn’t have before) named “System Volume Information” with two files inside it, “IndexerVolumeGuid” and “WPSettings.dat”. Can somebody please help me recover my files? I had everything saved there.

It is the first time I have seen this behavior.

I have no idea on hot to replicate it.

The output of your Nextcloud log in Admin > Logging:
(I have a bunch of errors from the PHP app, all seem top come from the rename() function)
Then around the time the files disappeared (19:51) I got this Fatal error from webdav:

	Sabre\DAV\Exception\ServiceUnavailable: Sistema estĂĄ en modo de mantenimiento.
                                           (This is in spanish, it says that the system is on maintenence mode)

    0. /snap/nextcloud/29247/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

    OCA\DAV\Connector\Sabre\MaintenancePlugin->checkMaintenanceMode()

    1. /snap/nextcloud/29247/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php - line 456:

    Sabre\DAV\Server->emit()

    2. /snap/nextcloud/29247/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php - line 253:

    Sabre\DAV\Server->invokeMethod()

    3. /snap/nextcloud/29247/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php - line 321:

    Sabre\DAV\Server->start()

    4. /snap/nextcloud/29247/htdocs/apps/dav/lib/Server.php - line 333:

    Sabre\DAV\Server->exec()

    5. /snap/nextcloud/29247/htdocs/apps/dav/appinfo/v2/remote.php - line 35:

    OCA\DAV\Server->exec()

    6. /snap/nextcloud/29247/htdocs/remote.php - line 166:

    require_once("/snap/nextc ... p")

There are more errors after this, but I’m pretty sure my files were gone by this point.

The output of your config.php file in /path/to/nextcloud:

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'instanceid' => 'ocvg6q0crd7w',
  'passwordsalt' => 'eJhVBAQ1lQEI/1yfh1dQ+G15oA7PzK',
  'secret' => 'oLUvWNxCo5pjJZVjDnW3CnKcvIucVDcczHiawqiotIK0bsYA',
  'trusted_domains' =>
  array (
    0 => I have the raspberry's IP here
    1 => And the domain to acces it from otuside the network here
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'overwrite.cli.url' => 'http://IP',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'a long password was here',
  'installed' => true,
  'maintenance' => false,
);

Thanks for your atention and help.

is the place where file system information if NTFS-formatted disks go. depending on how the disk was formatted before this might be a sign it has been formatted or maybe partition table became corrupt.

rule of thumb don’t write on the drive e.g. don’t even connect to Windows as it’s know to write on the disks on it’s own, mount the drive in read-only mode with *nix system. definitely you could try to recover the files on your client first…

There are some free utils helping you to recover deleted files (if they are not overwritten so far) try testdisk and photorec - this are both utils I would start with.

In general backup is a must…

I could recover the files from my computer using a recovery tool, thanks for the help.