twofactor_u2f icon indicating copy to clipboard operation
twofactor_u2f copied to clipboard

SQL Schema incompatible with MariaDB

Open makuser opened this issue 5 years ago • 3 comments

Steps to reproduce

  1. Install Mariadb 10.3
  2. Install extension
  3. Register device

Expected behaviour

Device get's registered

Actual behaviour

SQL Error on browser console and server

Server configuration

Operating system: Debian GNU/Linux 10 (buster) Web server: apache2:amd64/stable 2.4.38-3+deb10u3 Database: mariadb-server:all/stable 1:10.3.23-0+deb10u1 PHP version: php7.4:all/buster 7.4.9-1+0~20200807.24+debian10~1.gbp7962cd Version: 19.0.2 Updated from an older version or fresh install: fresh install

Client configuration

Browser: firefox:amd64/focal-security 80.0+build2-0ubuntu0.20.04.1 Operating system: Ubuntu 20.04.1 LTS

Logs

Web server error log
Insert your webserver log here
Server log (data/nextcloud.log)
{"reqId":"v7ZixzWsK5Lhawg2b09L","level":3,"time":"2020-08-27T13:16:10+00:00","remoteAddr":"10.22.1.135","user":"marc","app":"index","method":"POST","url":"/index.php/apps/twofactor_u2f/settings/finishregister","message":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing 'INSERT INTO `oc_twofactor_u2f_registrations` (`user_id`, `key_handle`, `public_key`, `certificate`, `counter`, `name`) VALUES(?, ?, ?, ?, ?, ?)' with params [\"marc\", \"ObAHV01eRJlQ-I2If0HeRbcQM8F_SZhX8GqzyRaIeiBRof9fAB97NBxyIr2TvB7AUYe_v0lcWVK_wu5P5-_W8qXTvV3RnhbnpjhWA7O7PAGnmjnLe6rYCC3LVNtXp5tRGXJOLd5XHXYxORetPnNaSTEV8FSvxONQy9UKU-8NB7YQnIGqNeTi6o7B27AtGD3QyPpKtWumUx2ycHpQ1m_V7e1I9qrJ6SOUImwBsTsorRL1bePTwYs2Y-1EAvlo2rTz_hQwJvY8NsGkW7K5jwoE13ZniD4sVgBucWmgAG5CTd0D8is0NN-rgurJAYh4BTJAMX-30lRp9vxv3APZEFJu\", \"BAs7fklzxNnOkXM8\\/K8RYb7uCacsaFMchwBsaboRg3fu5xlfKf9pDf5uIoNuYexYMAycVRV1TVSFW52keZtadpY=\", \"MIIBeDCCAR+gAwIBAgIUWyi5IhwBxA+Wp8IsmHxhtgBAJ\\/AwCgYIKoZIzj0EAwIwEjEQMA4GA1UEAwwHVTJGIEtleTAeFw0yMDA4MjcxMjI1MTlaFw0zMDA4MjcxMjI1MTlaMBIxEDAOBgNVBAMMB1UyRiBLZXkwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASY\\/Rx4WiAo3ML2XTCqOUukfO05HDGIW7Hdz2qjUqMmcBkA\\/qULSxbBMrOwASIGOvpqfZhCRWTjnUTAzWZFzAaDo1MwUTAdBgNVHQ4EFgQUydHQESNPgZ4MfvxykmxPdZHRRIIwHwYDVR0jBBgwFoAUydHQESNPgZ4MfvxykmxPdZHRRIIwDwYDVR0TAQH\\/BAUwAwEB\\/zAKBggqhkjOPQQDAgNHADBEAiAGWsMIbs4\\/bGSZVlEoi7FI1WGS4rJ\\/jhD1ZSZ154KuGgIgG3g1kR+M6gzLWSw5252WAGJItdfaL30ZT53TY6C4yGw=\", -1, \"MAKlaptop\"]:\n\nSQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'key_handle' at row 1","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","line":169,"function":"convertException","class":"Doctrine\\DBAL\\Driver\\AbstractMySQLDriver","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","line":145,"function":"wrapException","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1063,"function":"driverExceptionDuringQuery","class":"Doctrine\\DBAL\\DBALException","type":"::"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":214,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":203,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":129,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Service/U2FManager.php","line":133,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Controller/SettingsController.php","line":67,"function":"finishRegistration","class":"OCA\\TwoFactorU2F\\Service\\U2FManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"finishRegister","class":"OCA\\TwoFactorU2F\\Controller\\SettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1012,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","Line":106,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDOException","Message":"SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'key_handle' at row 1","Code":"22001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1054,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDOStatement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":214,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":203,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":129,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Service/U2FManager.php","line":133,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Controller/SettingsController.php","line":67,"function":"finishRegistration","class":"OCA\\TwoFactorU2F\\Service\\U2FManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"finishRegister","class":"OCA\\TwoFactorU2F\\Controller\\SettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1012,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php","Line":119,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'key_handle' at row 1","Code":"22001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php","line":117,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1054,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDOStatement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":214,"function":"executeUpdate","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":203,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":129,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Service/U2FManager.php","line":133,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/www/nextcloud/apps/twofactor_u2f/lib/Controller/SettingsController.php","line":67,"function":"finishRegistration","class":"OCA\\TwoFactorU2F\\Service\\U2FManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"finishRegister","class":"OCA\\TwoFactorU2F\\Controller\\SettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1012,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php","Line":117}},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0","version":"19.0.2.2","id":"5f47b3ae5a84b"}

It's a clear SQL schema issue.

makuser avatar Aug 27 '20 13:08 makuser

1406 Data too long for column 'key_handle'

yes

ChristophWurst avatar Aug 27 '20 14:08 ChristophWurst

Have hit this myself just now. No indication of a failure in the UI. twofactor_webauthn is also affected.

garymoon avatar May 14 '22 16:05 garymoon

We haven't seen that anywhere on CI. Could you give us as much details about your MariaDB installation as possible? What is your version, build and configuration?

ChristophWurst avatar May 16 '22 06:05 ChristophWurst