It happened to me right now.
After updating the passwords app to 2022.2.21, I cannot access my nextcloud instance with the same error on nextcloud updater.
Trying occ update from command line gives the same error:
Updating …
[owncloud][updater][1] \OC\Updater::appUpgradeStarted: Updating …
[owncloud][no app in context][1] Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used
[owncloud][updater][1] \OC\Repair::step: Repair step: Check System Requirements
[owncloud][no app in context][3] {“Exception”:“RuntimeException”,“Message”:“Invalid query type, expected SELECT query”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/passwords/lib/Migration/Version20220101.php",“line”:1716,“function”:“exe
cuteQuery”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/passwords/lib/Migration/Version20220101.php",“line”:108,“function”:“createShareTable”,“class”:“OCA\Passwords\Migration\Version20220101”,"
type":"->"},{“file”:"/var/www/nextcloud/lib/private/DB/MigrationService.php",“line”:532,“function”:“changeSchema”,“class”:“OCA\Passwords\Migration\Version20220101”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/DB/MigrationService.ph
p",“line”:425,“function”:“executeStep”,“class”:“OC\DB\MigrationService”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_App.php",“line”:1011,“function”:“migrate”,“class”:“OC\DB\MigrationService”,“type”:"->"},{“file”:"/var/w
ww/nextcloud/lib/private/Updater.php",“line”:353,“function”:“updateApp”,“class”:“OC_App”,“type”:"::",“args”:["*** sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/lib/private/Updater.php",“line”:265,“function”:“doAppUpgrade”,"
class":“OC\Updater”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Updater.php",“line”:133,“function”:“doUpgrade”,“class”:“OC\Updater”,“type”:"->"},{“file”:"/var/www/nextcloud/core/Command/Upgrade.php",“line”:235,“function”:“upgrade”,
“class”:“OC\Updater”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php",“line”:255,“function”:“execute”,“class”:“OC\Core\Command\Upgrade”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/consol
e/Application.php",“line”:1009,“function”:“run”,“class”:“Symfony\Component\Console\Command\Command”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/console/Application.php",“line”:273,“function”:“doRunCommand”,“class”:“Symfony\
Component\Console\Application”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/symfony/console/Application.php",“line”:149,“function”:“doRun”,“class”:“Symfony\Component\Console\Application”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/
private/Console/Application.php",“line”:211,“function”:“run”,“class”:“Symfony\Component\Console\Application”,“type”:"->"},{“file”:"/var/www/nextcloud/console.php",“line”:99,“function”:“run”,“class”:“OC\Console\Application”,“type”:"->"},{
“file”:"/var/www/nextcloud/occ",“line”:11,“args”:["/var/www/nextcloud/console.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",“Line”:296,“CustomMessage”:“Invalid query type, expected
SELECT query”}
RuntimeException: Invalid query type, expected SELECT query
[owncloud][updater][3] \OC\Updater::failure: RuntimeException: Invalid query type, expected SELECT query
Update failed
[owncloud][updater][3] \OC\Updater::updateEnd: Update failed
Maintenance mode is kept active
[owncloud][updater][1] \OC\Updater::maintenanceActive: Maintenance mode is kept active
Resetting log level
[owncloud][updater][1] \OC\Updater::resetLogLevel: Reset log level to Warning(2)
**
Reverted back to 2022.1.20 and been able to access again to my NC instance and passwords app without problem. Will wait until new version of passwords solves this problem to update