NC18: Says data directory invalid, ".ocdata" there, but .ocdata is there

Nextcloud version (eg, 12.0.2): 18
Operating system and version (eg, Ubuntu 17.04): Centos 7 (with SELinux enabled)
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.1): 7.3.15

The issue you are facing:

In Administration -> Overview, I get the following error message:

  • It was not possible to execute the cron job via CLI. The following technical errors have appeared:

  • Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory.

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

Steps to replicate it:

  1. Upgrade from NC17 to NC18
  2. Go to Administration -> Overview

The output of your Nextcloud log in Admin > Logging:

No relevant logs

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

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.mydomain.com',
  ),
  'datadirectory' => '/var/www/mydomain.com/subdomains/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '18.0.1.3',
  'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'xxxDBHost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxdbuserxxx',
  'dbpassword' => 'xxxdbpasswordxxx',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'mydomain.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxxsmtphostxxx',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'xxxSMTPUsername',
  'mail_smtppassword' => 'xxxSMTPPasswordxxx',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'filelocking.enabled' => false,
  'trashbin_retention_obligation' => 'auto, 30',
  'allowNightlyUpdates' =>
  array (
  ),
);

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

[Sun Feb 23 17:42:31.470556 2020] [access_compat:error] [pid 27439] [client 127.0.0.1:53134] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata
[Sun Feb 23 17:43:39.913537 2020] [access_compat:error] [pid 27439] [client 127.0.0.1:53148] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata
[Sun Feb 23 17:45:47.323892 2020] [access_compat:error] [pid 27711] [client 127.0.0.1:53169] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata
[Sun Feb 23 17:46:54.984799 2020] [access_compat:error] [pid 27784] [client 127.0.0.1:53187] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata
[Sun Feb 23 17:48:16.627898 2020] [access_compat:error] [pid 27972] [client 127.0.0.1:53201] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata
[Sun Feb 23 17:50:28.634890 2020] [access_compat:error] [pid 27901] [client 127.0.0.1:53218] AH01797: client denied by server configuration: /var/www/mydomain.com/subdomains/nextcloud/data/.ocdata

Apache Config:

<VirtualHost *:443>
        ServerName                      nextcloud.mydomain.com
        DocumentRoot                    /var/www/mydomain.com/subdomains/nextcloud/

        #ModPagespeed off

        Redirect 301 /.well-known/carddav https://nextcloud.mydomain.com/remote.php/dav
        Redirect 301 /.well-known/caldav  https://nextcloud.mydomain.com/remote.php/dav
        Redirect 301 /.well-known/webdav  https://nextcloud.mydomain.com/remote.php/dav

        ErrorLog logs/ssl_error_log
        TransferLog logs/ssl_access_log
        LogLevel warn

        ErrorLog logs/ssl_error_log
        TransferLog logs/ssl_access_log
        LogLevel warn
</VirtualHost>

The .htaccess files were left untouched – created by NC18 on install.

hi,
any answer to this yet?