Hass-Custom-Alarm icon indicating copy to clipboard operation
Hass-Custom-Alarm copied to clipboard

Whoops! something went wrong

Open ward0 opened this issue 5 years ago • 20 comments

Describe the bug default page not loading.

To Reproduce Steps to reproduce the behavior:

  1. Copy all the files into the HA folder.
  2. reboot HA
  3. see this page (see screenshot)

Expected behavior I should have gotten the full configuration page instead of this error.

Screenshots If applicable, add screenshots to help explain your problem. image

Browser (please complete the following information):

  • Browser : Chrome
  • Version v1.3.6

ward0 avatar Mar 12 '19 22:03 ward0

Have you tried deleting the alarm.json in your config folder?

RowdyDog12 avatar Mar 13 '19 01:03 RowdyDog12

and I'd personally recommend include some kind of error message in the title when reporting such a problem as it will make easier for others to find it. otherwise just imagine tens of identical "Whoops!" issues, not very helpful and useful.

akasma74 avatar Mar 13 '19 07:03 akasma74

The "Whoops" message is what the alarm itself is reporting. If it reported a better bug, it would be easy to copy it to the title :)

adipose avatar Mar 13 '19 07:03 adipose

Incidentally, here's a bug I posted in the past where I got the whoops message:

https://github.com/gazoscalvertos/Hass-Custom-Alarm/issues/54

Maybe it will help here.

adipose avatar Mar 13 '19 07:03 adipose

The "Whoops" message is what the alarm itself is reporting. If it reported a better bug, it would be easy to copy it to the title :)

I know, but to distinguish different issues here it's beneficial to avoid generic titles like "Whoops" or "Nothing is working". The log contains a clear error message "Cannot read property xxx" - use that.

On the other hand, it's not that easy to extract and report the exact error from the code as the error(s) message(s) can be very long and chained (that's only my opinion). And having the whole log instead of "Whoops" might be not the best option.

Actually, looking at the code I can conclude that the Whoops functionality of the alarm receives an empty error message to display meaning something is broken on its way there. That explains lack of proper error message in the panel. Will have a look and update here.

akasma74 avatar Mar 13 '19 08:03 akasma74

I agree. I just recall when I got that message I didn't have much to go on, either. I posted the behavior as best I could, but the "whoops" really was the main error. As for the browser console, it can often be misleading as the original error causes an html error.

adipose avatar Mar 13 '19 08:03 adipose

Indeed. Currently in the alarm code if detects error(s), it

  1. requests error log from HA
  2. iterates over them 2a. if the error message contains "[alarm", it adds it to the message it then passes to the alarm.html to display.

Clearly in this particular case there was no such messages because "[alarm" != "(alarm", for example ;)

My question is do you know the easy way to make the alarm to Whoops as I need to get to that situation.

akasma74 avatar Mar 13 '19 08:03 akasma74

I did not report this bug, but the similar bug that I linked was caused by mqtt service being shutdown (but enabled for hca).

adipose avatar Mar 13 '19 08:03 adipose

I know who reported this bug. Do I get it right that simply enabling MQTT in control panel and stopping MQTT broker will break the alarm?

akasma74 avatar Mar 13 '19 08:03 akasma74

@akasma74 @adipose I have to look in my configuration.yaml file and delete the MQTT section?

By reading 'deleting the MQTT section from the yaml' = i presume configuration.yaml.

ward0 avatar Mar 13 '19 09:03 ward0

@akasma74 @adipose I have to look in my configuration.yaml file and delete the MQTT section?

nope. we just discussed that Whoops issue here, sorry about the mess. have you tried what @adipose suggested yet?

akasma74 avatar Mar 13 '19 10:03 akasma74

@akasma74 I don't need MQTT for the moment, i enabled it by accident while navigating in hass.io for first time...

ward0 avatar Mar 13 '19 13:03 ward0

that's ok, just disable it in alarm.yaml manually if you have no access to alarm panel configuration screen.

What I want to know is are you still having this bug? If yes, have you tried deleting the alarm.json in your config folder?

akasma74 avatar Mar 13 '19 14:03 akasma74

@akasma74 I will test tonight and let you know. So to make sure that i help you:

  1. delete alarm.json file in config folder and test if error is gone. if not: delete MQTT section in alarm.yaml section.

ward0 avatar Mar 13 '19 14:03 ward0

I'd also recommend to clear ALL browsers' cache and restart them and then do testing.

akasma74 avatar Mar 13 '19 15:03 akasma74

And it would be great to enable debug logging, too

akasma74 avatar Mar 13 '19 15:03 akasma74

