Loosing permisson of "data" folder after trying to add files with Webdav

Hi,

i am new to Nextcloud and the last time i used Linux is 15 years ago. Pls keep in mind, thanks.

I installed Ubuntu 22.04 + LAMP (Apache, PHP 8.1, MySQL from apt) on my old mini PC. I installed Nextcloud 24 with the " Archive file" from the official Nextcloud Website.
Nextcloud is installed in /var/www/nextcloud/
My data folder is on a external drive, connected with usb. It get mounted on startup in /media/hdd1/
My data folder ist: /media/hdd1/nextcloud/data

Everything was fine, until i try to use Webdav. I got a error that i have no permissions.
After that, i was also not able to add new files or folders with the web interface.
I open the terminal and navigated to the data folder. When i try to open it i get the following massage: “-bash: cd: data: Permission denied”
I used the following commands to make it accesable again.
chmod +x data
chown -R www-data:www-data data
Not sure if this was correct, but i was able to open the folder again in terminal and upload files with the web interface.
But when i try to Webdav again i loose my permission and everything repeats.

I used Cyberduck and the default Windows on.

I hope you can help me. Thanks!

Michael

Fehler	jsresourceloader	Could not find resource js/maintenance.js to load	
Fehler	jsresourceloader	Could not find resource js/maintenance.js to load	
Fehler	jsresourceloader	Could not find resource js/maintenance.js to load	
Fehler	jsresourceloader	Could not find resource js/maintenance.js to load	
Fehler	PHP	Error: unlink(/media/hdd1/nextcloud/data/appdata_ocnwtos2r66i/css/user_status/1bf6-4def-user-status-menu.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#305	
Fehler	PHP	Error: unlink(/media/hdd1/nextcloud/data/appdata_ocnwtos2r66i/css/theming/d71e-4def-settings-admin.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#305	
Fatal	webdav	OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction	
Fatal	webdav	OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction	
Fehler	no app in context	Sabre\DAV\Exception\BadRequest: Erwartete Dateigröße von 10485760 bytes, aber 8406501 bytes gelesen (vom Nextcloud-Client) und geschrieben (in den Nextcloud-Speicher). Dies kann entweder ein Netzwerkproblem auf der sendenden Seite oder ein Problem beim Schreiben in den Speicher auf der Serverseite sein.	
Fehler	no app in context	Sabre\DAV\Exception\BadRequest: Erwartete Dateigröße von 5037103 bytes, aber 380 bytes gelesen (vom Nextcloud-Client) und geschrieben (in den Nextcloud-Speicher). Dies kann entweder ein Netzwerkproblem auf der sendenden Seite oder ein Problem beim Schreiben in den Speicher auf der Serverseite sein.	
Fehler	PHP	Error: unlink(/media/hdd1/nextcloud/data/appdata_ocnwtos2r66i/css/core/29a3-40c8-css-variables.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#305	
Fehler	text	OCP\Files\NotFoundException: 	
Fehler	core	OCP\Files\NotPermittedException: Could not create folder	
Fehler	core	OCP\Files\NotPermittedException: Could not create folder	
Fehler	index	OCP\Files\NotPermittedException: Could not create folder	
Fehler	index	OCP\Files\NotPermittedException: Could not create folder

I lost permission again, but havend used Webdav. Looks like there i another problem.