Skip to content

nc-datadir gives errors and throws unhandled exception ... but finally works #2061

@BstAA

Description

@BstAA

System information

NextcloudPi diagnostics

NextcloudPi version  v1.55.4
NextcloudPi image    NextcloudPi_07-12-25
OS                   Debian GNU/Linux 12. 6.1.0-37-amd64 (x86_64)
automount            no
USB devices          none
datadir              /opt/ncdata/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      6,2G/39G
rootfs usage         6,2G/39G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    31.0.7.1
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          up
Postfix service      up
Internet check       ok
Public IPv4          ***REMOVED SENSITIVE VALUE***
Public IPv6          ***REMOVED SENSITIVE VALUE***
Port 80              open
Port 443             open
IP                   ***REMOVED SENSITIVE VALUE***
Gateway              ***REMOVED SENSITIVE VALUE***
Interface            ens33
Certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
Uptime               32min

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "7": "nextcloudpi",
            "5": "nextcloudpi.local",
            "8": "nextcloudpi.lan",
            "3": "nextcloudpi",
            "11": "87.123.153.174",
            "1": "192.168.10.74",
            "14": "nextcloudpi"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/opt\/ncdata\/data\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "maintenance": false,
        "logfile": "\/opt\/ncdata\/data\/nextcloud.log",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2
    }
}

HTTPd logs

[Sat Jul 12 22:11:27.999673 2025] [mpm_event:notice] [pid 22396:tid 22396] AH00492: caught SIGWINCH, shutting down gracefully
[Sun Jul 13 17:58:16.857277 2025] [ssl:warn] [pid 1294:tid 1294] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jul 13 17:58:16.858559 2025] [ssl:error] [pid 1294:tid 1294] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=debian / issuer: CN=debian / serial: 6BE4C57014D5DD6285EB6C9A126F4FA4AFD53F59 / notbefore: Jul 12 20:05:49 2025 GMT / notafter: Jul 10 20:05:49 2035 GMT]
[Sun Jul 13 17:58:16.858564 2025] [ssl:error] [pid 1294:tid 1294] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sun Jul 13 17:58:16.869247 2025] [ssl:warn] [pid 1532:tid 1532] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jul 13 17:58:16.869407 2025] [ssl:error] [pid 1532:tid 1532] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=debian / issuer: CN=debian / serial: 6BE4C57014D5DD6285EB6C9A126F4FA4AFD53F59 / notbefore: Jul 12 20:05:49 2025 GMT / notafter: Jul 10 20:05:49 2035 GMT]
[Sun Jul 13 17:58:16.869411 2025] [ssl:error] [pid 1532:tid 1532] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Sun Jul 13 17:58:16.870463 2025] [mpm_event:notice] [pid 1532:tid 1532] AH00489: Apache/2.4.62 (Debian) OpenSSL/3.0.16 configured -- resuming normal operations
[Sun Jul 13 17:58:16.870473 2025] [core:notice] [pid 1532:tid 1532] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 13 18:05:50.072931 2025] [authz_host:error] [pid 1540:tid 1628] [client 192.168.10.1:57927] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Sun Jul 13 18:05:50.073051 2025] [authz_host:error] [pid 1540:tid 1628] [client 192.168.10.1:57927] AH01753: access check of 'localhost' to /index.php failed, reason: unable to get the remote host name
[Sun Jul 13 18:05:50.516236 2025] [authz_host:error] [pid 1540:tid 1654] [client 192.168.10.1:54933] AH01753: access check of 'localhost' to /activate failed, reason: unable to get the remote host name
[Sun Jul 13 18:05:50.617340 2025] [authz_host:error] [pid 1540:tid 1658] [client 192.168.10.1:39529] AH01753: access check of 'localhost' to /activate/ failed, reason: unable to get the remote host name
[Sun Jul 13 18:05:50.617416 2025] [authz_host:error] [pid 1540:tid 1658] [client 192.168.10.1:39529] AH01753: access check of 'localhost' to /activate/index.php failed, reason: unable to get the remote host name
[Sun Jul 13 18:08:12.834301 2025] [mpm_event:notice] [pid 1532:tid 1532] AH00493: SIGUSR1 received.  Doing graceful restart
[Sun Jul 13 18:08:12.838804 2025] [ssl:warn] [pid 1532:tid 1532] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sun Jul 13 18:08:12.838954 2025] [ssl:error] [pid 1532:tid 1532] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=debian / issuer: CN=debian / serial: 6BE4C57014D5DD6285EB6C9A126F4FA4AFD53F59 / notbefore: Jul 12 20:05:49 2025 GMT / notafter: Jul 10 20:05:49 2035 GMT]
[Sun Jul 13 18:08:12.838957 2025] [ssl:error] [pid 1532:tid 1532] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sun Jul 13 18:08:12.840446 2025] [mpm_event:notice] [pid 1532:tid 1532] AH00489: Apache/2.4.62 (Debian) OpenSSL/3.0.16 configured -- resuming normal operations
[Sun Jul 13 18:08:12.840451 2025] [core:notice] [pid 1532:tid 1532] AH00094: Command line: '/usr/sbin/apache2'

Database logs

tail: '/var/log/mysql/*.log' kann nicht zum Lesen geöffnet werden: Datei oder Verzeichnis nicht gefunden

Nextcloud logs

{"reqId":"bH21nMDzr064SsMYfKlM","level":0,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"dirty table reads: SELECT `appid`, `configkey`, `configvalue`, `type`, `lazy` FROM `*PREFIX*appconfig`","userAgent":"--","version":"31.0.2.1","exception":{"Exception":"Exception","Message":"dirty table reads: SELECT `appid`, `configkey`, `configvalue`, `type`, `lazy` FROM `*PREFIX*appconfig`","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":1233,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":1193,"function":"loadConfig","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":965,"function":"loadConfigAll","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair/AddAppConfigLazyMigration.php","line":39,"function":"updateLazy","class":"OC\\AppConfig","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":104,"function":"run","class":"OC\\Repair\\AddAppConfigLazyMigration","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":265,"function":"run","class":"OC\\Repair","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":100,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":192,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":187,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":33,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":406,"message":"dirty table reads: SELECT `appid`, `configkey`, `configvalue`, `type`, `lazy` FROM `*PREFIX*appconfig`","tables":["oc_preferences","oc_migrations","oc_jobs","oc_appconfig","oc_storages","oc_filecache","oc_notes_meta","oc_oauth2_access_tokens","oc_oauth2_clients"],"reads":["oc_appconfig"],"exception":{},"CustomMessage":"dirty table reads: SELECT `appid`, `configkey`, `configvalue`, `type`, `lazy` FROM `*PREFIX*appconfig`"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"core/BackgroundJobs/AppConfigLazyMigration: 0 config values updated","userAgent":"--","version":"31.0.2.1","data":[]}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Cache logo dimension to fix size in emails on Outlook","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Logo dimensions are already known","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Remove legacy \".ocdata\" file","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Add cleanup-deleted-users background job","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":0,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","userAgent":"--","version":"31.0.2.1","exception":{"Exception":"Exception","Message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":128,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":48,"function":"has","class":"OC\\BackgroundJob\\JobList","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair/AddCleanupDeletedUsersBackgroundJob.php","line":28,"function":"add","class":"OC\\BackgroundJob\\JobList","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":104,"function":"run","class":"OC\\Repair\\AddCleanupDeletedUsersBackgroundJob","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":265,"function":"run","class":"OC\\Repair","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":100,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":192,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":187,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":33,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":406,"message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","tables":["oc_preferences","oc_migrations","oc_jobs","oc_appconfig","oc_storages","oc_filecache","oc_notes_meta","oc_oauth2_access_tokens","oc_oauth2_clients"],"reads":["oc_jobs"],"exception":{},"CustomMessage":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairStepEvent: Repair step: Validate account properties and store phone numbers in a known format for search","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":0,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","userAgent":"--","version":"31.0.2.1","exception":{"Exception":"Exception","Message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":128,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":48,"function":"has","class":"OC\\BackgroundJob\\JobList","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair/NC29/SanitizeAccountProperties.php","line":27,"function":"add","class":"OC\\BackgroundJob\\JobList","type":"->"},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":104,"function":"run","class":"OC\\Repair\\NC29\\SanitizeAccountProperties","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":265,"function":"run","class":"OC\\Repair","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":100,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":192,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":187,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":87,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":33,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/Connection.php","Line":406,"message":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1","tables":["oc_preferences","oc_migrations","oc_jobs","oc_appconfig","oc_storages","oc_filecache","oc_notes_meta","oc_oauth2_access_tokens","oc_oauth2_clients"],"reads":["oc_jobs"],"exception":{},"CustomMessage":"dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"OC\\Repair\\Events\\RepairInfoEvent: Repair info: Queued background to validate account properties.","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":0,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"IntegrityCodeChecker\" is deprecated. Please request \"OC\\IntegrityCheck\\Checker\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"31.0.2.1","data":{"app":"serverDI"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:43+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"--","version":"31.0.2.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update successful","userAgent":"--","version":"31.0.7.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceDisabled: Turned off maintenance mode","userAgent":"--","version":"31.0.7.1","data":{"app":"updater"}}
{"reqId":"bH21nMDzr064SsMYfKlM","level":1,"time":"2025-07-13T16:24:46+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"31.0.7.1","data":{"app":"updater"}}
{"reqId":"1aFOPM6YpTut3lSlzqtP","level":2,"time":"2025-07-13T16:25:26+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/data/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.7.1","data":[]}
{"reqId":"1aFOPM6YpTut3lSlzqtP","level":2,"time":"2025-07-13T16:25:26+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/data/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.7.1","data":[]}
{"reqId":"nqRVoMuqJkfuRCKr3MaW","level":2,"time":"2025-07-13T16:25:26+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/data/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.7.1","data":[]}
{"reqId":"nqRVoMuqJkfuRCKr3MaW","level":2,"time":"2025-07-13T16:25:26+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /media/data/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.7.1","data":[]}

-->

Running nc-datadir gives the following output

Maintenance mode enabled
moving data directory from /opt/ncdata/data to /media/data/ncdata/data...
{"reqId":"ua1aMcYz3FIMnc7wBTTt","level":2,"time":"2025-07-13T16:20:20+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /opt/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
{"reqId":"ua1aMcYz3FIMnc7wBTTt","level":2,"time":"2025-07-13T16:20:20+00:00","remoteAddr":"","user":false,"app":"no app in context","method":"","url":"--","message":"Temporary directory /opt/ncdata/data/tmp is not present or writable","userAgent":"--","version":"31.0.2.1","data":[]}
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
Your data directory is invalid.
Ensure there is a file called ".ncdata" in the root of the data directory. It should have the content: "# Nextcloud data directory"

Cannot create "data" directory.
This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/31/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:143
Stack trace:
#0 /var/www/nextcloud/console.php(81): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(33): require_once('...')
#2 {main}Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
System config value logfile set to string /media/data/ncdata/data/nextcloud.log
Nextcloud is in maintenance mode, no apps are loaded.
Commands provided by apps are unavailable.
System config value tempdirectory set to string /media/data/ncdata/data/tmp
Installing template 'php/opcache.ini.sh'...
Maintenance mode disabled
Installing template 'ncp-metrics.cfg.sh'...
The NC data directory has been moved successfully.
Done. Press any key...

It makes no difference if the new DATADIR location is btrfs or ext4 formatted. Checking to original DATADIR shows that none of the mentioned errors are real:

Initial DATADIR:

root@nextcloudpi:/opt# tree -aup -L 3
[drwxr-xr-x root    ]  .
└── [drwxr-xr-x root    ]  ncdata
    └── [drwxr-x--- www-data]  data
        ├── [drwxr-xr-x www-data]  appdata_ocqcqbiyrpc9
        ├── [-rw-r--r-- www-data]  .htaccess
        ├── [-rw-r--r-- www-data]  index.html
        ├── [-rw-r--r-- www-data]  .ncdata
        ├── [drwxr-xr-x www-data]  ncp
        ├── [-rw-r----- www-data]  nextcloud.log
        ├── [drwxr-xr-x www-data]  .opcache
        └── [drwxr-xr-x www-data]  tmp

7 directories, 4 files

These messages are wrong or misleading

  1. Temporary directory /opt/ncdata/data/tmp is not present or writable
  2. Ensure there is a file called ".ncdata" in the root of the data directory.
  3. Cannot create "data" directory.
  4. `See https://docs.nextcloud.com/server/31/go.php?to=admin-dir_permissions ends in https://docs.nextcloud.com/server/31/admin_manual/

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions