OCP AppFramework QueryException Could not resolve logger! Class logger does not exist Update failed

Support intro

Nextcloud version (eg, 20.0.5): Nextcloud 19.0.8 upgrade to 23.0.2
Operating system and version (eg, Ubuntu 20.04): CentOS 7.5
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.6
PHP version (eg, 7.4): PHP 7.3.33

The issue you are facing:

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

Steps to replicate it:

1. Copy the new version `Nextcloud 19.0.9 or 19.0.10 or 19.0.13

2. Execute directory permission and occ execute permission settings
chown -Rf apache:apache /var/www/html

find /var/www/html/ -type d -exec chmod 750 {} ;
find /var/www/html/ -type f -exec chmod 640 {} ;

chmod u+x /var/www/html/occ

3. upgrade
sudo -u apache php occ upgrade

The output of your Nextcloud log in Admin > Logging:

\"workflowengine\" in appstore","userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":1,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::checkAppStoreApp: Checked for update of app \"workflowengine\" in appstore","userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":3,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve logger! Class logger does not exist","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["logger"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":149,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["logger",true]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":78,"function":"query","class":"OC\\ServerContainer","type":"->","args":["logger"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"name":"OC\\Repair\\RepairDavShares","__class__":"ReflectionClass"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\Repair\\RepairDavShares"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":149,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\Repair\\RepairDavShares",true]},{"file":"/var/www/html/lib/private/Repair.php","line":160,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\Repair\\RepairDavShares"]},{"file":"/var/www/html/lib/private/Updater.php","line":273,"function":"getRepairSteps","class":"OC\\Repair","type":"::","args":[]},{"file":"/var/www/html/lib/private/Updater.php","line":130,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["19.0.9.1","19.0.8.1"]},{"file":"/var/www/html/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/html/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":1012,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":272,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"installer":{"__class__":"OC\\Installer"},"__class__":"OC\\Core\\Command\\Upgrade"},{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":148,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/html/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/html/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/html/occ","line":11,"args":["/var/www/html/console.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","Line":107,"CustomMessage":"--"},"userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":3,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: OCP\\AppFramework\\QueryException: Could not resolve logger! Class logger does not exist","userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":3,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":1,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"19.0.8.1"}
{"reqId":"umqqRaR1xC4REQaevQfr","level":1,"time":"2022-03-12T16:17:00+08:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"19.0.8.1"}

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

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/localhost",
        "overwriteprotocol": "https",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "19.0.8.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
            [
                "localhost",
                11211
            ]
        ],
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "activity_expire_days": 365,
        "wnd.logging.enable": true,
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.5.0
  - activity: 2.12.1
  - admin_audit: 1.9.0
  - cloud_federation_api: 1.2.0
  - comments: 1.9.0
  - dav: 1.15.0
  - federatedfilesharing: 1.9.0
  - federation: 1.9.0
  - files: 1.14.0
  - files_pdfviewer: 1.8.0
  - files_sharing: 1.11.0
  - files_trashbin: 1.9.0
  - files_versions: 1.12.0
  - files_videoplayer: 1.8.0
  - firstrunwizard: 2.8.0
  - groupfolders: 7.1.3
  - logreader: 2.4.0
  - lookup_server_connector: 1.7.0
  - nextcloud_announcements: 1.8.0
  - notifications: 2.7.0
  - oauth2: 1.7.0
  - onlyoffice: 6.4.2
  - password_policy: 1.9.1
  - photos: 1.1.0
  - privacy: 1.3.0
  - provisioning_api: 1.9.0
  - recommendations: 0.7.0
  - serverinfo: 1.9.0
  - settings: 1.1.0
  - sharebymail: 1.9.0
  - support: 1.2.1
  - systemtags: 1.9.0
  - text: 3.0.1
  - theming: 1.10.0
  - twofactor_backupcodes: 1.8.0
  - updatenotification: 1.9.0
  - user_ldap: 1.9.1
  - viewer: 1.3.0
  - workflowengine: 2.1.0
Disabled:
  - contactsinteraction
  - encryption
  - files_downloadactivity
  - files_external
  - files_rightclick
  - survey_client

Expected behavior

Checking for update of app viewer in appstore
Checked for update of app "viewer" in appstore
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore
OCP\AppFramework\QueryException: Could not resolve logger! Class logger does not exist
Update failed
Maintenance mode is kept active
Reset log level

I need to update the current version Nextcloud 19.0.8 to the latest version Nextcloud 23.0.2. After I updated Nextcloud 13.0.6.1 to Nextcloud 19.0.8, there was a problem, so I couldn’t update the version, and I also found a solution online. , there is no better solution for now, so I hope someone knows the solution, or can let me update to the latest version, the official version update line is as follows, 18.0.5 → 18.0.11 → 19.0.5 → 20.0. 2, and I can’t skip the update of the current version and the previous version, I can only update one version and then select the next version to update again.

20220312171804

Upgrades must follow this path:
13 to 14 to 15 to 16 …
Don’t jump any release or it will break your system…

Maybe a complete DB/NC fresh install and an occ rescan of your files is faster and simpler

I have updates from version 13 to 14 to 15 to 16 to 17 to 18 to 19, there is no way to skip each version update, only the problem occurs when I update from version 19 to version 20.

Or can I just update from version 23 to the home directory, then import the config, and finally respawn using the command to scan the files instead of updating them?

Do not execute this command

sudo -u apache php occ upgrade

Execute the following 6 commands

1. sudo -u apache php occ maintenance:repair
2. sudo -u apache php console.php files:scan --all
3. sudo -u apache php occ db:add-missing-columns
4. sudo -u apache php occ db:add-missing-indices
5. sudo -u apache php occ db:add-missing-primary-keys
6. sudo -u apache php occ db:convert-filecache-bigint

I had to “rebuild” a old NC15 to NC22…

I saved the data
Updated the Linux, from scratch with a brand new mariaDB
Fresh NC22
occ scan to rebuild the db…

I see, thank you.

I just upgrade from the last 23 version to the last 24 version and I get the same error message (see below). But NC is still working just fine (for me), so I don’t see a real problem yet.
Maybe the execution of these 6 commands helps in this case as well? I will give it a try (at night)

[no app in context] Fehler: OCP\AppFramework\QueryException: Could not resolve logger! Class logger does not exist at <>

  1. <>
    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(“*** sensitive parameters replaced ***”)
  2. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 108
    array_map()
  3. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 116
    OC\AppFramework\Utility\SimpleContainer->buildClass()
  4. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 133
    OC\AppFramework\Utility\SimpleContainer->resolve()
  5. /var/www/nextcloud/lib/private/ServerContainer.php line 161
    OC\AppFramework\Utility\SimpleContainer->query()
  6. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 71
    OC\ServerContainer->query()
  7. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
  8. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
  9. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 88
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
  10. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 100
    OC\EventDispatcher\EventDispatcher->dispatch()
  11. /var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php line 760
    OC\EventDispatcher\EventDispatcher->dispatchTyped()
  12. /var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php line 283
    OCA\DAV\CardDAV\CardDavBackend->updateCard(“*** sensitive parameters replaced ***”)
  13. /var/www/nextcloud/apps/dav/lib/HookManager.php line 166
    OCA\DAV\CardDAV\SyncService->updateUser(“*** sensitive parameters replaced ***”)
  14. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 106
    OCA\DAV\HookManager->changeUser()
  15. /var/www/nextcloud/lib/private/Server.php line 642
    OC_Hook::emit()
  16. <>
    OC\Server->OC{closure}(“*** sensitive parameters replaced ***”)
  17. /var/www/nextcloud/lib/private/Hooks/EmitterTrait.php line 106
    call_user_func_array()
  18. /var/www/nextcloud/lib/private/Hooks/PublicEmitter.php line 40
    OC\Hooks\BasicEmitter->emit()
  19. /var/www/nextcloud/lib/private/User/User.php line 564
    OC\Hooks\PublicEmitter->emit()
  20. /var/www/nextcloud/lib/private/User/User.php line 194
    OC\User\User->triggerChange()
  21. /var/www/nextcloud/lib/private/User/User.php line 172
    OC\User\User->setSystemEMailAddress()
  22. /var/www/nextcloud/apps/user_ldap/lib/User/User.php line 444
    OC\User\User->setEMailAddress()
  23. /var/www/nextcloud/apps/user_ldap/lib/User/User.php line 199
    OCA\User_LDAP\User\User->updateEmail(“*** sensitive parameters replaced ***”)
  24. /var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php line 206
    OCA\User_LDAP\User\User->processAttributes()
  25. <>
    OCA\User_LDAP\User_LDAP->checkPassword(“*** sensitive parameters replaced ***”)
  26. /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php line 108
    call_user_func_array()
  27. /var/www/nextcloud/apps/user_ldap/lib/Proxy.php line 155
    OCA\User_LDAP\User_Proxy->walkBackends()
  28. /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php line 257
    OCA\User_LDAP\Proxy->handleRequest()
  29. /var/www/nextcloud/lib/private/User/Manager.php line 257
    OCA\User_LDAP\User_Proxy->checkPassword(“*** sensitive parameters replaced ***”)
  30. /var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php line 49
    OC\User\Manager->checkPasswordNoLogging(“*** sensitive parameters replaced ***”)
  31. /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php line 40
    OC\Authentication\Login\UidLoginCommand->process()
  32. /var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php line 58
    OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
  33. /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php line 40
    OC\Authentication\Login\UserDisabledCheckCommand->process()
  34. /var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php line 53
    OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
  35. /var/www/nextcloud/lib/private/Authentication/Login/Chain.php line 108
    OC\Authentication\Login\PreLoginHookCommand->process()
  36. /var/www/nextcloud/core/Controller/LoginController.php line 329
    OC\Authentication\Login\Chain->process()
  37. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OC\Core\Controller\LoginController->tryLogin(“*** sensitive parameters replaced ***”)
  38. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
  39. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
  40. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
  41. /var/www/nextcloud/lib/base.php line 1030
    OC\Route\Router->match()
  42. /var/www/nextcloud/index.php line 36
    OC::handleRequest()