Not able to upload file to external storage in nextcloud

I am using the docker image of Nextcloud AIO and am not able to upload files to my external storage.

here is my docker compose file:

version: "3.8"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work

services:
  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work
      - /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'!
    ports:
      - 8080:8080
    environment:
      - APACHE_PORT=11000  # change this port number if 11000 is already in use on your host system.
      - APACHE_DISABLE_REWRITE_IP=1
      - NEXTCLOUD_DATADIR=/mnt/wd4tb/ncdata/nextcloud
      - NEXTCLOUD_MOUNT=/mnt/wd4tb/ncstorage
      - NEXTCLOUD_TRUSTED_DOMAINS=192.168.0.102 # Your domain name + proxy host IP- TRUSTED_PROXIES=192.168.0.102 # proxy host IP
      - TRUSTED_PROXIES=192.168.0.102
      - SKIP_DOMAIN_VALIDATION=true
      - NEXTCLOUD_UPLOAD_LIMIT=10G

Hi, do you have something useful in the nextcloud logfile? Also what kind of external storage is this? Local or something else?

it is a local storage, I am running raspberry pi and have attached 4TB HDD with it and have mounted it to /mnt/wd4tb

What is the Filesystem of the hdd?

filesystem is ext4.

do you need logs from nextcloud.log in order to help me in this issue?

Can you post the corresponding Nextcloud logs?

nextcloud.log file inside my /mnt/wd4tb/ncdata/nextcloud

