NC instance not accesible, after server upgrade by ISP

[details=“Support intro”]

Nextcloud version (eg, 29.0.5):
Operating system and version (eg, Ubuntu 24.04): (hosted, no ssh access, probably ubuntu)
Apache or nginx version (eg, Apache 2.4.25): ?
PHP version (eg, 8.3): 8.3

The issue you are facing:

  1. Desktop and mobile do not sync anymore.
  2. Error message in browser:
    Your data directory is invalid. Ensure there is a file called “.ocdata” in the root of the data directory. Cannot create “data” directory. This can usually be fixed by giving the web server write access to the root directory. See

Is this the first time you’ve seen this error? (Y/N):
Yes. Started out of nowhere a few days ago -without ay changes to the setup on my side. The ISP made some server upgrades before - not sure they could have caused this(?)

Output of Nextcloud desktop client:

No connection to Nextcloud at https://<>. Server replied "503 Service Unavailable" to "GET https://.../status.php"

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

$CONFIG = array (
  'instanceid' => 'ocnc******',
  'passwordsalt' => 'uA***************',
  'secret' => 'nn***************',
  'trusted_domains' => 
  array (
    0 => '********.com',
  'datadirectory' => '/var/www/virtual/<user>/cloud-data/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://********.com',
  'dbname' => '122_nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '122_nextcloud',
  'dbpassword' => '*******',
  'installed' => true,
  'maintenance' => false,
  'updater.secret' => '$2*************',
  '' => 'stable',
  'theme' => '',
  'loglevel' => 0,

The output of your Apache/nginx/system log in /var/log/____:

**access.log** (selected lines, IP replaced by

" - - [10/Jul/2024:00:10:41 +0000] "GET /index.php/204 HTTP/2" 503 225 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.29.1""
" - - [10/Jul/2024:00:25:47 +0000] "PROPFIND /remote.php/dav/files/<user>/ HTTP/1.1" 503 1498 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.29.1""
" - - [10/Jul/2024:05:55:35 +0000] "GET /index.php/204 HTTP/2" 503 225 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.29.1""
" - - [10/Jul/2024:09:25:12 +0000] "GET /status.php HTTP/1.1" 503 1380 "-" "Mozilla/5.0 (Linux) mirall/3.4.2-1ubuntu1 (Nextcloud, ubuntu-6.5.0-1025-oem ClientArchitecture: x86_64 OsArchitecture: x86_64)""

All these lines are repeated, mostly identical, every few minutes.


2024-07-10 02:30:55.394559 [INFO] [4111675] [] Connection idle time too long: 301 while in state: 6 watching for event: 0, close!
2024-07-10 02:30:55.394655 [INFO] [4111675] [] Content len: 107, request line: 'PROPFIND /remote.php/dav/files/marcus/ HTTP/1.1'
2024-07-10 02:30:55.394661 [INFO] [4111675] [] Redirect: #1, URL: /remote.php/dav/files/marcus/
2024-07-10 02:30:55.394668 [INFO] [4111675] [] HttpExtConnector state: 0, request body sent: 0, response body size: -2, response body sent:0, left in buffer: 0, attempts: 0.
2024-07-10 02:30:55.394676 [INFO] [4111675] [] Proxy connection state: 2, watching event: 25, Request header:0, body:0, sent:0, Response header: 0, total: 0 bytes received in 0 seconds,Total processing time: 301.

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.


Unfortunately I don’t know how you can maintain your installation without having console access but you need to check your Nextcloud configuration and verify why Nextcloud cannot find the configured data directory anymore. This directory usually contains a file called “.ocdata”.

1 Like

Thanks. However, it seems everything is ok with the install, which runs for years already - see screenshot. The fact that I have not done anything to the install/config in 2024 makes me wonder how it could just stop working.

The ISP said they updated the servers and my suspicion is that this is the cause. Yet, I have no idea how to show that.

Is there a way to say with certainty when (date) the instance was working properly?


Look at at your nextcloud.log located in your data directory. It should have some hints both about what is going on (if the connection is reaching Nextcloud at least) as well as the timing when things stopped functioning.

`‘version’ => ‘’,

This is a VERY outdated version with security vulnerabilities, among other things. It also doesn’t officially support PHP 8.3, which you’ve listed as being in use in your environment.

P.S. What happens when you go to in your web browser?

This error itself means that a read check against your configured datadirectory path for a file called .ocdata filed. The data directory path you have specified is below:

  'datadirectory' => '/var/www/virtual/<user>/cloud-data/',

Perhaps your provider changed the path of your home directory on the underlying host so this path is also no longer valid?

Cannot create “data” directory. This can usually be fixed by giving the web server write access to the root directory.

This error is similar to the above, except it also can’t write to that data directory. It also suggests to me that the path is invalid since Nextcloud wouldn’t normally try to create a new data directory unless it can’t find it at all.

If you had a shell you could easily verify all of this by typing pwd among other things.

Can you browse upward to your parent directories and verify that the full path above is still valid / has not changed?

P.S. If it’s changed, you’ll need to do some things to accommodate that move of your data directory.