Problem with adding external local storage

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): replace me
Operating system and version: Ubuntu Server 22.04.2
PHP version: 8.1.16
Hi,
After adding new external local storage I cannot upload any file. A message is displayed after each attempt is “Forbidden”.
I gave permissions using commands:
sudo chown -R www-data:www-data /media/hdd_zew
sudo chmod -R 0750 /media/hdd_zew

Whole error log from system I’ve pasted below.

Thanks in advance for your help.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

{"reqId":"0jev9m66tH2TWDKegYEE","level":3,"time":"2023-04-24T19:51:06+00:00","remoteAddr":"80.68.231.252","user":"wijako","app":"PHP","method":"PUT","url":"/remote.php/webdav/HDD/rufus-3.22.exe","message":"file_put_contents(/media/hdd_zew/rufus-3.22.exe.ocTransferId1418734440.part): Failed to open stream: Permission denied at /snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Local.php#312","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0","version":"25.0.5.1","exception":{"Exception":"Error","Message":"file_put_contents(/media/hdd_zew/rufus-3.22.exe.ocTransferId1418734440.part): Failed to open stream: Permission denied at /snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Local.php#312","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Local.php","line":312,"function":"file_put_contents"},{"file":"/snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Local.php","line":621,"function":"file_put_contents","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php","line":647,"function":"writeStream","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/lib/private/Files/Storage/Wrapper/Wrapper.php","line":647,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/apps/dav/lib/Connector/Sabre/File.php","line":248,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/apps/dav/lib/Connector/Sabre/Directory.php","line":151,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/apps/dav/appinfo/v1/webdav.php","line":85,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/remote.php","line":171,"args":["/snap/nextcloud/34372/htdocs/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/snap/nextcloud/34372/htdocs/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"6446e5654b9fd"}

----

{"reqId":"0jev9m66tH2TWDKegYEE","level":3,"time":"2023-04-24T19:51:06+00:00","remoteAddr":"80.68.231.252","user":"wijako","app":"webdav","method":"PUT","url":"/remote.php/webdav/HDD/rufus-3.22.exe","message":"Błąd podczas kopiowania pliku do lokalizacji docelowej (skopiowany: -1 bajt, oczekiwany rozmiar pliku: 1419336 bajtów)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0","version":"25.0.5.1","exception":{"Exception":"Sabre\\DAV\\Exception","Message":"Błąd podczas kopiowania pliku do lokalizacji docelowej (skopiowany: -1 bajt, oczekiwany rozmiar pliku: 1419336 bajtów)","Code":0,"Trace":[{"file":"/snap/nextcloud/34372/htdocs/apps/dav/lib/Connector/Sabre/Directory.php","line":151,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/apps/dav/appinfo/v1/webdav.php","line":85,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/snap/nextcloud/34372/htdocs/remote.php","line":171,"args":["/snap/nextcloud/34372/htdocs/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/snap/nextcloud/34372/htdocs/apps/dav/lib/Connector/Sabre/File.php","Line":279,"message":"Błąd podczas kopiowania pliku do lokalizacji docelowej (skopiowany: -1 bajt, oczekiwany rozmiar pliku: 1419336 bajtów)","exception":[],"CustomMessage":"Błąd podczas kopiowania pliku do lokalizacji docelowej (skopiowany: -1 bajt, oczekiwany rozmiar pliku: 1419336 bajtów)"},"id":"6446e5654b951"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE