Server error after installing twofactor_u2f

I just migrated from NC 13.0.12 to 14.0.8 to 15.0.5.3 on debian jessie with Apache 2.4 and PHP 7.3. All fine so far for two other instances where I did the same steps as described below.

In my last instance, I encountered a warning when enabling the twofactor_* apps: “enabling this leads to instability” or similar (in yellow). However, that was AFTER I was installing an app through the app store within the web interface. I think it was after I installed twofactor_admin (not sure, though). After that, the server was inaccessible through web.

It gets accessible as soon as I manually delete the apps/twofactor_u2f folder via shell and it gets inaccessible (internal server error) as soon as I install twofactor_u2f, no matter whether other twofactor_* apps are installed or not.

I see the errors in NC log below but have no clue what they mean: https://seyfarth.de/nextcloud/u2f-errorlog.txt (170kB, please cite relevant parts, file will be deleted once not needed nay longer). Any hint/help/ideas what to try?

Getting rid of an app is not only done by deleting a directory, because the database tables of an app still exist. I think the mentioned error message is clear Message":"An exception occurred while executing 'SELECT id, user_id, key_handle, public_key, certificate, counter, name FROM oc_twofactor_u2f_registrations … Column not found: 1054 Unknown column ‘name’ in ‘field list’ …"

The app requires a database table named “oc_twofactor_u2f_registrations” which doesn’t contain the column "name"". You can try to drop the tables manually and then reinstall the app so that the tables should correctly been created again.

There are no tables with u2f in their name. These tables with twofactor in their name exist in my database:

  • oc_twofactor_admin_codes
  • oc_twofactor_backupcodes
  • oc_twofactor_nextcloud_notification_tokens
  • oc_twofactor_providers
  • oc_twofactor_yubikey

oc_twofactor_providers contains no rows that contain u2f in provider_id.

Ok, if you couldn’t find the mentioned table, you should be able to reinstall the app, if you require it.

If I do, my whole instance is unusable as soon as the app is installed.
Deleting it’s directory resumes to normal operation.

Still have this issue in NC 18.0.1 on that NC instance. Please advise on how to debug this.

I’ve just checked my database and found related entries in the “oc_appconfig” table. It might be worse to delete this entries too, to make sure that the app has completely been uninstalled. (Keep in mind to create a database backup :wink:):

> select * from oc_appconfig where appid like "%u2f%";
+---------------+-------------------+-------------+
| appid         | configkey         | configvalue |
+---------------+-------------------+-------------+
| twofactor_u2f | enabled           | yes         |
| twofactor_u2f | installed_version | 5.0.2       |
| twofactor_u2f | types             |             |
+---------------+-------------------+-------------+

``´