Security & setup warnings: Execution of cron job via CLI not possible

After a fresh installation of NC20 i am not able to get rid of the following Security & Setup warning:

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.

I am not sure what the implication of this error is, as everything seems to work so far.

I am also not sure on how to replicate this error but think that it might have todo with permission of either the data direcotry or the file “.ocdata” itself.

My data directory is mounted via a Synology NFS at startup via /etc/fstab:
192.168.1.29:/volume1/12_Nextclouddata /mnt/12_Nextclouddata nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

/mnt/12_Nextclouddata does have “777”-Permissions
/mnt/12_Nextclouddata/.ocdata does have “777”-Permissions
(i set them to 777 on purpose for testing reasons and will revert them to 755 as soon as i got rid of the error)

I also did open the file with nano and it is empty. But thats how it should be as far as i read in multiple forums.

Additional information on my Nextcloud installtion:
Nextcloud version (eg, 18.0.2): fresh installtion of NC 20.0.0
Operating system and version (eg, Ubuntu 20.04): Unbuntu 20.04 within Proxmox LXC
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.1):7.4.3

I tried to find a similar issue here and on google ofc and found the following thread which is suggesting to get rid of the error by modifiing a nextcloud file but i am not sure if this is the way to go tbh.

Simlar Topic: Write errors for nfs mount

Any help would be appreciated.

I have the same problem after upgrading to 19.0.4.2 .
I tried adding the “offending” directory to the message, to better understand where’s the problem, but couldn’t alter the message in any way.
Scanning for the files works, but clients started having issues: first Android client started reporting that server is in maintenance mode, and now Desktop client (latest appdata) can’t even connect.
I don’t think it’s a permissions issue, since it was working before the upgrade.

Seems in my case there were 3 different issues:
1 - the error message went away by running cron.php via CLI ( sudo -u web3 php7.4 cron.php )
2 - the Android client encountered another (old) problem: solved by keeping Wifi off for a day
3 - I was using the wrong version of the Linux desktop client (the Ubuntu-supplied one, 2.6.5 !)

Hope it helps.

1 Like

Thank you for your answer.

I had the same problem, I think it happened after upgrading to php 7.4. I first checked that www-data group and user owned both database and data directories.

Then I turned on the maintenance mode (sudo -u www-data php /usr/share/nginx/nextcloud/occ maintenance:mode --on for me) just in case and ran sudo -u www-data php7.4 cron.php from /usr/share/nginx/nextcloud/

After disabling the maintenance mode, the error disappeared.

1 Like

To anyone finding this later on, the fix listed here - Allowed memory size of xxx bytes exhausted in current latest-container · Issue #1413 · nextcloud/docker · GitHub - worked for me. As of 21.0.4 I still had the error but this fixed it.