Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HANLDER_INITIALIZING_ERROR so it's more understandable #2749

Open
1 of 3 tasks
rkoshak opened this issue Sep 11, 2024 · 3 comments
Open
1 of 3 tasks

Improve HANLDER_INITIALIZING_ERROR so it's more understandable #2749

rkoshak opened this issue Sep 11, 2024 · 3 comments
Labels
enhancement New feature or request main ui Main UI

Comments

@rkoshak
Copy link

rkoshak commented Sep 11, 2024

The problem

When there is a fatal error in a rule it becomes UNINITIALIZED and shows a HANLDER_INITIALIZING_ERROR. The name of this error and the details are not generally understandable or actionable by the average user. For example, if the rule has a Script for a language that doesn't have the add-on installed appears as:

image

Your suggestion

I've several suggestions:

  • Gray out the play button for rules that cannot be run becuase they are not in the Idle state. (implemented in Rules/Scenes/Scripts: Gray out run now button if uninitialized #2754)
  • Improve the error message to something more understandable and actionable for the end user (in this case something like "Cannot find installed automation add-on that supports "broken" scripts". If it can be even more specific that would be even better (e.g. "This rule requires the jRuby add-on to be installed").
  • Add some sort of indication to the rule page to show what component is generating the error (i.e. which trigger, action or condition the error is comming from).

Your environment

runtimeInfo:
  version: 4.3.0.M1
  buildString: Milestone Build
locale: en-US
systemInfo:
  configFolder: /openhab/conf
  userdataFolder: /openhab/userdata
  logFolder: /openhab/userdata/logs
  javaVersion: 17.0.12
  javaVendor: Debian
  osName: Linux
  osVersion: 6.8.0-41-generic
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 148337520
  totalMemory: 494927872
  uptime: 932
  startLevel: 70
addons:
  - automation-jsscripting
  - automation-jsscriptingnashorn
  - binding-amazonechocontrol
  - binding-astro
  - binding-chromecast
  - binding-http
  - binding-ipcamera
  - binding-mail
  - binding-mqtt
  - binding-network
  - binding-networkupstools
  - binding-openweathermap
  - binding-shelly
  - binding-vesync
  - binding-zigbee
  - binding-zwave
  - misc-openhabcloud
  - persistence-mapdb
  - persistence-rrd4j
  - transformation-basicprofiles
  - transformation-jinja
  - transformation-jsonpath
  - transformation-map
  - transformation-regex
  - ui-basic
  - ui-habot
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 4
    language: en-US
    languages:
      - en-US
      - en
    onLine: true
    platform: Win32
  screen:
    width: 1600
    height: 900
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: light
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
    blocklyRenderer: null
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/128.0.0.0 Safari/537.36
timestamp: 2024-09-11T21:03:39.099Z

Additional information

@rkoshak rkoshak added enhancement New feature or request main ui Main UI labels Sep 11, 2024
florian-h05 added a commit to florian-h05/openhab-webui that referenced this issue Sep 12, 2024
Also improve toast messages in developer sidebar and
fix a minor styling issues for the script settings.

Addresses no. 1 of openhab#2749.

Signed-off-by: Florian Hotze <[email protected]>
florian-h05 added a commit that referenced this issue Sep 12, 2024
Also improve toast messages in developer sidebar and fix a minor styling
issues for the script settings.

Addresses no. 1 of #2749.

Signed-off-by: Florian Hotze <[email protected]>
@florian-h05
Copy link
Contributor

FYI I have just implemented your first suggestion.

@florian-h05
Copy link
Contributor

Wrt to the second suggestion: This is openHAB core part, and when I tried to look into it I could not reproduce your described scenario, I don't get that message. If the automation add-on is missing, my rule does not show any error in the UI but only on execution in the log.

@rkoshak
Copy link
Author

rkoshak commented Sep 13, 2024

Maybe it behaves differently in the snapshots? I'm on 4.3 M1.

What I did to get that error to simulate a not installed add-on was add an inline script action then changed the mimetime to "application/broken". I should have posted my test rule.

configuration: {}
triggers:
  - id: "1"
    configuration:
      itemName: TestSwitch
    type: core.ItemStateChangeTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      type: application/javascript
      script: console.info('Test rule condition');
    type: script.ScriptCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      type: application/javascript
      script: console.info('Test Rule action');
    type: script.ScriptAction
  - inputs: {}
    id: "3"
    configuration:
      type: application/broken
      script: console.info('Broken Test Rule action');
    type: script.ScriptAction

Maybe I went about testing what happens when the add-on is not installed in a bad way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

No branches or pull requests

2 participants