.ocdata file issues

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:


Or for longer, use three backticks above and below the code snippet:


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, 20.0.5): 25.0.5snap2
Operating system and version (eg, Ubuntu 20.04): Ubuntu Server 22.04.2
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52-1ubuntu4.4
PHP version (eg, 7.4): 8.1.2-1ubuntu2.11

The issue you are facing:

Your data directory is invalid.

Ensure there is a file called ".ocdata" in the root of the data directory.

When opening local site or no site at all when opening live site.

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

Steps to replicate it:

  1. Change location of data directory to external drive
  2. open Local IP or rpiserver.sytes.net

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

I cant find this file. I found it once and changed the data folder location but I can't find it now.

I used an online tutorial and switched the location of my data folder. I dont have a link to it but I changed the required line in the config.php file and gave snap access to my media folder.

sudo -u www-data touch /path/to/nextcloud/data/.ocdata


sudo touch /path/to/nextcloud/data/.ocdata; sudo chown www-data:www-data /path/to/nextcloud/data/.ocdata

Hello, I forgot to add it in my post but I already had an .ocdata file in the data folder.

-rw-r--r-- 1 root root 0 Apr 13 20:47 .ocdata

And I still get the same error

Ah. But it is owned by root and not www-data.

sudo chown www-data:www-data /path/to/nextcloud/data/.ocdata

Done, but I still get the same error?

Restart apache and php