started to get db errors thats crashing my instance. something about "Incorrect string value: '\\xF0\\x93\\x86\\x9A\\xF0\\x93...' for column
hass.
statistics_meta.
name` - my db is set to utf16
2023-02-15T15:29:58.863656782Z 2023-02-15 10:29:58.862 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (pymysql.err.DataError) (1366, "Incorrect string value: '\\xF0\\x93\\x86\\x9A\\xF0\\x93...' for column `hass`.`statistics_meta`.`name` at row 1") 2023-02-15T15:29:58.863690852Z [SQL: INSERT INTO statistics_meta (statistic_id, source, unit_of_measurement, has_mean, has_sum, name) VALUES (%(statistic_id)s, %(source)s, %(unit_of_measurement)s, %(has_mean)s, %(has_sum)s, %(name)s)] 2023-02-15T15:29:58.863694247Z [parameters: {'statistic_id': 'recorder.db_test', 'source': 'recorder', 'unit_of_measurement': None, 'has_mean': 1, 'has_sum': 1, 'name': 'šš'}] 2023-02-15T15:29:58.863697159Z (Background on this error at: https://sqlalche.me/e/14/9h9h) 2023-02-15T15:29:58.871358343Z 2023-02-15 10:29:58.866 ERROR (Recorder) [homeassistant.components.recorder.statistics] Error when validating DB schema: (pymysql.err.DataError) (1366, "Incorrect string value: '\\xF0\\x93\\x86\\x9A\\xF0\\x93...' for column `hass`.`statistics_meta`.`name` at row 1") 2023-02-15T15:29:58.871385685Z [SQL: INSERT INTO statistics_meta (statistic_id, source, unit_of_measurement, has_mean, has_sum, name) VALUES (%(statistic_id)s, %(source)s, %(unit_of_measurement)s, %(has_mean)s, %(has_sum)s, %(name)s)] 2023-02-15T15:29:58.871389338Z [parameters: {'statistic_id': 'recorder.db_test', 'source': 'recorder', 'unit_of_measurement': None, 'has_mean': 1, 'has_sum': 1, 'name': 'šš'}] 2023-02-15T15:29:58.871392168Z (Background on this error at: https://sqlalche.me/e/14/9h9h) 2023-02-15T15:29:58.871394484Z Traceback (most recent call last): 2023-02-15T15:29:58.871396673Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context 2023-02-15T15:29:58.871399005Z self.dialect.do_execute( 2023-02-15T15:29:58.871401139Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute 2023-02-15T15:29:58.871403397Z cursor.execute(statement, parameters) 2023-02-15T15:29:58.871405549Z File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute 2023-02-15T15:29:58.871407765Z result = self._query(query) 2023-02-15T15:29:58.871409870Z File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query 2023-02-15T15:29:58.871412119Z conn.query(q) 2023-02-15T15:29:58.871414224Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query 2023-02-15T15:29:58.871416419Z self._affected_rows = self._read_query_result(unbuffered=unbuffered) 2023-02-15T15:29:58.871418585Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result 2023-02-15T15:29:58.871420818Z result.read() 2023-02-15T15:29:58.871422904Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read 2023-02-15T15:29:58.871425089Z first_packet = self.connection._read_packet() 2023-02-15T15:29:58.871427206Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet 2023-02-15T15:29:58.871429404Z packet.raise_for_error() 2023-02-15T15:29:58.871431511Z File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error 2023-02-15T15:29:58.871441631Z err.raise_mysql_exception(self._data) 2023-02-15T15:29:58.871443997Z File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception 2023-02-15T15:29:58.871447287Z raise errorclass(errno, errval) 2023-02-15T15:29:58.871449457Z pymysql.err.DataError: (1366, "Incorrect string value: '\\xF0\\x93\\x86\\x9A\\xF0\\x93...' for column `hass`.`statistics_meta`.`name` at row 1") 2023-02-15T15:29:58.871451917Z 2023-02-15T15:29:58.871454281Z The above exception was the direct cause of the following exception: 2023-02-15T15:29:58.871456486Z 2023-02-15T15:29:58.871458568Z Traceback (most recent call last): 2023-02-15T15:29:58.871460752Z File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2276, in _validate_db_schema_utf8 2023-02-15T15:29:58.871463098Z _update_or_add_metadata(session, metadata, old_metadata_dict) 2023-02-15T15:29:58.871465270Z File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 369, in _update_or_add_metadata 2023-02-15T15:29:58.871467564Z session.flush() # Flush to get the metadata id assigned 2023-02-15T15:29:58.871469713Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3444, in flush 2023-02-15T15:29:58.871471920Z self._flush(objects) 2023-02-15T15:29:58.871474086Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3583, in _flush 2023-02-15T15:29:58.871476301Z with util.safe_reraise(): 2023-02-15T15:29:58.871478389Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__ 2023-02-15T15:29:58.871480599Z compat.raise_( 2023-02-15T15:29:58.871482719Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 211, in raise_ 2023-02-15T15:29:58.871484924Z raise exception 2023-02-15T15:29:58.871487045Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3544, in _flush 2023-02-15T15:29:58.871489242Z flush_context.execute() 2023-02-15T15:29:58.871491357Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 456, in execute 2023-02-15T15:29:58.871493557Z rec.execute(self) 2023-02-15T15:29:58.871495669Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 630, in execute 2023-02-15T15:29:58.871497858Z util.preloaded.orm_persistence.save_obj( 2023-02-15T15:29:58.871499965Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj 2023-02-15T15:29:58.871502200Z _emit_insert_statements( 2023-02-15T15:29:58.871504318Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 1238, in _emit_insert_statements 2023-02-15T15:29:58.871508720Z result = connection._execute_20( 2023-02-15T15:29:58.871510979Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20 2023-02-15T15:29:58.871513211Z return meth(self, args_10style, kwargs_10style, execution_options) 2023-02-15T15:29:58.871515648Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection 2023-02-15T15:29:58.871517912Z return connection._execute_clauseelement( 2023-02-15T15:29:58.871520035Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement 2023-02-15T15:29:58.871522260Z ret = self._execute_context( 2023-02-15T15:29:58.871524391Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context 2023-02-15T15:29:58.871526612Z self._handle_dbapi_exception( 2023-02-15T15:29:58.871528708Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception 2023-02-15T15:29:58.871530963Z util.raise_( 2023-02-15T15:29:58.871533123Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 211, in raise_ 2023-02-15T15:29:58.871535340Z raise exception 2023-02-15T15:29:58.871537468Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context 2023-02-15T15:29:58.871539686Z self.dialect.do_execute( 2023-02-15T15:29:58.871541847Z File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute 2023-02-15T15:29:58.871544073Z cursor.execute(statement, parameters) 2023-02-15T15:29:58.871546204Z File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute 2023-02-15T15:29:58.871548404Z result = self._query(query) 2023-02-15T15:29:58.871550502Z File "/usr/local/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query 2023-02-15T15:29:58.871552718Z conn.query(q) 2023-02-15T15:29:58.871554828Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query 2023-02-15T15:29:58.871557042Z self._affected_rows = self._read_query_result(unbuffered=unbuffered) 2023-02-15T15:29:58.871559210Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result 2023-02-15T15:29:58.871561441Z result.read() 2023-02-15T15:29:58.871563557Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read 2023-02-15T15:29:58.871565765Z first_packet = self.connection._read_packet() 2023-02-15T15:29:58.871567876Z File "/usr/local/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet 2023-02-15T15:29:58.871570086Z packet.raise_for_error() 2023-02-15T15:29:58.871572184Z File "/usr/local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error 2023-02-15T15:29:58.871576261Z err.raise_mysql_exception(self._data) 2023-02-15T15:29:58.871578450Z File "/usr/local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception 2023-02-15T15:29:58.871580690Z raise errorclass(errno, errval) 2023-02-15T15:29:58.871583283Z sqlalchemy.exc.DataError: (pymysql.err.DataError) (1366, "Incorrect string value: '\\xF0\\x93\\x86\\x9A\\xF0\\x93...' for column `hass`.`statistics_meta`.`name` at row 1") 2023-02-15T15:29:58.871585753Z [SQL: INSERT INTO statistics_meta (statistic_id, source, unit_of_measurement, has_mean, has_sum, name) VALUES (%(statistic_id)s, %(source)s, %(unit_of_measurement)s, %(has_mean)s, %(has_sum)s, %(name)s)] 2023-02-15T15:29:58.871588118Z [parameters: {'statistic_id': 'recorder.db_test', 'source': 'recorder', 'unit_of_measurement': None, 'has_mean': 1, 'has_sum': 1, 'name': 'šš'}] 2023-02-15T15:29:58.871590482Z (Background on this error at: https://sqlalche.me/e/14/9h9h)