Happy Sunday everyone,
on my server with Ubuntu 20.04.2 LTS, mariadb, apache and php 7.4, i installed NC 21.0.1.
Everything works perfectly, indeed perhaps it is faster than before, but this message appears in “Settings”“Summary”:
՚՚՚
There are errors related to your configuration.
The cron job could not be run via the CLI. The following technical errors appeared :
Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory.
Your data directory is not writable Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/21/go.php?to=admin-dir_permissions.
Thanks a lot for the answer!
I log in with the only user who is also an administrator.
Um how can I check that the web server user has write permissions? To the folders where I moved the data folder, I gave this command from the terminal:
sudo chown -R www-data: www-data /home/user/nextcloud/user/data/
sudo chmod -R 755 /home/user/nextcloud/user/data/
I was wrong?
Use “ps -ef| grep apache” to check under which user the web server is running.
The given commands are looking fine, except that it isn’t sufficient to grant access only for the users data directory. You have to make sure that the user is allowed to navigate to the whole path to the directory. The easiest way to do this is to switch to the web server user and navigate through the whole path, one directory after the other.
Are you really putting nextcloud’s data directory into some user’s home directory? That is usually going to be blocked by default configuration, both by standard permissions set on the user’s directory, AND by selinux, since the web server is not going to be permitted to access files in a user home context.
Also note that for a user to have permission to access a file, that user has to have read access not just to that specific file, but to EVERY directory in the heirarchy. /home/{user} is typically going to be chown {user}:{user} and chmod 700. And the selinux context will be something equivalent to unconfined_u:object_r:user_home_dir_t:s0 (that’s on Fedora, not ubuntu, so it could look a little different on yours.
Bottom line, try putting the data path back into a normal location for web data on your OS and set permissions accordingly.
Depending on the given path /home/user/nextcloud/user/data/, you’ve placed the Nextcloud data directory in a users home directory, which is usually not the right place to store that data. because the access rights of “/home/user” are usually limited to the user himself and “www-data” isn’t allowed to access that directory.
Better is to store it in a directory like “/var/nextcloud/data” or “/data/nextcloud/data” and make sure that the www-data is allowed to accedd it or better is the owner of at least “/var/nextcloud/…”.
So I did as you advised me: I moved the data from / home / user, and in fact the situation has significantly improved:
՚՚՚
There are errors related to your configuration.
The cron job could not be run via the CLI. The following technical errors appeared:
The data folder is invalid Make sure there is an ".ocdata" file in the root of the data folder.
՚՚՚
The strange thing is that .ocdata is present in the folder … it has the size of 0 bite, but it is present …
However, the Nextcloud security scan gives me as a result “A” and that of SSL Server Test “A +”.
If a file couldn’t be found although it exists, it might be due to missing access rights. Check the ownership and access rights of the whole directory tree to the file and from the file itself to make sure it is accessible by the occ command.