Unable to share path to json file with application/json variable; occ not accessible; permissions problems

Nextcloud version (eg, 20.0.5): 25.0.3
Operating system and version (eg, Ubuntu 20.04): Linux 6.0.0-0.deb11.6-amd64 x86_64 (openmediavault 6.3.1-1)
Apache or nginx version (eg, Apache 2.4.25): nginx/1.18.0
PHP version (eg, 7.4): 8.0.25

The issue you are facing:
Several interconnected issues:

  1. Unable to feed a raw json file into a third party site (interprets it as text/plain instead of application/json);
  2. In an attempt at fixing this, I searched multiple threads on how to do this - I came to the conclusion that it seems like it has to do with the mimetype database (mimetypemapping.dist.json lists ““json”: [“application/json”, “text/plain”],”, and mimetypealiases.dist.json lists ““application/json”: “text/code”,”);
  3. I copied mimetypealiases.dist.json, and edited it into mimetypealiases.json, with the “text/code” string removed; the comments on this file urge me to run ./occ maintenance:mimetype:update.js in order to propagate the changes throughout the system. I did so, and the real problems start there;
  4. First off, bash doesn’t recognise occ whatsoever. So what I did was point it to the correct path, by doing sudo -u www-data /usr/bin/php /home/appdata/nextcloud/config/www/nextcloud/occ, as I’ve seen countless times on these forums, which results in

Cannot write into “config” directory!
This can usually be fixed by giving the web server write access to the config directory.

  1. Okay, sure, so www-data isn’t working here. Surely root would work, right? I have root access through ssh, at which point doing so results in another error, which also has been reported by other users on the forums:

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /home/appdata/nextcloud/config/www/nextcloud/lib/private/DB/Connection.ph

  1. I attempted to use chmod 755 -R /home/appdata/nextcloud/ and chown 755 -R /home/appdata/nextcloud/, it doesn’t work. In fact, it forced me to reinstall Nextcloud from scratch, because it locked me out of the GUI and straight up gave me all sorts of permissions problems even after I fixed that.

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

Steps to replicate it:

  1. Install Nextcloud, Nextclouddb and MariaDB through docker stacks in portainer, add swag stack and configure reverse proxy with duckdns, as per these instructions specific to OpenMediaVault 6 - Nextcloud Bad Gateway - General - openmediavault
  2. The server itself works fine as is, no extra permissions needed, no security vulnerabilities. I was in hopes that the OCC Web app would help in this specific case, but I realised it’s way too outdated, so I didn’t even bother. I was using the Sharing Path app too, as there doesn’t seem to be any other alternative for feeding raw data (e.g., an mp4 file) into a website with the capability of handling a HTML5 video player.

This is yet another fresh install to see if I could access or sync occ again, but I just don’t think I’m capable of fixing this myself.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"GOs6NZeEcd2KKndM07HF","level":3,"time":"2023-02-22T01:30:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"Q7IsRl1NYj4uYutit7MI","level":3,"time":"2023-02-22T01:35:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"6McNHx3KfFbkcNjPKM7d","level":3,"time":"2023-02-22T01:40:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"dEDMLMcTPiUu3SaLgFkO","level":2,"time":"2023-02-22T01:40:22+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"dEDMLMcTPiUu3SaLgFkO","level":2,"time":"2023-02-22T01:40:22+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":2,"time":"2023-02-22T01:41:39+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":2,"time":"2023-02-22T01:41:39+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":3,"time":"2023-02-22T01:42:05+00:00","remoteAddr":"(myip)","user":"admin","app":"PHP","method":"POST","url":"/index.php","message":"exif_read_data(): File not supported at /config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.3.2","exception":{"Exception":"Error","Message":"exif_read_data(): File not supported at /config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php","line":59,"function":"exif_read_data"},{"file":"/config/www/nextcloud/lib/private/Metadata/MetadataManager.php","line":68,"function":"execute","class":"OC\\Metadata\\Provider\\ExifProvider","type":"->"},{"file":"/config/www/nextcloud/lib/private/Metadata/FileEventListener.php","line":101,"function":"generateMetadata","class":"OC\\Metadata\\MetadataManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":87,"function":"handle","class":"OC\\Metadata\\FileEventListener","type":"->"},{"file":"/config/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/config/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":88,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":100,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":118,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"postWrite","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":641,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":692,"function":"emit_file_hooks_post","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/Node/File.php","line":71,"function":"file_put_contents","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Util.php","line":257,"function":"putContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Util.php","line":216,"function":"copyr","class":"OC_Util","type":"::"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":553,"function":"copySkeleton","class":"OC_Util","type":"::"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":403,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":616,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":355,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/Setup.php","line":433,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"S6KnW5KL1Jw4oKy0tzVY","level":3,"time":"2023-02-22T01:42:22+00:00","remoteAddr":"(myip)","user":"admin","app":"index","method":"GET","url":"/apps/theming/favicon?v=21421e36","message":"Could not get appdata folder for theming","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.3.2","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for theming","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":326,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":108,"function":"getRootFolder","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":118,"function":"getImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getFavicon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","Line":108,"CustomMessage":"--"}}

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

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'xxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'xxxxxxxxxxxx:450',
    1 => 'nextcloud.xxxxx.duckdns.org',
  ),
  'overwrite.cli.url' => 'https://nextcloud.xxxxx.duckdns.org',
  'overwritehost' => 'nextcloud.xxxx.duckdns.org',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'https://xxxxxxx:450',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextclouddb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxxx',
  'installed' => true,
  'default_phone_region' => 'PT',
  'trusted_proxies' =>
  array (
    0 => 'xxxxxx:450',
    1 => 'nextcloud.xxxx.duckdns.org',
  ),

##(note: do not miss the comma on the end of this line)
);

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

nginx error.log is empty, access.log is just everything I've accessed on the GUI. So I attached the error.log for php:

[22-Feb-2023 01:25:56] NOTICE: fpm is running, pid 216
[22-Feb-2023 01:25:56] NOTICE: ready to handle connections
[22-Feb-2023 02:00:24] NOTICE: Terminating ...
[22-Feb-2023 02:00:24] NOTICE: exiting, bye-bye!
[22-Feb-2023 02:00:34] NOTICE: fpm is running, pid 192
[22-Feb-2023 02:00:34] NOTICE: ready to handle connections
[22-Feb-2023 02:09:02] NOTICE: Terminating ...
[22-Feb-2023 02:09:02] NOTICE: exiting, bye-bye!
[22-Feb-2023 02:09:10] NOTICE: fpm is running, pid 194
[22-Feb-2023 02:09:10] NOTICE: ready to handle connections
[22-Feb-2023 02:29:08] NOTICE: Terminating ...
[22-Feb-2023 02:29:08] NOTICE: exiting, bye-bye!
[22-Feb-2023 02:29:15] NOTICE: fpm is running, pid 189
[22-Feb-2023 02:29:15] NOTICE: ready to handle connections
[22-Feb-2023 02:31:26] NOTICE: Terminating ...
[22-Feb-2023 02:31:26] NOTICE: exiting, bye-bye!
[22-Feb-2023 02:31:33] NOTICE: fpm is running, pid 188
[22-Feb-2023 02:31:33] NOTICE: ready to handle connections
[22-Feb-2023 03:17:54] NOTICE: Terminating ...
[22-Feb-2023 03:17:54] NOTICE: exiting, bye-bye!
[22-Feb-2023 03:18:01] NOTICE: fpm is running, pid 188
[22-Feb-2023 03:18:01] NOTICE: ready to handle connections
[22-Feb-2023 03:18:24] NOTICE: Terminating ...
[22-Feb-2023 03:18:24] NOTICE: exiting, bye-bye!
[22-Feb-2023 03:18:31] NOTICE: fpm is running, pid 190
[22-Feb-2023 03:18:31] NOTICE: ready to handle connections
[22-Feb-2023 03:30:57] NOTICE: Terminating ...
[22-Feb-2023 03:30:57] NOTICE: exiting, bye-bye!
[22-Feb-2023 03:31:04] NOTICE: fpm is running, pid 189
[22-Feb-2023 03:31:04] NOTICE: ready to handle connections

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.

