NextCloud 22.0.0 Breaks Challenge Password

I upgraded from a working 21.x nextcloud to the 22.0.0 version and now the Password app fails to open with the message, “Loading Challenge Failed.” Now, I am unable to open passwords. Any suggestions?

Check your Nextcloud log, there might be more information about the issue.

This application and server were working and in use yesterday. Nothing on this server changed except for the Docker image upgrading to 22.0.0 and the corresponding upgrade.

Here is the related log information:

“version”:“22.0.0.11”,“exception”:{“Exception”:“OCP\AppFramework\Db\DoesNotExistException”,“Message”:“Did expect one result but found none when executing: query “SELECT * FROM *PREFIX*passwords_challenge WHERE (deleted = :dcValue1) AND (user_id = :dcValue2) AND (uuid = :dcValue3)”; “,“Code”:0,“Trace”:[{“file”:”/var/www/html/lib/public/AppFramework/Db/QBMapper.php”,“line”:361,“function”:“findOneQuery”,“class”:“OCP\AppFramework\Db\QBMapper”,“type”:"->",“args”:[{“class”:“OC\DB\QueryBuilder\QueryBuilder”}]}

I checked the oc_passwords_challenge table and it is in fact empty. Is this some sort of converion error? Any suggestions as to how to recover short of restoring from backup?

Digging into this, it looks like the Passwords app has significantly changed with the release 2021.7.21 included in nextcloud 22.0.0. My guess is that the upgrade script has failed for some reason.

Looking at GitHub, I think this is the answer: Upgrade 21.0.2 to 21.0.3 Exception: Database error when running migration latest for app passwords · Issue #27788 · nextcloud/server · GitHub

Yes, that looks to me too like there is data missing tast should have been migrated.

If you’re feeling confident enough to modify your database, you see if the following tables exist and then move any missing data manually:

From To
passwords_entity_challenge passwords_challenge
passwords_entity_folder passwords_folder
passwords_entity_folder_revision passwords_folder_rv
passwords_entity_keychain passwords_keychain
passwords_entity_password passwords_password
passwords_entity_password_revision passwords_password_rv
passwords_entity_registration passwords_registration
passwords_entity_session passwords_session
passwords_entity_share passwords_share
passwords_entity_tag passwords_tag
passwords_entity_tag_revision passwords_tag_rv
passwords_relation_password_tag passwords_pw_tag_rel