Cannot insert Thai characters as tags into UTF-8 PostgreSQL db

Hello!

I’ve recently started encountering an error when an app (recognize) tried to insert a tag with Thai characters into my UTF-8 encoded Postgres DB: พระที่นั่งอาภรณ์ภิโมกข์ปราสาท. I initially opened this issue in the app’s repo, but it’s actually nextcloud related as I also cannot manually tag a file with the mentionned tag and get the same error message.

The error message is:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[22021]: Character not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0xe0 CONTEXT: unnamed portal parameter $1

I checked that the Postgres db was indeed set to UTF-8 which it is,

nextclouddb=# \l
                                               List of databases
    Name     |   Owner   | Encoding  | Collate | Ctype | ICU Locale | Locale Provider |    Access privileges    
-------------+-----------+-----------+---------+-------+------------+-----------------+-------------------------
 nextclouddb | nextcloud | UTF8      | C       | C     |            | libc            | nextcloud=CTc/nextcloud+
             |           |           |         |       |            |                 | root=CTc/nextcloud

Browsing a little bit through issues and stackoverflow threads, it would seem that the collate setting of the db could be the culprit here? What would be the course of action to address this?
Thanks for any help! :slight_smile:

Debug logs:

{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"CLI cron call has selected job with ID 42828","userAgent":"--","version":"26.0.1.1","data":{"app":"cron"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob job with ID 42828","userAgent":"--","version":"26.0.1.1","data":{"app":"cron"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifying files of storage 3 using landmarks","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"fetching 15 files from landmarks queue","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Running landmarks classifier","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221197 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221197 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221198 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221198 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221199 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221199 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221253 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221253 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221262 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221262 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221271 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221271 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221162 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:02+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221162 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221165 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221165 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221168 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221168 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221173 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221173 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221176 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221176 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221178 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221178 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221189 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221189 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221191 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221191 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"generating preview of 221194 with dimension 1024","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Copying 221194 preview to tempfolder","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifying array (\n  0 => '/tmp/oc_tmp_SrMIl3-.jpg',\n  1 => '/tmp/oc_tmp_a42js3-.jpg',\n  2 => '/tmp/oc_tmp_XYj4F3-.jpg',\n  3 => '/tmp/oc_tmp_VTBoA3-.jpg',\n  4 => '/tmp/oc_tmp_yxOuC2-.jpg',\n  5 => '/tmp/oc_tmp_z4eXP1-.jpg',\n  6 => '/tmp/oc_tmp_ZxM9d1-.jpg',\n  7 => '/tmp/oc_tmp_C7lRx1-.jpg',\n  8 => '/tmp/oc_tmp_4cSl93-.jpg',\n  9 => '/tmp/oc_tmp_tXu3O0-.jpg',\n  10 => '/tmp/oc_tmp_RfOQn3-.jpg',\n  11 => '/tmp/oc_tmp_U7KF22-.jpg',\n  12 => '/tmp/oc_tmp_VGytl4-.jpg',\n  13 => '/tmp/oc_tmp_LkGYf0-.jpg',\n  14 => '/tmp/oc_tmp_wQBqR3-.jpg',\n)","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:03+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Running array (\n  0 => '/var/www/nextcloud/apps/recognize/bin/node',\n  1 => '/var/www/nextcloud/apps/recognize/src/classifier_landmarks.js',\n  2 => '-',\n)","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":0,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Json","userAgent":"--","version":"26.0.1.1","data":{"app":"news"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":0,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Atom","userAgent":"--","version":"26.0.1.1","data":{"app":"news"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":0,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rss","userAgent":"--","version":"26.0.1.1","data":{"app":"news"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":0,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rdf","userAgent":"--","version":"26.0.1.1","data":{"app":"news"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":1,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"related_resources","method":"","url":"--","message":"Could not resolve OCA\\Circles\\CirclesManager! Class \"OCA\\Circles\\CirclesManager\" does not exist","userAgent":"--","version":"26.0.1.1","data":{"app":"related_resources"}}
{"reqId":"dse0golq5OZOgBHDBWRU","level":0,"time":"2023-05-24T15:30:04+00:00","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"SystemConfig\" is deprecated. Please request \"OC\\SystemConfig\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"26.0.1.1","data":{"app":"serverDI"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:05+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifier process output: 2023-05-24 15:30:05.420219: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:05+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifier process output: 2023-05-24 15:30:05.456464: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX_VNNI FMA\nTo enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:42+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifier process output: /tmp/oc_tmp_SrMIl3-.jpg\n","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:42+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Classifier process output: [\n  {\n    className: '\u0e1e\u0e23\u0e30\u0e17\u0e35\u0e48\u0e19\u0e31\u0e48\u0e07\u0e2d\u0e32\u0e20\u0e23\u0e13\u0e4c\u0e20\u0e34\u0e42\u0e21\u0e01\u0e02\u0e4c\u0e1b\u0e23\u0e32\u0e2a\u0e32\u0e17',\n    probability: 0.925463855266571\n  },\n  { className: 'Wat Yannawa', probability: 0.9179216623306274 },\n  { className: 'Royal Palace', probability: 0.9089600443840027 }\n]\n","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":0,"time":"2023-05-24T15:30:42+00:00","remoteAddr":"","user":"--","app":"recognize","method":"","url":"--","message":"Result for /redacted_user/Image00163.jpg(oc_tmp_SrMIl3-.jpg) = [\"landmark\",\"\u0e1e\u0e23\u0e30\u0e17\u0e35\u0e48\u0e19\u0e31\u0e48\u0e07\u0e2d\u0e32\u0e20\u0e23\u0e13\u0e4c\u0e20\u0e34\u0e42\u0e21\u0e01\u0e02\u0e4c\u0e1b\u0e23\u0e32\u0e2a\u0e32\u0e17\"]","userAgent":"--","version":"26.0.1.1","data":{"app":"recognize"}}
{"reqId":"vqEhDFzkuPlUH1TvlvfG","level":3,"time":"2023-05-24T15:30:42+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob, arguments: Array\n(\n    [storageId] => 3\n    [rootId] => 200342\n)\n)","userAgent":"--","version":"26.0.1.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[22021]: Character not in repertoire: 7 ERROR:  invalid byte sequence for encoding \"UTF8\": 0xe0\nCONTEXT:  unnamed portal parameter $1","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1814,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1749,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1163,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":297,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/SystemTag/SystemTagManager.php","line":207,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":33,"function":"createTag","class":"OC\\SystemTag\\SystemTagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":71,"function":"getTag","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"function":"OCA\\Recognize\\Service\\{closure}","class":"OCA\\Recognize\\Service\\TagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":70,"function":"array_map"},{"file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/LandmarksClassifier.php","line":46,"function":"assignTags","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":41,"function":"classify","class":"OCA\\Recognize\\Classifiers\\Images\\LandmarksClassifier","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php","line":70,"function":"classify","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":33,"function":"runClassifier","class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":78,"function":"run","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":103,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":93,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":91,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[22021]: Character not in repertoire: 7 ERROR:  invalid byte sequence for encoding \"UTF8\": 0xe0\nCONTEXT:  unnamed portal parameter $1","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":103,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1153,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":297,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/SystemTag/SystemTagManager.php","line":207,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":33,"function":"createTag","class":"OC\\SystemTag\\SystemTagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":71,"function":"getTag","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"function":"OCA\\Recognize\\Service\\{closure}","class":"OCA\\Recognize\\Service\\TagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":70,"function":"array_map"},{"file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/LandmarksClassifier.php","line":46,"function":"assignTags","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":41,"function":"classify","class":"OCA\\Recognize\\Classifiers\\Images\\LandmarksClassifier","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php","line":70,"function":"classify","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":33,"function":"runClassifier","class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":78,"function":"run","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":103,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":93,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":30,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[22021]: Character not in repertoire: 7 ERROR:  invalid byte sequence for encoding \"UTF8\": 0xe0\nCONTEXT:  unnamed portal parameter $1","Code":"22021","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":101,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1153,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":297,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":354,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/SystemTag/SystemTagManager.php","line":207,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":33,"function":"createTag","class":"OC\\SystemTag\\SystemTagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":71,"function":"getTag","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"function":"OCA\\Recognize\\Service\\{closure}","class":"OCA\\Recognize\\Service\\TagManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/recognize/lib/Service/TagManager.php","line":70,"function":"array_map"},{"file":"/var/www/nextcloud/apps/recognize/lib/Classifiers/Images/LandmarksClassifier.php","line":46,"function":"assignTags","class":"OCA\\Recognize\\Service\\TagManager","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":41,"function":"classify","class":"OCA\\Recognize\\Classifiers\\Images\\LandmarksClassifier","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifierJob.php","line":70,"function":"classify","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/apps/recognize/lib/BackgroundJobs/ClassifyLandmarksJob.php","line":33,"function":"runClassifier","class":"OCA\\Recognize\\BackgroundJobs\\ClassifierJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":78,"function":"run","class":"OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":103,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":93,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":101}},"message":"Error while running background job (class: OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob, arguments: Array\n(\n    [storageId] => 3\n    [rootId] => 200342\n)\n)","exception":{},"CustomMessage":"Error while running background job (class: OCA\\Recognize\\BackgroundJobs\\ClassifyLandmarksJob, arguments: Array\n(\n    [storageId] => 3\n    [rootId] => 200342\n)\n)"}}

DId you get it working?
I’ve faced exactly same problem, also with Recognize trying to apply tags, I guess with Thai characters as some pics were taken in Thailand and it must have recognized some landmarks.

Thanks for help!