Two-Factor U2F has stopped functioning in official container 23.0.3

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

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:

Nextcloud version (eg, 20.0.5): 23.0.3
Operating system and version (eg, Ubuntu 20.04): official docker container nextcloud/23
Apache or nginx version (eg, Apache 2.4.25): Provided by container
PHP version (eg, 7.4): provided by container

The issue you are facing: Two-Factor U2F has stopped functioning after update to 23.0.2/3 (not completely sure which)

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

Steps to replicate it:

  1. Log in via U2F
  2. Receive error message that U2F was not supported

No errors show up in Administration > Logging
Deleted U2F key, and went to add back via Personal > Security

  1. Click on Add U2F device
  2. Please plug in your U2F device and press the device button to authorize. shows up briefly and is then replaced with the Name your device dialogue box.
  3. Input Test in the dialogue box and press Add
  4. Adding your device … stays on the screen with the spinning wheel. Nothing appears to happen.
  5. Browsing to Administration > Logging there is an exception error for the app index

The output of your Nextcloud log in Administration > Logging:

[index] Error: OCA\TwoFactorU2F\Controller\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217 in file '/var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php' line 65

POST /apps/twofactor_u2f/settings/finishregister
from 172.18.0.5 by rfleming at 2022-04-12T21:40:16+00:00

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

<?php                                   
$CONFIG = array (               
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>                
  array (              
    0 =>                                  
    array (                                         
      'path' => '/var/www/html/apps',
      'url' => '/apps',          
      'writable' => false,
    ),   
    1 =>           
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),                       
  ),
  'instanceid' => 'ocegir14m1sc',
  'passwordsalt' => 'XXXXX',
  'secret' => 'XXXXX',
  'trusted_domains' => 
  array (
    0 => 'XXXXX',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '23.0.3.2',
  'overwrite.cli.url' => 'https://XXXXX',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => '',
  'dbuser' => 'XXXXX',
  'dbpassword' => 'XXXXX',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'fXXXXX',
  'mail_smtphost' => 'XXXXX',
  'mail_from_address' => 'XXXXX',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'updater.release.channel' => 'stable',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpport' => '587',     
  'mail_smtpsecure' => 'tls',                
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'XXXXX',
  'mail_smtppassword' => 'XXXXX',
  'mysql.utf8mb4' => true,             
  'default_phone_region' => 'CA',
  'trusted_proxies' => 
  array (
    0 => 'traefik',
  ),
  'app_install_overwrite' => 
  array (
    0 => 'richdocuments',
    1 => 'richdocumentscode',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:
docker container redirects to /dev/stdout and /dev/stderr

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"rVqA2G6kyPxYWbgPP825","level":3,"time":"2022-04-12T21:40:16+00:00","remoteAddr":"172.18.0.5","user":"rfleming","app":"index","method":"POST","url":"/apps/twofactor_u2f/settings/finishregister","message":"OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217 in file '/var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php' line 65","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36","version":"23.0.3.2","exception":{"Exception":"Exception","Message":"OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217 in file '/var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php' line 65","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorU2F\\Controller\\SettingsController"},"finishRegister"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\TwoFactorU2F\\Controller\\SettingsController","finishRegister",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"twofactor_u2f.settings.finishRegister"}]},{"file":"/var/www/html/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/twofactor_u2f/settings/finishregister"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"TypeError","Message":"OCA\\TwoFactorU2F\\Controller\\SettingsController::finishRegister(): Argument #1 ($registrationData) must be of type string, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 217","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"finishRegister","class":"OCA\\TwoFactorU2F\\Controller\\SettingsController","type":"->","args":[null,null,"Test"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorU2F\\Controller\\SettingsController"},"finishRegister"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\TwoFactorU2F\\Controller\\SettingsController"},"finishRegister"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\TwoFactorU2F\\Controller\\SettingsController","finishRegister",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"twofactor_u2f.settings.finishRegister"}]},{"file":"/var/www/html/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/twofactor_u2f/settings/finishregister"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/twofactor_u2f/lib/Controller/SettingsController.php","Line":65},"CustomMessage":"--"},"id":"6255f1ea88f31"}