plenta / contao-jobs-basic-bundle

Contao Job Manager
https://plenta.io/contao-erweiterungen/jobs-basic
GNU Lesser General Public License v3.0
20 stars 6 forks source link

Unknown database type json requested, Doctrine\DBAL\Platforms\MySQLPlatform may not support it. #96

Open denniserdmann opened 1 year ago

denniserdmann commented 1 year ago

Jobs: 2.2.3 Contao: 4.13.18 MySQL: MariaDB 10.1.48 PHP: 8.1

Database-Migration after install is not possible because of json database type. Contao Manager suggests to open installtool, but updating the database in installtool results in an fatal error:

[2023-03-20T15:19:14.635402+00:00] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\SyntaxErrorException: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JSON DEFAULT NULL, author INT UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(id)) DEFA' at line 1" at /client/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 86 {"exception":"[object] (Doctrine\\DBAL\\Exception\\SyntaxErrorException(code: 1064): An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JSON DEFAULT NULL, author INT UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(id)) DEFA' at line 1 at /client/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:86)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1064): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JSON DEFAULT NULL, author INT UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(id)) DEFA' at line 1 at /client/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JSON DEFAULT NULL, author INT UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(id)) DEFA' at line 1 at /client/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:32)"} []
[2023-03-20T15:49:11.469160+00:00] request.INFO: Matched route "contao_install". {"route":"contao_install","route_parameters":{"_route":"contao_install","_scope":"backend","_token_check":true,"_controller":"Contao\\InstallationBundle\\Controller\\InstallationController::installAction"},"request_uri":"https://domain.abc/contao/install","method":"GET"} []
[2023-03-20T15:49:12.105373+00:00] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception: "Unknown database type json requested, Doctrine\DBAL\Platforms\MySQLPlatform may not support it." at /client/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php line 441 {"exception":"[object] (Doctrine\\DBAL\\Exception(code: 0): Unknown database type json requested, Doctrine\\DBAL\\Platforms\\MySQLPlatform may not support it. at /client/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php:441)"} [] 
veronikaplenta commented 1 year ago

@denniserdmann Is your Database Server Version (in .env, parameters.yml or similar) set to below 5.7?

denniserdmann commented 1 year ago

No, i'm using the default version. Here's my .env.local:

DATABASE_URL=mysql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}

Seems like JSON was introduced in MariaDB 10.2.7: https://mariadb.com/kb/en/json-data-type/