My Data Gone, cannot access my nextcloud - Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory

[details=“Support intro”]

Nextcloud version: 18,0,4,2
Operating system and version (eg, Ubuntu 20.04) : Linux
Apache or nginx version: Apache
PHP version: 7.4.30

The issue you are facing:
Access my nextcloud, this message appear “Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory.”
I try to access my nextcloud files using FTP , all my /data folder is empty Please help

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

Steps to replicate it:

  1. Access my nextcloud, this message appear “Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory.”
  2. Try to access my nextcloud android mobile application, this message appear “Server is in maintanance mode”
  3. I Try to access my /data folder using FTP, this folder is empty. All my data not there

The output of your Nextcloud log in Admin > Logging:

Cannot access to my nextcloud

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

<?php
$CONFIG = array (
  'instanceid' => xxxxxx-remove-xxxxxx',
  'passwordsalt' => xxxxxx-remove-xxxxxxx',
  'secret' => 'xxxxxx-remove-xxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'www.abc.com',
  ),
  'datadirectory' => '/home/xxxx/yyyyyyyy/data',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'http://www.abc.com',
  'dbname' => '-remove-',
  'dbhost' => '-remove-',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '-remove-',
  'dbpassword' => '-remove-',
  'installed' => true,
  'maintenance' => false,
);

Hi @Jerry_Peter - Sorry to hear about that.

Do you have backups?

You’re running a very outdated version of NC. It’s completely unsupported and also unpatched from a security perspective. If this server is exposed to the Internet… :slightly_frowning_face:

  1. When was the last time were you were able to successfully access your data?
  2. Check your nextcloud.log file - if there are any clues, they are likely to be there. Though depending on happened it may be missing too unfortunately (it’s normally in your data folder.