@akasma74 the requested log files: 2019-03-13 21:25:21 WARNING (MainThread) [homeassistant.config] Incomplete core configuration. Auto detected latitude: 51.1833, longitude: 2.8167, name: Westende, time_zone: Europe/Brussels, elevation: 0 2019-03-13 21:25:21 ERROR (MainThread) [homeassistant.loader] Unable to find component default 2019-03-13 21:25:22 ERROR (MainThread) [homeassistant.loader] Unable to find component logs 2019-03-13 21:25:22 ERROR (MainThread) [homeassistant.loader] Unable to find component homeassistanthomeassistant 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.config] Invalid config for [panel_iframe]: invalid slug node-red (try node_red) for dictionary value @ data['panel_iframe']. Got OrderedDict([('configurator', OrderedDict([('title', 'Configurator'), ('icon', 'mdi:wrench'), ('url', 'http://192.168.1.2:3218')])), ('pihole', OrderedDict([('title', 'Pi-hole'), ('icon', 'mdi:block-helper'), ('url', 'http://192.168.1.2:4865')])), ('node-red', OrderedDict([('title', 'Node-Red'), ('icon', 'mdi:wrench'), ('url', 'http://192.168.1.2:1880')]))]). (See /config/configuration.yaml, line 46). Please check the docs at https://home-assistant.io/components/panel_iframe/ 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.setup] Setup failed for panel_iframe: Invalid config. 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.loader] Unable to find component default 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.setup] Setup failed for default: Component not found. 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.loader] Unable to find component logs 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.setup] Setup failed for logs: Component not found. 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.loader] Unable to find component homeassistanthomeassistant 2019-03-13 21:25:26 ERROR (MainThread) [homeassistant.setup] Setup failed for homeassistanthomeassistant: Component not found. 2019-03-13 21:25:27 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /config/known_devices.yaml: Config file not found: /config/known_devices.yaml 2019-03-13 21:25:27 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 56, in async_setup_component return await task # type: ignore File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 124, in _async_setup_component conf_util.async_process_component_config(hass, config, domain) File "/usr/local/lib/python3.7/site-packages/homeassistant/config.py", line 743, in async_process_component_config platform = get_platform(hass, domain, p_name) File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 105, in get_platform base_paths) File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 166, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 724, in exec_module File "", line 860, in get_code File "", line 791, in source_to_code File "", line 219, in _call_with_frames_removed File "/config/custom_components/alarm_control_panel/bwalarm.py", line 12 homeassistant""" CUSTOM ALARM COMPONENT BWALARM https://github.com/gazoscalvertos/Hass-Custom-Alarm

VERSION: 1.1.4 MODIFIED: 10/02/19 GazosCalvertos: Yet another take on a custom alarm for Home Assistant

CHANGE LOG: -Fixed username issue in log

"""

^ SyntaxError: invalid syntax 2019-03-13 21:26:12 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds. 2019-03-13 21:26:12 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /homeassistant/options request

in alarm.yaml i have only: platform: bwalarm name: House

no alarm.json file found in the config folder...

and i still have the error :(

ward0 avatar Mar 13 '19 20:03 ward0

If you comment this alarm panel in your configuration.yaml, is your HA starts up ok without any errors?

akasma74 avatar Mar 13 '19 21:03 akasma74

i did, here is the log:

2019-03-14 23:05:58 WARNING (MainThread) [homeassistant.config] Incomplete core configuration. Auto detected latitude: 51.1833, longitude: 2.8167, name: Westende, time_zone: Europe/Brussels, elevation: 0 2019-03-14 23:05:58 ERROR (MainThread) [homeassistant.loader] Unable to find component homeassistanthomeassistant 2019-03-14 23:06:03 ERROR (MainThread) [homeassistant.loader] Unable to find component homeassistanthomeassistant 2019-03-14 23:06:03 ERROR (MainThread) [homeassistant.setup] Setup failed for homeassistanthomeassistant: Component not found. 2019-03-14 23:06:03 ERROR (MainThread) [homeassistant.config] Invalid config for [panel_iframe]: invalid slug Pi-hole (try pi_hole) for dictionary value @ data['panel_iframe']. Got OrderedDict([('configurator', OrderedDict([('title', 'Configurator'), ('icon', 'mdi:wrench'), ('url', 'http://192.168.1.2:3218')])), ('Pi-hole', OrderedDict([('title', 'Pi-hole'), ('url', 'http://192.168.1.2:4865')])), ('Node-Red', OrderedDict([('title', 'Node-Red'), ('url', 'http://192.168.1.2:1880')]))]). (See /config/configuration.yaml, line 39). Please check the docs at https://home-assistant.io/components/panel_iframe/ 2019-03-14 23:06:03 ERROR (MainThread) [homeassistant.setup] Setup failed for panel_iframe: Invalid config. 2019-03-14 23:06:04 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /config/known_devices.yaml: Config file not found: /config/known_devices.yaml 2019-03-14 23:06:24 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds.

ward0 avatar Mar 14 '19 22:03 ward0

Well, my advice is simple - you need to fix your HA first as it's not loading properly. And as soon as you get it done, please provide us with the log containing bwalarm-related errors.

akasma74 avatar Mar 14 '19 22:03 akasma74