Devices Fell Offline - Please Help

Not sure what is going on but all of my devices fell offline today. I have 180 devices in my HA which work consistently. Woke up this morning to all sorts of messages saying they were unavailable. I am running the latest version of version .101.2 . I tried going back to my last backup with but that didn’t work. I have also tried removing devices and now they won’t re-pair. I have a separate system running smart things and tried pairing a few of these devices to smart things and it worked perfectly fine.

Note: most devices are samsung sensors that went offline.

Any ideas? I really don’t want to re-build a system with 180 devices…

Can you show your home assistant logs please?

I am getting these every couple of minutes:
2019-11-03 16:56:56 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=26 from 2019-11-03 21:54:25.779806)
2019-11-03 16:57:15 ERROR (MainThread) [homeassistant.setup] Setup failed for alert: Integration failed to initialize.
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder.util] 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: (‘service_registered’, ‘{“domain”: “recorder”, “service”: “purge”}’, ‘LOCAL’, ‘2019-11-03 21:56:56.762839’, ‘2019-11-03 21:57:20.513272’, ‘743f93d1d2e04baf9cfd74782fa4bec5’, None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder] Error saving event: <Event service_registered[L]: domain=recorder, service=purge>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 580, in do_execute
cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed

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

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/recorder/init.py”, line 348, in run
session.flush()
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2470, in flush
self._flush(objects)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2608, in _flush
transaction.rollback(_capture_exception=True)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 68, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 153, in reraise
raise value
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2568, in _flush
flush_context.execute()
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py”, line 422, in execute
rec.execute(self)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py”, line 589, in execute
uow,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py”, line 245, in save_obj
insert,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py”, line 1137, in _emit_insert_statements
statement, params
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 988, in execute
return meth(self, multiparams, params)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1107, in _execute_clauseelement
distilled_params,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1253, in _execute_context
e, statement, parameters, cursor, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1473, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise
raise value.with_traceback(tb)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 580, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (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: (‘service_registered’, ‘{“domain”: “recorder”, “service”: “purge”}’, ‘LOCAL’, ‘2019-11-03 21:56:56.762839’, ‘2019-11-03 21:57:20.513272’, ‘743f93d1d2e04baf9cfd74782fa4bec5’, None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder.util] 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: (‘component_loaded’, ‘{“component”: “recorder”}’, ‘LOCAL’, ‘2019-11-03 21:56:56.944397’, ‘2019-11-03 21:57:20.618535’, ‘e2859a5ad6164e608798baa45a8e2f96’, None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder] Error saving event: <Event component_loaded[L]: component=recorder>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 580, in do_execute
cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed

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

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/recorder/init.py”, line 348, in run
session.flush()
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2470, in flush
self._flush(objects)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2608, in _flush
transaction.rollback(_capture_exception=True)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 68, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 153, in reraise
raise value
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/session.py”, line 2568, in _flush
flush_context.execute()
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py”, line 422, in execute
rec.execute(self)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/unitofwork.py”, line 589, in execute
uow,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py”, line 245, in save_obj
insert,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py”, line 1137, in _emit_insert_statements
statement, params
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 988, in execute
return meth(self, multiparams, params)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1107, in _execute_clauseelement
distilled_params,
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1253, in _execute_context
e, statement, parameters, cursor, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1473, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise
raise value.with_traceback(tb)
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 580, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (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: (‘component_loaded’, ‘{“component”: “recorder”}’, ‘LOCAL’, ‘2019-11-03 21:56:56.944397’, ‘2019-11-03 21:57:20.618535’, ‘e2859a5ad6164e608798baa45a8e2f96’, None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder.util] 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”: “sun.sun”, “old_state”: null, “new_state”: {“entity_id”: “sun.sun”, “state”: “above_horizon”, “attributes”: {“next_dawn”: “2019-11-04T1 … (361 characters truncated) … :00”, “last_updated”: “2019-11-03T21:56:57.025806+00:00”, “context”: {“id”: “03012049e1ea488cb5d0167ce51d6624”, “parent_id”: null, “user_id”: null}}}’, ‘LOCAL’, ‘2019-11-03 21:56:57.025863’, ‘2019-11-03 21:57:20.635405’, ‘03012049e1ea488cb5d0167ce51d6624’, None)]
(Background on this error at: http://sqlalche.me/e/4xp6)
2019-11-03 16:57:20 ERROR (Recorder) [homeassistant.components.recorder] Error saving event: <Event state_changed[L]: entity_id=sun.sun, old_state=None, new_state=<state sun.sun=above_horizon; next_dawn=2019-11-04T11:19:40+00:00, next_dusk=2019-11-03T22:54:58+00:00, next_midnight=2019-11-04T05:06:52+00:00, next_noon=2019-11-04T17:06:52+00:00, next_rising=2019-11-04T11:46:01+00:00, next_setting=2019-11-03T22:28:40+00:00, elevation=4.91, azimuth=247.28, rising=False, friendly_name=Sun @ 2019-11-03T16:56:57.025806-05:00>>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
cursor, statement, parameters, context
File “/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 580, in do_execute
cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed

These errors are because of you database. I’m assuming when creating the backup it wasn’t a clean backup of the db. Try removing your database file and restarting home assistant.

Thanks, I tried removing the database which didn’t work. I now also tried re-flashing my entire HA image to a new SD card. This brought back about half of the devices. The other half of devices still won’t connect.

One more piece of information which I think may help. These are the errors coming up when I try to re-add a device. Does this mean my zigbee coordinator (HUSBZB-1) blew up?

[0x0000:zdo] ZDO request 0x0036: [60, <Bool.false: 0>]
[0xf09c] Delivery error for seq # 0x0d, on endpoint id 0 cluster 0x0021: message send failure
[0xf09c:1:0x0000]: Failed to bind ‘basic’ cluster: [0xf09c:0:0x0021]: Message send failure
[0xf09c:1:0x0000]: finished channel configuration
[0xf09c] Extending timeout for 0x15 request
[0xf09c] Delivery error for seq # 0x0f, on endpoint id 0 cluster 0x0021: message send failure
[0xf09c:1:0x0001]: Failed to bind ‘power’ cluster: [0xf09c:0:0x0021]: Message send failure
[0xf09c] Extending timeout for 0x17 request
[0xf09c] Delivery error for seq # 0x11, on endpoint id 0 cluster 0x0021: message send failure
[0xf09c:1:0x0402]: Failed to bind ‘temperature’ cluster: [0xf09c:0:0x0021]: Message send failure
[0xf09c] Extending timeout for 0x19 request
[0xf09c] Delivery error for seq # 0x15, on endpoint id 1 cluster 0x0000: message send failure
[0xf09c:1:0x0000]: initializing channel: from_cache: False
[0xf09c:1:0x0000]: channel: ‘async_configure’ stage succeeded
[0xf09c:1:0x0500]: started IASZoneChannel configuration
[0xf09c] Extending timeout for 0x1b request
[0xf09c] Delivery error for seq # 0x17, on endpoint id 1 cluster 0x0001: message send failure
[0xf09c:1:0x0001]: failed to set reporting for ‘battery_voltage’ attr on ‘power’ cluster: [0xf09c:1:0x0001]: Message send failure
[0xf09c] Delivery error for seq # 0x19, on endpoint id 1 cluster 0x0402: message send failure
[0xf09c:1:0x0402]: failed to set reporting for ‘measured_value’ attr on ‘temperature’ cluster: [0xf09c:1:0x0402]: Message send failure
[0xf09c:1:0x0402]: finished channel configuration
[0xf09c:1:0x0402]: channel: ‘async_configure’ stage succeeded
[0xf09c] Extending timeout for 0x1d request
[0x0000:zdo] Unsupported ZDO cluster id 0x8038
[0x0000:zdo] Unknown ZDO cluster 0x8038
[0x0000:zdo] ZDO request 32824: b’\x00\x00\xf8\xff\x07\x14\x00\x14\x00\x10\xb8\x9f\xb8\xca\xc1\xba\xd1\xc2\x9e\xc8\xb7\xba\xb9\xbd\xc8\x9e’
[0x0000:zdo] Unsupported ZDO request:32824
[0xf09c] Delivery error for seq # 0x1b, on endpoint id 0 cluster 0x0021: message send failure
[0xf09c:1:0x0500]: Failed to bind ‘ias_zone’ cluster: [0xf09c:0:0x0021]: Message send failure
[0xf09c] Extending timeout for 0x1f request
[0xf09c] Delivery error for seq # 0x1d, on endpoint id 1 cluster 0x0001: message send failure
[0xf09c:1:0x0001]: failed to set reporting for ‘battery_percentage_remaining’ attr on ‘power’ cluster: [0xf09c:1:0x0001]: Message send failure