After upgrading to 20.0.0, the Talk app doesn’t show my rooms/conversations anymore and Nextcloud keeps logging database errors:
SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1
For reference, here’s the full log line with complete backtrace:
Oct 15 01:09:43 cloud1 NextCloud[9218]: {"reqId":"7wxTe7JAfy0YnvsWRcDN","level":3,"time":"2020-10-14 23:09:43.108400","remoteAddr":"0.0.0.0","user":"doobry","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v2/room","message":"{\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\\\"0\\\", \\\"0\\\", 0, \\\"guests\\\", \\\"changelog\\\", \\\"- Spice up your messages with emojis from the emoji picker \\\\ud83d\\\\ude0d\\\", \\\"comment\\\", \\\"2020-10-14 23:09:43\\\", null, \\\"chat\\\", \\\"380\\\", null]:\\n\\nSQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php\",\"line\":169,\"function\":\"convertException\",\"class\":\"Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver\",\"type\":\"->\",\"args\":[\"An exception occurred while executing 'INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\\\"0\\\", \\\"0\\\", 0, \\\"guests\\\", \\\"changelog\\\", \\\"- Spice up your messages with emojis from the emoji picker \\\\ud83d\\\\ude0d\\\", \\\"comment\\\", \\\"2020-10-14 23:09:43\\\", null, \\\"chat\\\", \\\"380\\\", null]:\\n\\nSQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\",{\"errorInfo\":[\"22007\",1366,\"Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\"],\"__class__\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDOException\"}]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php\",\"line\":149,\"function\":\"wrapException\",\"class\":\"Doctrine\\\\DBAL\\\\DBALException\",\"type\":\"0:0:0:0:0:0:0:0\",\"args\":[{\"__class__\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver\"},{\"errorInfo\":[\"22007\",1366,\"Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\"],\"__class__\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDOException\"},\"An exception occurred while executing 'INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [\\\"0\\\", \\\"0\\\", 0, \\\"guests\\\", \\\"changelog\\\", \\\"- Spice up your messages with emojis from the emoji picker \\\\ud83d\\\\ude0d\\\", \\\"comment\\\", \\\"2020-10-14 23:09:43\\\", null, \\\"chat\\\", \\\"380\\\", null]:\\n\\nSQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\"]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php\",\"line\":1071,\"function\":\"driverExceptionDuringQuery\",\"class\":\"Doctrine\\\\DBAL\\\\DBALException\",\"type\":\"0:0:0:0:0:0:0:0\",\"args\":[{\"__class__\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver\"},{\"errorInfo\":[\"22007\",1366,\"Incorrect string value: '\\\\xF0\\\\x9F\\\\x98\\\\x8D' for column `nextcloud`.`comments`.`message` at row 1\"],\"__class__\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDOException\"},\"INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",{\"1\":\"0\",\"2\":\"0\",\"3\":0,\"4\":\"guests\",\"5\":\"changelog\",\"6\":\"- Spice up your messages with emojis from the emoji picker \\ud83d\\ude0d\",\"7\":\"comment\",\"8\":\"2020-10-14 23:09:43\",\"9\":null,\"10\":\"chat\",\"11\":\"380\",\"12\":null}]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/lib/private/DB/Connection.php\",\"line\":214,\"function\":\"executeUpdate\",\"class\":\"Doctrine\\\\DBAL\\\\Connection\",\"type\":\"->\",\"args\":[\"INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",[\"0\",\"0\",0,\"guests\",\"changelog\",\"- Spice up your messages with emojis from the emoji picker \\ud83d\\ude0d\",\"comment\",{\"date\":\"2020-10-14 23:09:43.106097\",\"timezone_type\":3,\"timezone\":\"UTC\",\"__class__\":\"DateTime\"},null,\"chat\",\"380\",null],[2,2,2,2,2,2,2,\"datetime\",\"datetime\",2,2,2]]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php\",\"line\":209,\"function\":\"executeUpdate\",\"class\":\"OC\\\\DB\\\\Connection\",\"type\":\"->\",\"args\":[\"INSERT INTO `comments` (`parent_id`, `topmost_parent_id`, `children_count`, `actor_type`, `actor_id`, `message`, `verb`, `creation_timestamp`, `latest_child_timestamp`, `object_type`, `object_id`, `reference_id`) VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4, :dcValue5, :dcValue6, :dcValue7, :dcValue8, :dcValue9, :dcValue10, :dcValue11, :dcValue12)\",{\"dcValue1\":\"0\",\"dcValue2\":\"0\",\"dcValue3\":0,\"dcValue4\":\"guests\",\"dcValue5\":\"changelog\",\"dcValue6\":\"- Spice up your messages with emojis from the emoji picker \\ud83d\\ude0d\",\"dcValue7\":\"comment\",\"dcValue8\":{\"date\":\"2020-10-14 23:09:43.106097\",\"timezone_type\":3,\"timezone\":\"UTC\",\"__class__\":\"DateTime\"},\"dcValue9\":null,\"dcValue10\":\"chat\",\"dcValue11\":\"380\",\"dcValue12\":null},{\"dcValue1\":2,\"dcValue2\":2,\"dcValue3\":2,\"dcValue4\":2,\"dcValue5\":2,\"dcValue6\":2,\"dcValue7\":2,\"dcValue8\":\"datetime\",\"dcValue9\":\"datetime\",\"dcValue10\":2,\"dcValue11\":2,\"dcValue12\":2}]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/lib/private/DB/QueryBuilder/QueryBuilder.php\",\"line\":217,\"function\":\"execute\",\"class\":\"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/lib/private/Comments/Manager.php\",\"line\":786,\"function\":\"execute\",\"class\":\"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/lib/private/Comments/Manager.php\",\"line\":749,\"function\":\"insertQuery\",\"class\":\"OC\\\\Comments\\\\Manager\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Comments\\\\Comment\"},true]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/lib/private/Comments/Manager.php\",\"line\":725,\"function\":\"insert\",\"class\":\"OC\\\\Comments\\\\Manager\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Comments\\\\Comment\"}]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/apps/spreed/lib/Chat/ChatManager.php\",\"line\":151,\"function\":\"save\",\"class\":\"OC\\\\Comments\\\\Manager\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Comments\\\\Comment\"}]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/apps/spreed/lib/Chat/Changelog/Manager.php\",\"line\":80,\"function\":\"addChangelogMessage\",\"class\":\"OCA\\\\Talk\\\\Chat\\\\ChatManager\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Talk\\\\Room\"},\"- Spice up your messages with emojis from the emoji picker \\ud83d\\ude0d\"]},{\"file\":\"/var/www/cloud.example.org/nextcloud-20.0.0/apps/spreed/
Is anybody else hit by this issue? First, I thought that it was due to missing utf8mb4
encoding in my database, but I thoroughly checked https://docs.nextcloud.com/server/20/admin_manual/configuration_database/mysql_4byte_support.html and verified that it’s enabled on our Nextcloud instance. We have MariaDB 10.3 as database backend and the table collation is utf8mb4_bin
for all Nextcloud DB tables:
MariaDB [nextcloud]> SELECT table_schema, table_name, table_collation FROM information_schema.tables WHERE table_schema='nextcloud';
+--------------+----------------------------------------+-----------------+
| table_schema | table_name | table_collation |
+--------------+----------------------------------------+-----------------+
| nextcloud | comments | utf8mb4_bin |
| nextcloud | filecache | utf8mb4_bin |
| nextcloud | users | utf8mb4_bin |
| nextcloud | groups | utf8mb4_bin |
| nextcloud | preferences | utf8mb4_bin |
| nextcloud | properties | utf8mb4_bin |
| nextcloud | talk_bridges | utf8mb4_bin |
| nextcloud | talk_guests | utf8mb4_bin |
| nextcloud | talk_participants | utf8mb4_bin |
| nextcloud | talk_signaling | utf8mb4_bin |
| nextcloud | talk_rooms | utf8mb4_bin |
| nextcloud | talk_commands | utf8mb4_bin |
[...]
+--------------+----------------------------------------+-----------------+
Any idea how to fix this?