Errors in log, how to fix

any idea how to fix this

Error saving event: <Event state_changed[L]: entity_id=sensor.unifi_gateway_www, old_state=<state sensor.unifi_gateway_www=OK; subsystem=www, status=ok, tx_bytes-r=1291, rx_bytes-r=1136, latency=13, uptime=2670, drops=1, xput_up=9.964, xput_down=94.843, speedtest_status=Success, speedtest_lastrun=1582191618, speedtest_ping=11, gw_mac=fc:ec:da:d7:18:f7, friendly_name=UniFi Gateway WWW, icon=mdi:web, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.501551+01:00>, new_state=<state sensor.unifi_gateway_www=OK; subsystem=www, status=ok, tx_bytes-r=958, rx_bytes-r=17198, latency=32, uptime=2732, drops=1, xput_up=9.964, xput_down=94.843, speedtest_status=Success, speedtest_lastrun=1582191618, speedtest_ping=11, gw_mac=fc:ec:da:d7:18:f7, friendly_name=UniFi Gateway WWW, icon=mdi:web, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.501551+01:00>>

21:44 components/recorder/__init__.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{"entity_id": "sensor.unifi_gateway_www", "old_state": {"entity_id": "sensor.unifi_gateway_www", "state": "OK", "attributes": {"subsystem": "www", "s ... (1157 characters truncated) ... :00", "last_updated": "2020-02-22T20:44:33.769774+00:00", "context": {"id": "34dd373ee32a44c588c9c175f843918b", "parent_id": null, "user_id": null}}}', 'LOCAL', '2020-02-22 20:44:33.769841', '2020-02-22 20:44:33.782834', '34dd373ee32a44c588c9c175f843918b', None)] (Background on this error at: http://sqlalche.me/e/4xp6)

21:44 components/recorder/util.py (ERROR)

Error saving event: <Event state_changed[L]: entity_id=sensor.unifi_gateway_lan, old_state=<state sensor.unifi_gateway_lan=OK; subsystem=lan, lan_ip=192.168.99.1, status=ok, num_user=10, num_guest=0, num_iot=0, tx_bytes-r=2750657, rx_bytes-r=2747205, num_sw=1, num_adopted=1, num_disconnected=0, num_pending=0, friendly_name=UniFi Gateway LAN, icon=mdi:lan, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:14.285939+01:00>, new_state=<state sensor.unifi_gateway_lan=OK; subsystem=lan, lan_ip=192.168.99.1, status=ok, num_user=10, num_guest=0, num_iot=0, tx_bytes-r=2240918, rx_bytes-r=2270325, num_sw=1, num_adopted=1, num_disconnected=0, num_pending=0, friendly_name=UniFi Gateway LAN, icon=mdi:lan, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:14.285939+01:00>>

21:44 components/recorder/__init__.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{"entity_id": "sensor.unifi_gateway_lan", "old_state": {"entity_id": "sensor.unifi_gateway_lan", "state": "OK", "attributes": {"subsystem": "lan", "l ... (1059 characters truncated) ... :00", "last_updated": "2020-02-22T20:44:33.737147+00:00", "context": {"id": "306f8ed00d324db295a1d8587723038b", "parent_id": null, "user_id": null}}}', 'LOCAL', '2020-02-22 20:44:33.737273', '2020-02-22 20:44:33.749736', '306f8ed00d324db295a1d8587723038b', None)] (Background on this error at: http://sqlalche.me/e/4xp6)

21:44 components/recorder/util.py (ERROR)

Error saving event: <Event state_changed[L]: entity_id=sensor.unifi_gateway_wan_cpu, old_state=<state sensor.unifi_gateway_wan_cpu=4; unit_of_measurement=percentage, friendly_name=CPU percentage, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:43:31.728494+01:00>, new_state=<state sensor.unifi_gateway_wan_cpu=5; unit_of_measurement=percentage, friendly_name=CPU percentage, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:44:33.109185+01:00>>

21:44 components/recorder/__init__.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{"entity_id": "sensor.unifi_gateway_wan_cpu", "old_state": {"entity_id": "sensor.unifi_gateway_wan_cpu", "state": "4", "attributes": {"unit_of_measur ... (647 characters truncated) ... :00", "last_updated": "2020-02-22T20:44:33.109185+00:00", "context": {"id": "9690b6e616514646bf6106d3cd202bf4", "parent_id": null, "user_id": null}}}', 'LOCAL', '2020-02-22 20:44:33.109247', '2020-02-22 20:44:33.135019', '9690b6e616514646bf6106d3cd202bf4', None)] (Background on this error at: http://sqlalche.me/e/4xp6)

21:44 components/recorder/util.py (ERROR)

Error saving event: <Event state_changed[L]: entity_id=sensor.unifi_gateway_wan, old_state=<state sensor.unifi_gateway_wan=OK; subsystem=wan, num_gw=1, num_adopted=1, num_disconnected=0, num_pending=0, status=ok, wan_ip=94.110.144.45, gateways=['94.110.128.1'], netmask=255.255.224.0, nameservers=['127.0.0.1'], num_sta=22, tx_bytes-r=1291, rx_bytes-r=1136, gw_mac=fc:ec:da:d7:18:f7, gw_name=Unifi USG, gw_system-stats=cpu=4, mem=37, uptime=213324, gw_version=4.4.44.5213844, friendly_name=UniFi Gateway WAN, icon=mdi:shield-outline, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.798473+01:00>, new_state=<state sensor.unifi_gateway_wan=OK; subsystem=wan, num_gw=1, num_adopted=1, num_disconnected=0, num_pending=0, status=ok, wan_ip=94.110.144.45, gateways=['94.110.128.1'], netmask=255.255.224.0, nameservers=['127.0.0.1'], num_sta=22, tx_bytes-r=958, rx_bytes-r=17198, gw_mac=fc:ec:da:d7:18:f7, gw_name=Unifi USG, gw_system-stats=cpu=5, mem=37, uptime=213354, gw_version=4.4.44.5213844, friendly_name=UniFi Gateway WAN, icon=mdi:shield-outline, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.798473+01:00>>

21:44 components/recorder/__init__.py (ERROR)

Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: INSERT INTO events (event_type, event_data, origin, time_fired, created, context_id, context_user_id) VALUES (?, ?, ?, ?, ?, ?, ?)] [parameters: ('state_changed', '{"entity_id": "sensor.unifi_gateway_wan", "old_state": {"entity_id": "sensor.unifi_gateway_wan", "state": "OK", "attributes": {"subsystem": "wan", "n ... (1491 characters truncated) ... :00", "last_updated": "2020-02-22T20:44:33.102259+00:00", "context": {"id": "7a0a084215524fa7b1a246010b2bd243", "parent_id": null, "user_id": null}}}', 'LOCAL', '2020-02-22 20:44:33.102307', '2020-02-22 20:44:33.115641', '7a0a084215524fa7b1a246010b2bd243', None)] (Background on this error at: http://sqlalche.me/e/4xp6)

21:44 components/recorder/util.py (ERROR)

Error saving event: <Event state_changed[L]: entity_id=sensor.unifi_gateway_wlan, old_state=<state sensor.unifi_gateway_wlan=OK; subsystem=wlan, num_user=12, num_guest=0, num_iot=0, tx_bytes-r=1934, rx_bytes-r=3021, status=ok, num_ap=2, num_adopted=2, num_disabled=0, num_disconnected=0, num_pending=0, friendly_name=UniFi Gateway WLAN, icon=mdi:wifi, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.855937+01:00>, new_state=<state sensor.unifi_gateway_wlan=OK; subsystem=wlan, num_user=12, num_guest=0, num_iot=0, tx_bytes-r=32630, rx_bytes-r=3397, status=ok, num_ap=2, num_adopted=2, num_disabled=0, num_disconnected=0, num_pending=0, friendly_name=UniFi Gateway WLAN, icon=mdi:wifi, templates=hs_color=if (state === 'up') return [115,100]; else return [360,100]; @ 2020-02-22T21:34:13.855937+01:00>>

21:44 components/recorder/__init__.py (ERROR)

Tried deleting your home-assistant_v2.db file and restarting?

yeah its gone
thx

1 Like