Hi all,
i’m new to nextcloud and i’m not able to resolve this problem.
I installed nextcloud on a new vm running ubuntu server using the standard installation script.
After that i moved the data folder using the solution1 as explained in this topic: HowTo: Change / Move data directory after installation
Now i’m able to access the files in the new directory but i can’t delete or add new files.
the new data path is in /mnt/nextcloud and it is a samba share auto mounted at the server startp with cifs utils.
Also the command sudo -u www-data php -f /var/www/html/nextcloud/console.php files:scan --all
report:
Permissions can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/24/go.php?to=admin-dir_permissions.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:164
Errors in the nc log:
|Errore|PHP|Error: fopen(/mnt/nextcloud/data_dir_writability_test_627c1d214e4f6.tmp): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/legacy/OC_Util.php#580||2022-05-11T22:31:29+0200|
|Errore|PHP|Error: fopen(/mnt/nextcloud/data_dir_writability_test_627c1cc9aa4dc.tmp): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/legacy/OC_Util.php#580||2022-05-11T22:30:01+0200|
|Avviso|appstoreFetcher|OCP\Files\GenericFileException: file_put_contents failed||2022-05-11T22:29:22+0200|
|Errore|PHP|Error: file_put_contents(/mnt/nextcloud/appdata_ocijspse9cqd/appstore/apps.json): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#296||2022-05-11T22:29:22+0200|
|Avviso|appstoreFetcher|OCP\Files\GenericFileException: file_put_contents failed||2022-05-11T22:29:21+0200|
|Errore|PHP|Error: file_put_contents(/mnt/nextcloud/appdata_ocijspse9cqd/appstore/apps.json): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#296||2022-05-11T22:29:21+0200|
|Avviso|appstoreFetcher|OCP\Files\GenericFileException: file_put_contents failed||2022-05-11T22:29:21+0200|
|Errore|PHP|Error: file_put_contents(/mnt/nextcloud/appdata_ocijspse9cqd/appstore/apps.json): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#296||2022-05-11T22:29:21+0200|
|Avviso|appstoreFetcher|OCP\Files\GenericFileException: file_put_contents failed||2022-05-11T22:29:20+0200|
|Errore|PHP|Error: file_put_contents(/mnt/nextcloud/appdata_ocijspse9cqd/appstore/apps.json): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#296||2022-05-11T22:29:20+0200|
|Errore|PHP|Error: file_put_contents(/mnt/nextcloud/appdata_ocijspse9cqd/css/icons/icons-vars.css): Failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#296||2022-05-11T22:27:29+0200|
This topic has come up a zillion times here in the forum and was even answered in this thread.
The Nextcloud folder and data folder should be owned by the web server user. On Debian/Ubuntu based distributions this is usually the user www-data. Further it is recommended to set the permissions for folders to 750 and for files to 640.
Thanks for information
I have the same problem - but on a Proxmox-container.
Is the soluten the same for Proxmox?
I think, it’s different to use the accounts - in Proxmox uid ?
I don’t think so, because Nextcloud and the web server ar not aware they are running in a container, so the Nextcloud folders and files, including the data folder and its contents, need to be owned by www-data, regardless from where and how the storage is mounted.