{"reqId":"GOs6NZeEcd2KKndM07HF","level":3,"time":"2023-02-22T01:30:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"Q7IsRl1NYj4uYutit7MI","level":3,"time":"2023-02-22T01:35:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"6McNHx3KfFbkcNjPKM7d","level":3,"time":"2023-02-22T01:40:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
{"reqId":"dEDMLMcTPiUu3SaLgFkO","level":2,"time":"2023-02-22T01:40:22+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"dEDMLMcTPiUu3SaLgFkO","level":2,"time":"2023-02-22T01:40:22+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":2,"time":"2023-02-22T01:41:39+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":2,"time":"2023-02-22T01:41:39+00:00","remoteAddr":"(myip)","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"t9eO74jgv77broafrU5e","level":3,"time":"2023-02-22T01:42:05+00:00","remoteAddr":"(myip)","user":"admin","app":"PHP","method":"POST","url":"/index.php","message":"exif_read_data(): File not supported at /config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.3.2","exception":{"Exception":"Error","Message":"exif_read_data(): File not supported at /config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/config/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php","line":59,"function":"exif_read_data"},{"file":"/config/www/nextcloud/lib/private/Metadata/MetadataManager.php","line":68,"function":"execute","class":"OC\\Metadata\\Provider\\ExifProvider","type":"->"},{"file":"/config/www/nextcloud/lib/private/Metadata/FileEventListener.php","line":101,"function":"generateMetadata","class":"OC\\Metadata\\MetadataManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":87,"function":"handle","class":"OC\\Metadata\\FileEventListener","type":"->"},{"file":"/config/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/config/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":88,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":100,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":118,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"postWrite","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":641,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":692,"function":"emit_file_hooks_post","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/Node/File.php","line":71,"function":"file_put_contents","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Util.php","line":257,"function":"putContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/config/www/nextcloud/lib/private/legacy/OC_Util.php","line":216,"function":"copyr","class":"OC_Util","type":"::"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":553,"function":"copySkeleton","class":"OC_Util","type":"::"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":403,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":616,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/User/Session.php","line":355,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/Setup.php","line":433,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"S6KnW5KL1Jw4oKy0tzVY","level":3,"time":"2023-02-22T01:42:22+00:00","remoteAddr":"(myip)","user":"admin","app":"index","method":"GET","url":"/apps/theming/favicon?v=21421e36","message":"Could not get appdata folder for theming","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.3.2","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for theming","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":326,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":108,"function":"getRootFolder","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":118,"function":"getImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getFavicon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","Line":108,"CustomMessage":"--"}}

Appreciate any help, and feel free to ask for any more information. I’m a noob at Linux as a whole, so please do bear with me.

Update

Openmediavault is very finnicky with permissions, I found. After reinstalling it from scratch, and digging around further, I was able to fix these issues. The key here is not to mess around with permissions unnecessarily and without the knowledge behind them. It seems not all Linux users are even aware of these subtleties, given I only found one solution that solved my problem instantly, after going through a lot of the same “chown/chmod”-type replies.

If you’re running Openmediavault 6 like me, and you’ve fixed the current Docker/Portainer problem as well (see the OMV forums), all you need to do to achieve this is, in my case, copy mimetypemapping.dist.json from your /nextcloud/resources/config/ directory into the config folder (/nextcloud/www/config), edit it to your taste (I removed “text/plain” from the json extension), remove the “dist” from the file name, and in order to propagate the changes, as well as being able to use occ altogether, all you need to do is ‘bash’ into the container.
Simply go on your SSH session, and paste the command:
docker exec -it nextcloud bash
(“nextcloud” being the name of your container. If you’ve given it a different name, you’ll have to use that.)
Hit enter, and in order to propagate the changes, as noted by the Nextcloud docs, just do:
occ maintenance:mimetype:update-js
No need for the “php” part in this case.

There’s another method of doing the ‘bashing’, which is through Portainer.
Huge thanks to the OMV forums for providing the solution: Using the OCC in Nextcloud - General - openmediavault :relieved:

Update 2

I had written the above update thinking this would be the end of it; I encountered more problems with Nextcloud, namely timeouts with php and nginx, as well as needing to enable CORS for my own needs. After a very long hurdle through multiple tutorials, the Nextcloud documentation itself, which is not enough by the way, I think I managed to get most things to my liking.
I had to fiddle around with multiple configurations, which I’ll be detailing below.

First, I added the following to /config/www/nextcloud/.htaccess:

php_value output_buffering 0
php_value memory_limit 2G
php_value upload_max_filesize 16G
php_value post_max_size 16G
php_value max_input_time 3600
php_value max_execution_time 3600

Then, to /config/www/nextcloud/config/config.php:

‘remember_login_cookie_lifetime’ => ‘1800’,
‘check_for_working_htaccess’ => true,

To /nextcloud/config/nginx/ssl.conf, I added:

add_header “Access-Control-Allow-Origin” *;
add_header “Access-Control-Allow-Methods” “GET, POST, OPTIONS, HEAD”;
add_header “Access-Control-Allow-Headers” “Authorization, Origin, X-Requested-With, Content-Type, Accept”;

Based on this extremely valuable post. Keep in mind enabling CORS in a wide-open configuration like this can be a security hazard. If all you need is to feed raw video (e.g. MP4 files) to a site, or really any single file with the sharingpath application, you DO NOT need this.

In /nextcloud/config/php/php-local.ini, I added:

upload_max_filesize = 16G
post_max_size = 16G
memory_limit = 2G
max_input_time = 3600
max_execution_time = 3600
upload_tmp_dir = /tmptest/

In my case, I created the symlink /tmptest/ to a large capacity drive. The default temp location of Nextcloud is very limited in space, which is another reason for large uploads to timeout.

And finally, in /nextcloud/config/nginx/site-confs/default.conf:

I added

client_max_body_size 0;

in the server { portion of the file, and:

fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_connect_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;

to the location ~ \.php(?:$|/) { portion of the same file.

After making these changes, I encountered yet another problem, which led me to a 502 Gateway Error when trying to access the Nextcloud instance, so I edited /nextcloud/config/nginx/resolver.conf, switching the default IP address to a valid resolver; I used cloudflare’s 1.1.1.1.

I might still need to tinker around with the timeout values, as uploading files larger than 4 GB still gives me the 504 Error assembling chunks messages. However, the file seems to be uploaded perfectly fine.

I really wish all these things didn’t need to be changed like this. Nextcloud could be a really great alternative to Google, Microsoft, et al, but these issues that could be easily solved upstream (I hear ownCloud itself doesn’t even have these issues), and have been reported for years on end, as I’ve seen on Github and on the forums here, keep being ignored.
I really don’t understand what Nextcloud is supposed to be for, maybe for people who only share simple spreadsheets and small documents to each other, but it’s 2023 and people use cloud services for much more than just that, some even if that, and it’s very disappointing to see that newbie users like me have to come up with these workarounds that shouldn’t be needed in the first place. At the very least I can say I learned a lot more about these things, but is this knowledge even valuable? I’m not sure; I just wanted something that worked properly in the end.