{"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:20+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add preview cleanup background jobs","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                    {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:20+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Migrate oauth2_clients table to nextcloud schema","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                       {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:22+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Update the oauth2_access_tokens table schema.","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                          {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:24+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Update the oauth2_clients table schema.","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                            {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Fix potential broken mount points","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                      {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: No mounts updated","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                      {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Repair language codes","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                  {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:28+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add log rotate job","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                     {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Clear frontend caches","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                  {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Image cache cleared","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                    {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: JS cache cleared","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                       {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Clear every generated avatar","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                           {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Avatar cache clearing job added","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                        {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add preview background cleanup job","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                     {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Queue a one-time job to cleanup old backups of the updater","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                             {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Cleanup invalid photocache files for carddav","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                           {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add background job to cleanup login flow v2 tokens","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                     {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Remove potentially over exposing share links","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                           {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: No need to remove link shares.","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                         {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Clear access cache of projects","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                         {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Reset generated avatar flag","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                            {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Keep legacy encryption enabled","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                         {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Check encryption key format","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                            {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Remove old dashboard app config data","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                   {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add job to cleanup the bruteforce entries","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                              {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Queue a one-time job to check for user uploaded certificates","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                           {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Repair DAV shares","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                      {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add background job to set the lookup server share state for users","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                      {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add token cleanup job","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                  {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Clean up abandoned apps","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add possibly missing system config","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                     {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:29+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                 {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:38+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"--","version":"26.0.5.1","data":{"app":"updater"}}                                                                                                                 {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:39+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update successful","userAgent":"--","version":"27.0.2.1","data":{"app":"updater"}}       {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:39+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"27.0.2.1","data":{"app":"updater"}}                                                                                                                        {"reqId":"9mH5RCmTre806shxMiVy","level":1,"time":"2023-08-13T10:45:39+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"27.0.2.1","data":{"app":"updater"}}  

And nextcloud.log file inside /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/nextcloud.log

{"reqId":"IXGaUJzpxD3yJv05q3LZ","level":4,"time":"2023-08-13T10:52:30+00:00","remoteAddr":"","user":"--","app":"spreed","method":"","url":"--","message":"Error during app service registration: There can only be one Talk backend","userAgent":"--","version":"27.0.2.1","exception":{"Exception":"RuntimeException","Message":"There can only be one Talk backend","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php","line":325,"function":"registerTalkBackend","class":"OC\\AppFramework\\Bootstrap\\RegistrationContext","type":"->","args":["spreed","OCA\\Talk\\OCP\\TalkBackend"]},{"file":"/var/www/html/custom_apps/spreed/lib/AppInfo/Application.php","line":161,"function":"registerTalkBackend","class":"OCP\\AppFramework\\Bootstrap\\IRegistrationContext@anonymous\u0000/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php:156$4e","type":"->","args":["OCA\\Talk\\OCP\\TalkBackend"]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":142,"function":"register","class":"OCA\\Talk\\AppInfo\\Application","type":"->","args":[["OCP\\AppFramework\\Bootstrap\\IRegistrationContext@anonymous\u0000/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php:156$4e"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":94,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":[["spreed"]]},{"file":"/var/www/html/lib/private/Installer.php","line":143,"function":"runLazyRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["spreed"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":278,"function":"installApp","class":"OC\\Installer","type":"->","args":["spreed"]},{"file":"/var/www/html/core/Command/App/Install.php","line":97,"function":"enable","class":"OC_App","type":"->","args":["spreed"]},{"file":"/var/www/html/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OC\\Core\\Command\\App\\Install","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["OC\\Core\\Command\\App\\Install"],["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/html/occ","line":11,"args":["/var/www/html/console.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/AppFramework/Bootstrap/RegistrationContext.php","Line":476,"message":"Error during app service registration: There can only be one Talk backend","exception":{},"CustomMessage":"Error during app service registration: There can only be one Talk backend"}}                                                                                       {"reqId":"8Lio2LPejo9gKJI5AXAe","level":3,"time":"2023-08-13T10:52:49+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)","userAgent":"--","version":"27.0.2.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/appdata_ocqbshtnykdx/theming/global","Code":0,"Trace":[{"function":"get","class":"OC\\Files\\Node\\Root","type":"->","args":["/appdata_ocqbshtnykdx/theming/global"]},{"file":"/var/www/html/lib/private/Files/Node/LazyFolder.php","line":74,"function":"call_user_func_array","args":[[["OC\\Files\\Node\\Root"],"get"],["appdata_ocqbshtnykdx/theming/global"]]},{"file":"/var/www/html/lib/private/Files/Node/LazyFolder.php","line":151,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["get",["appdata_ocqbshtnykdx/theming/global"]]},{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":132,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["appdata_ocqbshtnykdx/theming/global"]},{"file":"/var/www/html/apps/theming/lib/Jobs/MigrateBackgroundImages.php","line":168,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["global"]},{"file":"/var/www/html/apps/theming/lib/Jobs/MigrateBackgroundImages.php","line":100,"function":"storeUserIdsToProcess","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->","args":[[]]},{"file":"/var/www/html/apps/theming/lib/Jobs/MigrateBackgroundImages.php","line":79,"function":"runPreparation","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->","args":[["prepare"]]},{"file":"/var/www/html/lib/public/BackgroundJob/QueuedJob.php","line":57,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[["OC\\BackgroundJob\\JobList"]]},{"file":"/var/www/html/lib/public/BackgroundJob/QueuedJob.php","line":47,"function":"start","class":"OCP\\BackgroundJob\\QueuedJob","type":"->","args":[["OC\\BackgroundJob\\JobList"]]},{"file":"/var/www/html/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->","args":[["OC\\BackgroundJob\\JobList"],["OC\\Log"]]}],"File":"/var/www/html/lib/private/Files/Node/Root.php","Line":206,"message":"Error while running background job (class: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)","exception":{},"CustomMessage":"Error while running background job (class: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)"}}                                  {"reqId":"8twKwgxdfMVHmrUVNeMf","level":3,"time":"2023-08-13T11:03:06+00:00","remoteAddr":"103.58.97.178","user":"admin","app":"text","method":"PUT","url":"/apps/text/session/create","message":"Could not get appdata folder for text","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36","version":"27.0.2.1","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for text","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/var/www/html/apps/text/lib/Service/DocumentService.php","line":581,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["documents"]},{"file":"/var/www/html/apps/text/lib/Service/DocumentService.php","line":147,"function":"ensureDocumentsFolder","class":"OCA\\Text\\Service\\DocumentService","type":"->","args":[]},{"file":"/var/www/html/apps/text/lib/Service/ApiService.php","line":120,"function":"createDocument","class":"OCA\\Text\\Service\\DocumentService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/text/lib/Controller/SessionController.php","line":61,"function":"create","class":"OCA\\Text\\Service\\ApiService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Text\\Controller\\SessionController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Text\\Controller\\SessionController"],"create"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Text\\Controller\\SessionController"],"create"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Text\\Controller\\SessionController","create",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["text.Session.create"]]},{"file":"/var/www/html/lib/base.php","line":1071,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/text/session/create"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/AppData/AppData.php","Line":108,"message":"Could not get appdata folder for text","exception":{},"CustomMessage":"Could not get appdata folder for text"}}                                           {"reqId":"fM2EgAg39x4tq9cKqMCL","level":3,"time":"2023-08-13T11:04:25+00:00","remoteAddr":"2409:4041:8e94:5a59:6d90:efdd:a288:80f9","user":"admin","app":"index","method":"GET","url":"/apps/files/api/v1/stats?dir=%2FWD4TB","message":"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36","version":"27.0.2.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/html/apps/files/lib/Controller/ApiController.php","line":267,"function":"getStorageInfo","class":"OC_Helper","type":"::","args":["/WD4TB"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getStorageStats","class":"OCA\\Files\\Controller\\ApiController","type":"->","args":["/WD4TB"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\ApiController"],"getStorageStats"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\ApiController"],"getStorageStats"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["APIController","getStorageStats",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["files.API.getStorageStats"]]},{"file":"/var/www/html/lib/base.php","line":1071,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/files/api/v1/stats"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/legacy/OC_Helper.php","Line":490,"CustomMessage":"--"}}                      {"reqId":"cV9Qjmcq3L81zw3aKrMy","level":3,"time":"2023-08-13T11:11:15+00:00","remoteAddr":"2409:4041:8e94:5a59:6d90:efdd:a288:80f9","user":"admin","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":"Could not create path \"/admin/files/WD4TB/test.md\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36","version":"27.0.2.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create path \"/admin/files/WD4TB/test.md\"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Template/TemplateManager.php","line":162,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->","args":["test.md"]},{"file":"/var/www/html/apps/files/lib/Controller/TemplateController.php","line":57,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\TemplateController"],"create"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\TemplateController"],"create"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files\\Controller\\TemplateController","create",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["ocs.files.Template.create"]]},{"file":"/var/www/html/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/files/api/v1/templates/create"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":193,"message":"Could not create path \"/admin/files/WD4TB/test.md\"","exception":{},"CustomMessage":"Could not create path \"/admin/files/WD4TB/test.md\""}}            {"reqId":"I4X5eRan1HOwSVqefcNV","level":3,"time":"2023-08-14T11:24:08+00:00","remoteAddr":"","user":"--","app":"richdocuments","method":"","url":"--","message":"Failed to fetch the Collabora capabilities endpoint: Server error: `GET https://home-nc.vbix.in/hosting/capabilities` resulted in a `502 Bad Gateway` response:\n502 Bad Gateway\nUnable to reach the origin service. The service may be down or it may not be responding to traffic from  (truncated...)\n","userAgent":"--","version":"27.0.2.1","exception":{"Exception":"GuzzleHttp\\Exception\\ServerException","Message":"Server error: `GET https://home-nc.vbix.in/hosting/capabilities` resulted in a `502 Bad Gateway` response:\n502 Bad Gateway\nUnable to reach the origin service. The service may be down or it may not be responding to traffic from  (truncated...)\n","Code":502,"Trace":[{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":69,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":204,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":153,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":[1,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->","args":[true]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":226,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://home-nc.vbix.in/hosting/capabilities",["/mnt/ncdata/files_external/rootcerts.crt",45,[true],["Nextcloud Server Crawler","gzip"],true]]},{"file":"/var/www/html/custom_apps/richdocuments/lib/Service/CapabilitiesService.php","line":135,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://home-nc.vbix.in/hosting/capabilities",[45,[true]]]},{"file":"/var/www/html/custom_apps/richdocuments/lib/Backgroundjobs/ObtainCapabilities.php","line":40,"function":"refetch","class":"OCA\\Richdocuments\\Service\\CapabilitiesService","type":"->","args":[]},{"file":"/var/www/html/lib/private/BackgroundJob/Job.php","line":54,"function":"run","class":"OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/BackgroundJob/TimedJob.php","line":60,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->","args":[["OC\\BackgroundJob\\JobList"],["OC\\Log"]]},{"file":"/var/www/html/cron.php","line":152,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->","args":[["OC\\BackgroundJob\\JobList"],["OC\\Log"]]}],"File":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"message":"Failed to fetch the Collabora capabilities endpoint: Server error: `GET https://home-nc.vbix.in/hosting/capabilities` resulted in a `502 Bad Gateway` response:\n502 Bad Gateway\nUnable to reach the origin service. The service may be down or it may not be responding to traffic from  (truncated...)\n","exception":{},"CustomMessage":"Failed to fetch the Collabora capabilities endpoint: Server error: `GET https://home-nc.vbix.in/hosting/capabilities` resulted in a `502 Bad Gateway` response:\n502 Bad Gateway\nUnable to reach the origin service. The service may be down or it may not be responding to traffic from  (truncated...)\n"}} 
{
  "reqId": "cV9Qjmcq3L81zw3aKrMy",
  "level": 3,
  "time": "2023-08-13T11:11:15+00:00",
  "remoteAddr": "2409:4041:8e94:5a59:6d90:efdd:a288:80f9",
  "user": "admin",
  "app": "no app in context",
  "method": "POST",
  "url": "/ocs/v2.php/apps/files/api/v1/templates/create",
  "message": "Could not create path \"/admin/files/WD4TB/test.md\"",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
  "version": "27.0.2.1",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "Could not create path \"/admin/files/WD4TB/test.md\"",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/lib/private/Files/Template/TemplateManager.php",
        "line": 162,
        "function": "newFile",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->",
        "args": [
          "test.md"
        ]
      },
      {
        "file": "/var/www/html/apps/files/lib/Controller/TemplateController.php",
        "line": 57,
        "function": "createFromTemplate",
        "class": "OC\\Files\\Template\\TemplateManager",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "create",
        "class": "OCA\\Files\\Controller\\TemplateController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Files\\Controller\\TemplateController"
          ],
          "create"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 183,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Files\\Controller\\TemplateController"
          ],
          "create"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Files\\Controller\\TemplateController",
          "create",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "ocs.files.Template.create"
          ]
        ]
      },
      {
        "file": "/var/www/html/ocs/v1.php",
        "line": 64,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/apps/files/api/v1/templates/create"
        ]
      },
      {
        "file": "/var/www/html/ocs/v2.php",
        "line": 23,
        "args": [
          "/var/www/html/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/Files/Node/Folder.php",
    "Line": 193,
    "message": "Could not create path \"/admin/files/WD4TB/test.md\"",
    "exception": {},
    "CustomMessage": "Could not create path \"/admin/files/WD4TB/test.md\""
  }
}

This seems to be your issue

okay is it something related to Linux permissions, how do I solve this issue?

I currently have the feeling that it is rather something else. Can you run

sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:repair
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data

And check if it helps?

Ok I’ll run these and get back to you in a min

BTW, did you already see this?

From GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All-in-One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

yeah I saw this and executed these commands to provide permissions while I was setting up nextcloud

And I tried these commands:

docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:repair
sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ files:scan-app-data

and tried uploading a file and it says the same:
image

Hm, then the permissions might actually be incorrect. Can you run sudo ls -la on the location where the external storage is located? Also can you run sudo -ls -la /mnt additionally and post both outputs here?

output for ls -la

output for -ls -la /mnt

This is how i have mounted the drive

So indeed you have the wrong permissions.

Please run

sudo chown -R 33:0 /mnt/wd4tb/ && sudo chmod -R 750 /mnt/wd4tb/ && sudo ls -la /mnt/wd4tb/

and post the outout here!

Output: