『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1081|回复: 1

[求助] mariadb一直报错,向大神求解

[复制链接]

1

主题

64

帖子

642

积分

高级会员

Rank: 4

积分
642
金钱
578
HASS币
0
发表于 2021-7-12 12:25:09 | 显示全部楼层 |阅读模式
一部荣耀honorX2旧手机安装termux v0.73搭建的homeassistant core,更换了mariadb数据库之后一直有报错,本人小白,网上找到处理办法似乎都没能解决,求大神帮助,以下是错误日志。

Logger: homeassistant.components.recorder
Source: components/recorder/__init__.py:709
Integration: Recorder (documentation, issues)
First occurred: 下午12:18:59 (1 occurrences)
Last logged: 下午12:18:59

Unhandled database error while processing event <Event time_changed[L]: now=2021-07-12T12:18:49.145690+08:00>: (pymysql.err.DataError) (1366, "Incorrect string value: '\\xE5\\xB7\\xA9\\xE5\\x8D\\x8E...' for column `hass`.`states`.`state` at row 1") [SQL: INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, old_state_id) VALUES (%(domain)s, %(entity_id)s, %(state)s, %(attributes)s, %(event_id)s, %(last_changed)s, %(last_updated)s, %(created)s, %(old_state_id)s)] [parameters: {'domain': 'person', 'entity_id': 'person.will_su', 'state': '这里是七个汉字', 'attributes': '{"editable": false, "id": "will_su", "latitude": 40.115659592109644, "longitude": 116.25153535981373, "gps_accuracy": 65.0, "source": "person.will_su ... (7 characters truncated) ... r_id": "b7caa23bc5434269a902983f7f0774fa", "friendly_name": "Will.Su", "entity_picture": "/api/image/serve/e2666c31b609779b0fe7d705496a3997/512x512"}', 'event_id': 1366696, 'last_changed': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'last_updated': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'created': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'old_state_id': None}] (Background on this error at: http://sqlalche.me/e/14/9h9h)
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1770, in _execute_context
    self.dialect.do_execute(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.DataError: (1366, "Incorrect string value: '\\xE5\\xB7\\xA9\\xE5\\x8D\\x8E...' for column `hass`.`states`.`state` at row 1")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/components/recorder/__init__.py", line 534, in _process_one_event_or_recover
    self._process_one_event(event)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/components/recorder/__init__.py", line 627, in _process_one_event
    self._commit_event_session_or_retry()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/components/recorder/__init__.py", line 690, in _commit_event_session_or_retry
    self._commit_event_session()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/components/recorder/__init__.py", line 709, in _commit_event_session
    self.event_session.flush()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3286, in flush
    self._flush(objects)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3426, in _flush
    transaction.rollback(_capture_exception=True)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    compat.raise_(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
    raise exception
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 3386, in _flush
    flush_context.execute()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 453, in execute
    n.execute_aggregate(self, set_)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 747, in execute_aggregate
    persistence.save_obj(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 242, in save_obj
    _emit_insert_statements(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 1219, in _emit_insert_statements
    result = connection._execute_20(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1582, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 324, in _execute_on_connection
    return connection._execute_clauseelement(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1451, in _execute_clauseelement
    ret = self._execute_context(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1813, in _execute_context
    self._handle_dbapi_exception(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1994, in _handle_dbapi_exception
    util.raise_(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
    raise exception
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1770, in _execute_context
    self.dialect.do_execute(
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1366, "Incorrect string value: '\\xE5\\xB7\\xA9\\xE5\\x8D\\x8E...' for column `hass`.`states`.`state` at row 1")
[SQL: INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, old_state_id) VALUES (%(domain)s, %(entity_id)s, %(state)s, %(attributes)s, %(event_id)s, %(last_changed)s, %(last_updated)s, %(created)s, %(old_state_id)s)]
[parameters: {'domain': 'person', 'entity_id': 'person.will_su', 'state': '这里是七个汉字', 'attributes': '{"editable": false, "id": "will_su", "latitude": 40.115659592109644, "longitude": 116.25153535981373, "gps_accuracy": 65.0, "source": "person.will_su ... (7 characters truncated) ... r_id": "b7caa23bc5434269a902983f7f0774fa", "friendly_name": "Will.Su", "entity_picture": "/api/image/serve/e2666c31b609779b0fe7d705496a3997/512x512"}', 'event_id': 1366696, 'last_changed': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'last_updated': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'created': datetime.datetime(2021, 7, 12, 4, 17, 18, 686115, tzinfo=datetime.timezone.utc), 'old_state_id': None}]
(Background on this error at: http://sqlalche.me/e/14/9h9h)


回复

使用道具 举报

1

主题

64

帖子

642

积分

高级会员

Rank: 4

积分
642
金钱
578
HASS币
0
 楼主| 发表于 2021-7-24 14:13:10 | 显示全部楼层
哪位大神能帮忙看看吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 15:34 , Processed in 0.105444 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表