Cannot connect to web GUI but SSH is working?

Hello there!

I just restarted my RP4 with HA after what I thought was a pretty minor configuration change and I am now unable to connect to the web GUI, funnily enough I can SSH into it and i can see it in the connected devices in my network, I do have a few warning in my log, where should I look to identify what the issue is?
I have tried connecting to both hassio.local:8123 as well as https://192.168.0.xxx:8123/ with no luck.

If I SSH and run ‘hassio homeassistant logs’ I can see the following warning messages:

2019-12-30 17:11:33 WARNING (MainThread) [homeassistant.setup] Setup of person is taking over 10 seconds.
2019-12-30 17:11:34 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2019-12-30 17:11:34 WARNING (MainThread) [homeassistant.components.scene] Setup of platform homeassistant is taking over 10 seconds.
2019-12-30 17:11:34 WARNING (MainThread) [homeassistant.components.weather] Setup of platform met is taking over 10 seconds.
2019-12-30 17:11:34 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform updater is taking over 10 seconds.
2019-12-30 17:11:35 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.upnp
2019-12-30 17:11:35 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform mobile_app is taking over 10 seconds.
2019-12-30 17:11:35 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform mobile_app is taking over 10 seconds.
2019-12-30 17:11:35 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform tradfri is taking over 10 seconds.
2019-12-30 17:11:45 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform upnp is taking over 10 seconds.

If I run ‘hassio supervisor logs’ I notice the following warning message but not sure where to look to fix this:

19-12-30 17:21:00 INFO (MainThread) [hassio.api.security] /supervisor/logs access from core_ssh

19-12-30 17:21:15 WARNING (MainThread) [hassio.homeassistant] Don't wait anymore of Home Assistant startup!

Any help would be massively appreciated! I’d hate to have to start from scratch again!
learning how to make backups was on my list… I don’t currently have any… :open_mouth:

Hmm difficult to say from the logs you posted. Can you please post the full log file, it is available in this directory: /usr/share/hassio/homeassistant/homeassistant.log

Click on hass.io in the sidebar and then snapshot on the top and there you have the backups functionality.

First of all, you don’t have to restart your RbPi after configuration changes, just restart HA.
Maybe post your configuration.yaml here, so we can have a look.

And the lesson here is to always do a “check config” before you restart after making a config change. “a change is a change no matter how small” (OK I might have modified the wording a bit).

It’s way easier to see where the errors are and fix them in that way than to try to figure it out later and restart/reboot HA.

1 Like

@finity ndeed! I did think I did it but clearly something was wrong… :confused: not making that mistake again!

1 Like

@francisp I did restart HA that way, sorry I didn’t explain myself properly there.

I apologise for the question but I’m pretty new when it comes to SSH and command line, I can navigate to the location of the yaml file but I have no idea on how to open it/download it…

I would say :
nano /usr/share/hassio/homeassistant/homeassistant.log
but I don’t know if nano is available on hassos.

annoyingly I don’t seem to have a “hassio” folder in “usr/share/”, any idea why that would be?
I did find a log file called home-assistant.log in /config, is it helpful?

2019-12-30 17:47:53 ERROR (SyncWorker_16) [homeassistant.util.json] Could not parse JSON content: /config/.storage/core.entity_registry
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 31, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 298 column 17 (char 13141)
2019-12-30 17:47:53 ERROR (MainThread) [homeassistant.core] Error doing job: _GatheringFuture exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 31, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 298 column 17 (char 13141)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 383, in async_get_registry
    await reg.async_load()
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 320, in async_load
    old_conf_migrate_func=_async_migrate,
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 46, in async_migrator
    return await store.async_load()
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 99, in async_load
    return await self._load_task
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 112, in _async_load
    json_util.load_json, self.path
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 37, in load_json
    raise HomeAssistantError(error)
homeassistant.exceptions.HomeAssistantError: Expecting ',' delimiter: line 298 column 17 (char 13141)
2019-12-30 17:47:53 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=27 from 2019-12-30 17:11:21.275413)
2019-12-30 17:48:05 WARNING (MainThread) [homeassistant.setup] Setup of person is taking over 10 seconds.
2019-12-30 17:48:05 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.scene] Setup of platform homeassistant is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.weather] Setup of platform met is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform updater is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform mobile_app is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform mobile_app is taking over 10 seconds.
2019-12-30 17:48:06 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform tradfri is taking over 10 seconds.
2019-12-30 17:48:16 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform upnp is taking over 10 seconds.

     
                                                                                               

EDIT: initial pasted log was incomplete!

That will be useful to prevent another disaster like this! thank you!

That’s fine. However that is not the complete log, you are missing lines at the top. The log always starts with date and time. Can you please post your configuration.yaml file? should be in the same directory. Did you install the samba addon?

Thanks, I am editing it now with an updated -full- version!

configuration.yaml:


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123
discovery:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
frontend: !include frontend.yaml

device_tracker:
  - platform: bluetooth_tracker
#  - platform: sky_hub
#    host: 192.168.0.1
# these were copied from the Netgear router config integration page!
#    username: admin
#    password: sky
#    new_device_defaults:
#      track_new_devices: true
#      hide_if_away: false


Negative :confused:

Did you change anything in this file core.entity_registry manually?

1 Like

Yes I have actually! :flushed:
I did download a version of the file before changing it, could I theoretically use nano to copy the downloaded version to fix the one I changed?

You should only mess with this file when you know what your are doing :sweat_smile: What did you change in this file?
To restore the file, stop home assistant, then delete the content and paste the content from your saved version, then start home assistant again.

1 Like

lol fair enough! :crazy_face:

I just added a

name: Ipad Battery

to one of the entities, so should be a pretty heasy fix… didn’t think such a simple change would take over my afternoon completely :face_with_head_bandage:

let me try and amend it… I’ll report back hopefully soon!
Thanks for coming to the rescue!

If you don’t format JSON correctly, the house comes crashing down.

1 Like

And I’m not sure why you thought you needed to edit any files in the .storage folders at all in the first place?

I know of a few reasons, but the example given is definitely not the correct way to use it.

This same thing happened to me a few weeks ago. I modified one of the core files for some reason I can’t fully remember (think I was having trouble with an iphone and trying to force all the stored details to reset). I accidentally left a trailing comma on the last array entry and it all came down. Found the same log entry and fixed it easily enough but it was scary for a bit.

One thing that surprised me though was that check configuration didn’t catch it. I’m always super diligent about running check configuration whenever I change anything (I actually have an automation that watches my config files and automatically runs it whenever those files change). But the check passed even though one of my core files had invalid JSON in it.

I understand the core files are not intended for manual modification and so it makes sense to skip checking every config detail in them like it does with the yaml files, it would mostly be unnecessary overhead. But it would be nice if check config at least did a JSON validity check on those files. That’s pretty quick and would save headaches like this one.

Because it doesn’t check the JSON located in .storage. It’s looking at YAML syntax.