Setting up cron - "Something has gone wrong"

Hi folks,
I seem to have a cron problem : Nextcloud issues message “Something has gone wrong …”. I have digged the web and found many similar issues but none that I understood (I’m french speaker and non computer scientist). I have “chmoded” cron.php to 744, but still have that issue

sudo /usr/sbin/runuser -u www-data -- /usr/bin/php -f /var/www/html/nextcloud/cron.php
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory.

But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/22/go.php?to=admin-config

I don’t feel comfortable with the idea of setting config to unwriteable since some options would be blocked for gui.
Any clue ?

In case you don’t know Linux permissions already, here’s a quick description. 744 permissions refer to the “owner, group, and everyone else” permissions.
7 = read, write, execute/run
4 = read-only
Thus, 744 means only the file owner can write to it, but group and everyone else can read the file.

Permissions are applied at the receiving file (the one you try to open/edit). Your error message says an issue with config.php permissions. So changing cron.php permissions will not help.

Your first line shows cron.php script runs as -u(user) www-data. You need to make sure www-data user can access config.php and its parent directory. Use ls -l to see. If you are still stuck, please share the ls -l results here for the relevant files & folders.

Good luck, and have fun!

Thank you dms, I know all that. I have “chmoded” it to 766, but it doesn’t help.

drwxrw-rw-  2 nextcloud www-data  4096 13 nov.  10:19 config
-rwxrw-rw- 1 nextcloud www-data  1443 13 nov.  09:31 config.php
eric@vault:~ $ sudo /usr/sbin/runuser -u www-data -- /usr/bin/php -f /var/www/html/nextcloud/cron.php
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory.

But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/22/go.php?to=admin-config```

You might need 77x on the config directory instead of 76x. For directories, the “execute” bit allows browsing. You can also try 777 on both temporarily just to rule out the Linux permissions.

Do you have any special setup below NextCloud? For example, is your config mounted on a network by NFS, or on an external HDD, or VM loopback?

If nextcloud is the owner and www-data is the group, you will have to chmod 770 …

1 Like

It works, thank you ! :stuck_out_tongue_winking_eye: