upgrade went sideways, now can't run occ command at all

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

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

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.9
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.4
  • Web server and version (e.g, Apache 2.4.25):
    • 2/4/58
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • 8.2.21+
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • after upgrade attempt
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • bare metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

Whenever I use the web upgrader, it fails to replace the files. I generally have to manually copy them from the updater folder in a console. This time, I copied what I thought were the downloaded files into place, but then it all went sideways after that.

I can generally replace /var/www/nextcloud with a backup, and i have done that to multiple versions. However, it won’t start up. On once instance, it started up with the newest version, 31.0.14, however all the data was empty and it asked me to create an administrator password/account. Since that isn’t right, I deleted that version of nextcloud and restored another backup. However, now the occ command doesn’t even execute, see below.

Steps to replicate it (hint: details matter!):

  1. sudo -u www-data mv /home/nextcloud/data/updater-oc2i3f4h733g/downloads/ /var/www/nextcloud/

  2. sudo -u www-data php /var/www/nextcloud/downloads/nextcloud/occ upgrade -v

  3. sudo -u www-data php /var/www/nextcloud/updater/updater.phar

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"afNAReo3TC-_VXdaWgR5cQAAABg","level":3,"time":"2026-04-30T11:43:01+00:00","remoteAddr":"172.212.217.10","user":"--","app":"no app in context","method":"GET","url":"/.env.test.php","message":"Could not decrypt or decode encrypted session data","userAgent":"--","version":"31.0.9.1","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Security/Crypto.php","line":98,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":70,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":47,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoWrapper.php","line":94,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":418,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":690,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1194,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":22,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":162,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}}
{"reqId":"afQLxISXlJfjuGYOuNSRMwAAAAE","level":3,"time":"2026-05-01T02:11:16+00:00","remoteAddr":"172.212.217.10","user":"--","app":"no app in context","method":"GET","url":"/.env.test.php","message":"Could not decrypt or decode encrypted session data","userAgent":"--","version":"31.0.9.1","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Security/Crypto.php","line":98,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":70,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":47,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoWrapper.php","line":94,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":418,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":690,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1194,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":22,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":162,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}}
{"reqId":"afXkDUL0DnENZygIFZ3HEgAAAAw","level":3,"time":"2026-05-02T11:46:21+00:00","remoteAddr":"52.169.206.229","user":"--","app":"no app in context","method":"GET","url":"/.well-known/about.php","message":"Could not decrypt or decode encrypted session data","userAgent":"--","version":"31.0.9.1","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Security/Crypto.php","line":98,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":70,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":47,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoWrapper.php","line":94,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":418,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":690,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1194,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":22,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":162,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}}
{"reqId":"afZgZDSaqozpSW_YXea0MgAAAAs","level":3,"time":"2026-05-02T20:36:52+00:00","remoteAddr":"20.151.130.38","user":"--","app":"no app in context","method":"GET","url":"/.well-known/about.php","message":"Could not decrypt or decode encrypted session data","userAgent":"--","version":"31.0.9.1","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Security/Crypto.php","line":98,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":70,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":47,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoWrapper.php","line":94,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":418,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":690,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1194,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":22,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":162,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}}
{"reqId":"afZ41_LpD-vBIjkfuNmeOAAAAAU","level":3,"time":"2026-05-02T22:21:11+00:00","remoteAddr":"172.202.47.245","user":"--","app":"no app in context","method":"GET","url":"/.well-known/about.php","message":"Could not decrypt or decode encrypted session data","userAgent":"--","version":"31.0.9.1","exception":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Security/Crypto.php","line":98,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":70,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Session/CryptoSessionData.php","line":47,"function":"initializeSession","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Session/CryptoWrappe
r.php","line":94,"function":"__construct","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":418,"function":"wrapSession","class":"OC\\Session\\CryptoWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":690,"function":"initSession","class":"OC","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1194,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":22,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":162,"message":"Could not decrypt or decode encrypted session data","exception":{},"CustomMessage":"Could not decrypt or decode encrypted session data"}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Web server / Reverse Proxy

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

N/A

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

root@Server:/var/www/nextcloud# sudo -u www-data php occ status
An unhandled exception has been thrown:
PDOException: SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig in /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php:59
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(59): PDO->prepare()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1100): Doctrine\DBAL\Driver\PDO\Connection->prepare()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(419): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(289): OC\DB\ConnectionAdapter->executeQuery()
#5 /var/www/nextcloud/lib/private/AppConfig.php(1264): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#6 /var/www/nextcloud/lib/private/AppConfig.php(270): OC\AppConfig->loadConfig()
#7 /var/www/nextcloud/lib/private/legacy/OC_App.php(653): OC\AppConfig->searchValues()
#8 /var/www/nextcloud/lib/private/Server.php(612): OC_App::getAppVersions()
#9 /var/www/nextcloud/lib/private/Memcache/Factory.php(112): OC\Server->OC\{closure}()
#10 /var/www/nextcloud/lib/private/Memcache/Factory.php(124): OC\Memcache\Factory->getGlobalPrefix()
#11 /var/www/nextcloud/lib/private/Server.php(968): OC\Memcache\Factory->createLocking()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#13 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#15 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#17 /var/www/nextcloud/lib/private/Files/View.php(75): OC\AppFramework\Utility\SimpleContainer->get()
#18 /var/www/nextcloud/lib/private/Server.php(422): OC\Files\View->__construct()
#19 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#20 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#21 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#22 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#23 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#24 /var/www/nextcloud/lib/private/Server.php(1303): OC\AppFramework\Utility\SimpleContainer->get()
#25 /var/www/nextcloud/lib/base.php(637): OC\Server->boot()
#26 /var/www/nextcloud/lib/base.php(1194): OC::init()
#27 /var/www/nextcloud/console.php(28): require_once('...')
#28 /var/www/nextcloud/occ(33): require_once('...')
#29 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig in /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php:24
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php(64): Doctrine\DBAL\Driver\PDO\Exception::new()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1100): Doctrine\DBAL\Driver\PDO\Connection->prepare()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(419): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(289): OC\DB\ConnectionAdapter->executeQuery()
#5 /var/www/nextcloud/lib/private/AppConfig.php(1264): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#6 /var/www/nextcloud/lib/private/AppConfig.php(270): OC\AppConfig->loadConfig()
#7 /var/www/nextcloud/lib/private/legacy/OC_App.php(653): OC\AppConfig->searchValues()
#8 /var/www/nextcloud/lib/private/Server.php(612): OC_App::getAppVersions()
#9 /var/www/nextcloud/lib/private/Memcache/Factory.php(112): OC\Server->OC\{closure}()
#10 /var/www/nextcloud/lib/private/Memcache/Factory.php(124): OC\Memcache\Factory->getGlobalPrefix()
#11 /var/www/nextcloud/lib/private/Server.php(968): OC\Memcache\Factory->createLocking()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#13 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#15 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#17 /var/www/nextcloud/lib/private/Files/View.php(75): OC\AppFramework\Utility\SimpleContainer->get()
#18 /var/www/nextcloud/lib/private/Server.php(422): OC\Files\View->__construct()
#19 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#20 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#21 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#22 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#23 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#24 /var/www/nextcloud/lib/private/Server.php(1303): OC\AppFramework\Utility\SimpleContainer->get()
#25 /var/www/nextcloud/lib/base.php(637): OC\Server->boot()
#26 /var/www/nextcloud/lib/base.php(1194): OC::init()
#27 /var/www/nextcloud/console.php(28): require_once('...')
#28 /var/www/nextcloud/occ(33): require_once('...')
#29 {main}

Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig in /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php:52
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1976): Doctrine\DBAL\Driver\API\SQLite\ExceptionConverter->convert()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1918): Doctrine\DBAL\Connection->handleDriverException()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1111): Doctrine\DBAL\Connection->convertExceptionDuringQuery()
#3 /var/www/nextcloud/lib/private/DB/Connection.php(419): Doctrine\DBAL\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\DB\Connection->executeQuery()
#5 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(289): OC\DB\ConnectionAdapter->executeQuery()
#6 /var/www/nextcloud/lib/private/AppConfig.php(1264): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#7 /var/www/nextcloud/lib/private/AppConfig.php(270): OC\AppConfig->loadConfig()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(653): OC\AppConfig->searchValues()
#9 /var/www/nextcloud/lib/private/Server.php(612): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/Memcache/Factory.php(112): OC\Server->OC\{closure}()
#11 /var/www/nextcloud/lib/private/Memcache/Factory.php(124): OC\Memcache\Factory->getGlobalPrefix()
#12 /var/www/nextcloud/lib/private/Server.php(968): OC\Memcache\Factory->createLocking()
#13 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#14 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#16 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#17 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#18 /var/www/nextcloud/lib/private/Files/View.php(75): OC\AppFramework\Utility\SimpleContainer->get()
#19 /var/www/nextcloud/lib/private/Server.php(422): OC\Files\View->__construct()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#21 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#23 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#25 /var/www/nextcloud/lib/private/Server.php(1303): OC\AppFramework\Utility\SimpleContainer->get()
#26 /var/www/nextcloud/lib/base.php(637): OC\Server->boot()
#27 /var/www/nextcloud/lib/base.php(1194): OC::init()
#28 /var/www/nextcloud/console.php(28): require_once('...')
#29 /var/www/nextcloud/occ(33): require_once('...')
#30 {main}

Next OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 no such table: oc_appconfig in /var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php:56
Stack trace:
#0 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(53): OC\DB\Exceptions\DbalException::wrap()
#1 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(289): OC\DB\ConnectionAdapter->executeQuery()
#2 /var/www/nextcloud/lib/private/AppConfig.php(1264): OC\DB\QueryBuilder\QueryBuilder->executeQuery()
#3 /var/www/nextcloud/lib/private/AppConfig.php(270): OC\AppConfig->loadConfig()
#4 /var/www/nextcloud/lib/private/legacy/OC_App.php(653): OC\AppConfig->searchValues()
#5 /var/www/nextcloud/lib/private/Server.php(612): OC_App::getAppVersions()
#6 /var/www/nextcloud/lib/private/Memcache/Factory.php(112): OC\Server->OC\{closure}()
#7 /var/www/nextcloud/lib/private/Memcache/Factory.php(124): OC\Memcache\Factory->getGlobalPrefix()
#8 /var/www/nextcloud/lib/private/Server.php(968): OC\Memcache\Factory->createLocking()
#9 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#10 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#11 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#12 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#13 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#14 /var/www/nextcloud/lib/private/Files/View.php(75): OC\AppFramework\Utility\SimpleContainer->get()
#15 /var/www/nextcloud/lib/private/Server.php(422): OC\Files\View->__construct()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(153): OC\Server->OC\{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(42): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1303): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/base.php(637): OC\Server->boot()
#23 /var/www/nextcloud/lib/base.php(1194): OC::init()
#24 /var/www/nextcloud/console.php(28): require_once('...')
#25 /var/www/nextcloud/occ(33): require_once('...')
#26 {main}

Apps

The output of occ app:list (if possible).

Doesn’t run. I do have tables in the database, but I don’t know if they got replaced. I tried running and db mainenance stripts, but occ fails to do anything.

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

if i put the 31.0.14 version back, the website work again, but all my users are missing. so i think there is a db schema update (for some reason between 31.0.9 and 31.0.14.

on the initial setup, i created a user with the same name as a previous user, but none of the 104gb of photos appear. now i feel like i’m at risk of deleting data if nextcloud decides to zero out the /data/ folder with user’s data in it. dunno what to do.

occ works now, but i have no users. upgrade wiped them all out.

root@Server:/var/www/nextcloud# sudo -u www-data php occ maintenance:repair
 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Add background job
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
     - Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Keep legacy encryption enabled
 - Check encryption key format
 - Remove old dashboard app config data
 - Add job to cleanup the bruteforce entries
 - Queue a one-time job to check for user uploaded certificates
 - Repair DAV shares
 - Add background job to set the lookup server share state for users
 - Add token cleanup job
 - Clean up abandoned apps
 - Add possibly missing system config
 - Add AI tasks cleanup jobs
 - Queue a job to generate metadata
 - migrate lazy config values
 - Cache logo dimension to fix size in emails on Outlook
     - Theming is not used to provide a logo
 - Remove legacy ".ocdata" file
 - Add cleanup-deleted-users background job
 - Validate account properties and store phone numbers in a known format for search
     - Queued background to validate account properties.
 - AppAPI Daemons configuration GPU params update
     - Daemons configuration GPU params updated: 0
 - Upgrading Circles App
 - Sync groups with their circles
 - Fix component of birthday calendars
     - 1 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Adding background jobs to regenerate birthday calendar
 - Fix broken values of calendar objects
    0 [->--------------------------]
 - Registering building of calendar search index as background job
     - Add background job
 - Register building of social profile search index as background job
     - Add background job
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background job
     - Add background job
 - Register a background job to update rooms and resources
 - Queue jobs to clean up orphan event and contact data
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Clean up old calendar subscriptions from deleted users that were not cleaned-up
    0 [----->----------------------]
     - 0 calendar subscriptions without an user have been cleaned up
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Set existing shares as accepted
 - Clean up meta table
 - Show a hint about the new editor to existing users
 - Update OAuth token expiration times
 - init metadata
 - Switches from default updater server to the customer one if a valid subscription is available
 - Migrate some config values to lazy loading
 - Send an admin notification if monthly report is disabled
 - Force-reset all Text document sessions
 - Initialize migration of background images from dashboard to theming app
 - Add background job to check for backup codes
 - Populating added database structures for workflows

it says “not a mysql database” - is mariadb not a mysql database?

ah, i see that it created a new config.php when i copied the folder over. i copied my original config.php into the new folder, and now it says the server is in maintenance mode. progress?

progress - it sees the db:

root@Server:/var/www/nextcloud# sudo -u www-data php occ maintenance:repair
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
 - Repair MySQL collation
     - All tables already have the correct collation -> nothing to do
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Repair step already executed
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
     - Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar
...

running repair:

root@Server:/var/www/nextcloud# sudo -u www-data php /var/www/nextcloud/occ upgrade -v
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2026-05-03T06:17:36+00:00 Setting log level to debug
2026-05-03T06:17:36+00:00 Repair step: Repair MySQL collation
2026-05-03T06:17:36+00:00 Repair info: All tables already have the correct collation -> nothing to do
2026-05-03T06:17:36+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2026-05-03T06:17:36+00:00 Repair step: Drop account terms table when migrating from ownCloud
2026-05-03T06:17:36+00:00 Updating database schema
2026-05-03T06:17:37+00:00 Updated database
2026-05-03T06:17:37+00:00 Disabled incompatible app: mail
2026-05-03T06:17:37+00:00 Updating <files_sharing> ...
2026-05-03T06:17:37+00:00 Repair step: Fix the share type of guest shares when migrating from ownCloud
2026-05-03T06:17:37+00:00 Repair step: Copy the share password into the dedicated column
2026-05-03T06:17:37+00:00 Repair step: Set existing shares as accepted
2026-05-03T06:17:37+00:00 Updated <files_sharing> to 1.23.2
2026-05-03T06:17:37+00:00 Updating <richdocuments> ...
2026-05-03T06:17:38+00:00 Updated <richdocuments> to 8.7.9
2026-05-03T06:17:38+00:00 Updating <calendar> ...
2026-05-03T06:17:38+00:00 Updated <calendar> to 5.5.17
2026-05-03T06:17:38+00:00 Updating <contacts> ...
2026-05-03T06:17:38+00:00 Updated <contacts> to 7.3.17
2026-05-03T06:17:38+00:00 Updating <contactsinteraction> ...
2026-05-03T06:17:38+00:00 Updated <contactsinteraction> to 1.12.1
2026-05-03T06:17:38+00:00 Updating <text> ...
2026-05-03T06:17:38+00:00 Repair step: Force-reset all Text document sessions
2026-05-03T06:17:38+00:00 Updated <text> to 5.0.2
2026-05-03T06:17:47+00:00 Repair step: Restore default tags that are missing
2026-05-03T06:17:47+00:00 Repair info: Looking up default tags
2026-05-03T06:17:47+00:00 Repair info: 0 accounts to check found
2026-05-03T06:17:47+00:00 Restore default tags that are missing
2026-05-03T06:17:47+00:00 
                          2026-05-03T06:17:47+00:00  Done
    0/0 [->--------------------------]   0%2026-05-03T06:17:47+00:00 
2026-05-03T06:17:47+00:00 Repair step: Add a generated message-id to all Mail messages that have none
2026-05-03T06:17:47+00:00 Repair info: Looking up messages without a message-id
2026-05-03T06:17:47+00:00 Repair step: Purify and migrate collected mail addresses
2026-05-03T06:17:47+00:00 Purify and migrate collected mail addresses
                          2026-05-03T06:17:47+00:00  Done
    0/0 [----->----------------------]   0%2026-05-03T06:17:47+00:00 
2026-05-03T06:17:47+00:00 Repair step: Insert background jobs for all accounts
2026-05-03T06:17:47+00:00 Insert background jobs for all accounts
                          2026-05-03T06:17:47+00:00  Done
    0/0 [--------->------------------]   0%2026-05-03T06:17:47+00:00 
2026-05-03T06:17:47+00:00 Repair step: Make Mail itinerary extractor executable
2026-05-03T06:17:47+00:00 Repair step: Create or update provisioned Mail accounts
2026-05-03T06:17:47+00:00 Repair info: 0 accounts provisioned
2026-05-03T06:17:47+00:00 Repair step: Repair Broken Threads for all mail accounts
2026-05-03T06:17:47+00:00 Repair info: Repaired threads, 0 messages updated
2026-05-03T06:17:47+00:00 Repair step: Queue a job to delete duplicated cached messages
2026-05-03T06:17:47+00:00 Repair step: Repair MySQL collation
2026-05-03T06:17:47+00:00 Repair info: All tables already have the correct collation -> nothing to do
2026-05-03T06:17:47+00:00 Repair step: Clean tags and favorites
2026-05-03T06:17:47+00:00 Repair info: 0 tags of deleted users have been removed.
2026-05-03T06:17:47+00:00 Repair info: 0 tags for delete files have been removed.
2026-05-03T06:17:47+00:00 Repair info: 0 tag entries for deleted tags have been removed.
2026-05-03T06:17:47+00:00 Repair info: 0 tags with no entries have been removed.
2026-05-03T06:17:47+00:00 Repair step: Repair invalid shares
2026-05-03T06:17:47+00:00 Repair step: Move .step file of updater to backup location
2026-05-03T06:17:47+00:00 Repair step: Add move avatar background job
2026-05-03T06:17:47+00:00 Repair info: Repair step already executed
2026-05-03T06:17:47+00:00 Repair step: Add preview cleanup background jobs
2026-05-03T06:17:47+00:00 Repair step: Migrate oauth2_clients table to nextcloud schema
2026-05-03T06:17:47+00:00 Repair info: Update the oauth2_access_tokens table schema.
2026-05-03T06:17:47+00:00 Repair info: Update the oauth2_clients table schema.
2026-05-03T06:17:47+00:00 Repair info: Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
2026-05-03T06:17:47+00:00 Repair step: Repair language codes
2026-05-03T06:17:47+00:00 Repair step: Add log rotate job
2026-05-03T06:17:47+00:00 Repair step: Clear frontend caches
2026-05-03T06:17:47+00:00 Repair info: Image cache cleared
2026-05-03T06:17:47+00:00 Repair info: JS cache cleared
2026-05-03T06:17:47+00:00 Repair step: Clear every generated avatar
2026-05-03T06:17:47+00:00 Repair step: Add preview background cleanup job
2026-05-03T06:17:47+00:00 Repair step: Queue a one-time job to cleanup old backups of the updater
2026-05-03T06:17:47+00:00 Repair step: Cleanup invalid photocache files for carddav
2026-05-03T06:17:47+00:00 Repair step: Add background job to cleanup login flow v2 tokens
2026-05-03T06:17:47+00:00 Repair step: Remove potentially over exposing share links
2026-05-03T06:17:47+00:00 Repair info: No need to remove link shares.
2026-05-03T06:17:47+00:00 Repair step: Clear access cache of projects
2026-05-03T06:17:47+00:00 Repair step: Reset generated avatar flag
2026-05-03T06:17:47+00:00 Repair step: Keep legacy encryption enabled
2026-05-03T06:17:47+00:00 Repair step: Check encryption key format
2026-05-03T06:17:47+00:00 Repair step: Remove old dashboard app config data
2026-05-03T06:17:47+00:00 Repair step: Add job to cleanup the bruteforce entries
2026-05-03T06:17:47+00:00 Repair step: Queue a one-time job to check for user uploaded certificates
2026-05-03T06:17:47+00:00 Repair step: Repair DAV shares
2026-05-03T06:17:47+00:00 Repair step: Add background job to set the lookup server share state for users
2026-05-03T06:17:47+00:00 Repair step: Add token cleanup job
2026-05-03T06:17:47+00:00 Repair step: Clean up abandoned apps
2026-05-03T06:17:47+00:00 Repair step: Add possibly missing system config
2026-05-03T06:17:47+00:00 Repair step: Add AI tasks cleanup jobs
2026-05-03T06:17:47+00:00 Repair step: Queue a job to generate metadata
2026-05-03T06:17:47+00:00 Repair step: migrate lazy config values
2026-05-03T06:17:47+00:00 Repair step: Cache logo dimension to fix size in emails on Outlook
2026-05-03T06:17:47+00:00 Repair info: Theming is not used to provide a logo
2026-05-03T06:17:47+00:00 Repair step: Remove legacy ".ocdata" file
2026-05-03T06:17:47+00:00 Repair step: Add cleanup-deleted-users background job
2026-05-03T06:17:47+00:00 Repair step: Validate account properties and store phone numbers in a known format for search
2026-05-03T06:17:47+00:00 Repair info: Queued background to validate account properties.
2026-05-03T06:17:47+00:00 Starting code integrity check...
2026-05-03T06:17:53+00:00 Finished code integrity check
2026-05-03T06:17:53+00:00 Update successful
2026-05-03T06:17:53+00:00 Maintenance mode is kept active
2026-05-03T06:17:53+00:00 Resetting log level

it’s still in maintenance mode though. dunno how to exit that. to google i go

and i’m back.

sudo -u www-data php occ maintenance:mode --off

The upgrade took 4 hours (because of lack of knowledge). is there a permission change i can make such that the web updater works? every few months i have to remember how to manually copy the right files into the right folders.

edit: so it usually gets stuck at step 6. i just need to know exactly which folder to copy to which directory to continue the upgrade.

My /data/ folder looks like this: (w/o the users)

drwxr-xr-x  5 www-data www-data      54 Oct 30  2021 administrator
drwxr-xr-x 15 www-data www-data    4096 Sep 21  2025 appdata_oc2i3f4h733g
drwxr-xr-x  2 www-data www-data      27 Jul 20  2024 files_external
-rw-r--r--  1 www-data www-data       0 May  2 23:17 index.html
-rw-r-----  1 www-data www-data 7632425 May  2 23:17 nextcloud.log
-rw-r--r--  1 www-data www-data    4096 Sep 21  2025 owncloud.db
-rw-r--r--  1 www-data www-data  211580 May  2 17:32 updater.log
drwxr-xr-x  4 www-data www-data      67 May  2 17:28 updater-oc2i3f4h733g
drwxrwxr-x  4 www-data www-data      51 May  2 17:31 updater-ocvv9e4gfnc7

I now have 2 updater-ocxxx folders - can i delete one? both? keep the one that matches appdata_xxx?

The Manual Upgrade process is covered in the Admin Manual in the Maintenance section.

As for why the regular update is failing, would need more details such as exact failure messages. And review your updater.log, etc. There’s a troubleshooting section for the Updater the manual that’s covers some aspects of this.