Cannot Access Front End (Because I did something foolish)

As a total newbie/lover of HA. I must have done something to cause an issue because I cannot access the front end (only CLI and SMB). Here are the relevant logs if someone can help interpret them:

2021-07-23 14:16:59 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration unifiprotect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-23 14:16:59 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-23 14:16:59 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration smartweather which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-23 14:16:59 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration fordpass which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-23 14:16:59 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hubitat which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-23 14:17:02 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2021-07-23 14:17:02 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=56 from 2021-07-23 17:32:44.427217)
2021-07-23 14:17:02 ERROR (SyncWorker_0) [homeassistant.util.json] Could not parse JSON content: /config/.storage/core.device_registry
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 32, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2021-07-23 14:17:02 ERROR (MainThread) [root] Uncaught exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 32, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 322, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 314, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 108, in run
    return asyncio.run(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/src/homeassistant/homeassistant/runner.py", line 94, in setup_and_run_hass
    hass = await bootstrap.async_setup_hass(runtime_config)
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 129, in async_setup_hass
    await async_from_config_dict(config_dict, hass) is not None
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 239, in async_from_config_dict
    await _async_set_up_integrations(hass, config)
  File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 531, in _async_set_up_integrations
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 633, in async_load
    await hass.data[DATA_REGISTRY].async_load()
  File "/usr/src/homeassistant/homeassistant/helpers/device_registry.py", line 486, in async_load
    data = await self._store.async_load()
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 108, in async_load
    return await self._load_task
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 113, in _async_load
    return await self._async_load_data()
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 127, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 38, in load_json
    raise HomeAssistantError(error) from error
homeassistant.exceptions.HomeAssistantError: Expecting value: line 1 column 1 (char 0)

The error message seems to indicate that the file .storage/core.device_registry does not contain valid JSON.

As a newbie I have no idea how to resolve that particular issue.

Restore from last known good snapshot.

Did you actually try to edit that device_registry file manually?

If so, “As a newbie” I would recommend you don’t do that anymore. :wink:

1 Like

How do you do this from the CLI?