Log in by Webauth device (Yubikey) fails 21.0.1+Webauthn 0.2.9

Since the upgrade of NC from 20.x to 21.0.3 the passwordless authentication does not work anymore. I am trying a yubikey with Firefox 78.11.0esr and Chromium 90.0.4430.212.
There is the following error in the NC log:

[index] Error: Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘2’ for key ‘PRIMARY’ at <>

  1. /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1728
    Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
  2. /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1667
    Doctrine\DBAL\Connection->handleDriverException(Doctrine\DBAL\Driver\PDO\Exception {}, Doctrine\DBAL\Query {})
  3. /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1146
    Doctrine\DBAL\Connection->convertExceptionDuringQuery(Doctrine\DBAL\Driver\PDO\Exception {}, “INSERT INTO `oc … )”, ["Yubico Securit … 2], [2,2,2,2,1])
  4. /var/www/html/nextcloud/lib/private/DB/Connection.php line 257
    Doctrine\DBAL\Connection->executeStatement(“INSERT INTO `oc … )”, ["Yubico Securit … 2], [2,2,2,2,1])
  5. /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php line 213
    OC\DB\Connection->executeStatement(“INSERT INTO `oc … )”, {dcValue1: "Yubi … 2}, {dcValue1: 2,dcV … 1})
  6. /var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 287
    Doctrine\DBAL\Query\QueryBuilder->execute()
  7. /var/www/html/nextcloud/lib/public/AppFramework/Db/QBMapper.php line 139
    OC\DB\QueryBuilder\QueryBuilder->execute()
  8. /var/www/html/nextcloud/lib/public/AppFramework/Db/QBMapper.php line 164
    OCP\AppFramework\Db\QBMapper->insert(OC\Authenticatio … 2})
  9. /var/www/html/nextcloud/lib/private/Authentication/WebAuthn/CredentialRepository.php line 89
    OCP\AppFramework\Db\QBMapper->insertOrUpdate(OC\Authenticatio … 2})
  10. /var/www/html/nextcloud/lib/private/Authentication/WebAuthn/CredentialRepository.php line 93
    OC\Authentication\WebAuthn\CredentialRepository->saveAndReturnCredentialSource(Webauthn\PublicKeyCredentialSource {}, “default”)
  11. /var/www/html/nextcloud/3rdparty/web-auth/webauthn-lib/src/AuthenticatorAssertionResponseValidator.php line 206
    OC\Authentication\WebAuthn\CredentialRepository->saveCredentialSource(Webauthn\PublicKeyCredentialSource {})
  12. /var/www/html/nextcloud/lib/private/Authentication/WebAuthn/Manager.php line 235
    Webauthn\AuthenticatorAssertionResponseValidator->check(null, Webauthn\Authent … {}, Webauthn\PublicK … {}, GuzzleHttp\Psr7\ServerRequest {}, “nextcloud”)
  13. /var/www/html/nextcloud/core/Controller/WebAuthnController.php line 107
    OC\Authentication\WebAuthn\Manager->finishAuthentication(Webauthn\PublicK … {}, “{“id”:”-V0gM … }", “nextcloud”)
  14. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 218
    OC\Core\Controller\WebAuthnController->finishAuthentication("{“id”:"-V0gM … }")
  15. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 127
    OC\AppFramework\Http\Dispatcher->executeController(OC\Core\Controller\WebAuthnController {}, “finishAuthentication”)
  16. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 157
    OC\AppFramework\Http\Dispatcher->dispatch(OC\Core\Controller\WebAuthnController {}, “finishAuthentication”)
  17. /var/www/html/nextcloud/lib/private/Route/Router.php line 302
    OC\AppFramework\App::main(“OC\Core\Contr … r”, “finishAuthentication”, OC\AppFramework\ … {}, {_route: "core.W … "})
  18. /var/www/html/nextcloud/lib/base.php line 993
    OC\Route\Router->match("/login/webauthn/finish")
  19. /var/www/html/nextcloud/index.php line 37
    OC::handleRequest()

POST /login/webauthn/finish
from 192.168.4.1 at 2021-07-26T14:53:31+00:00