I searched in this thread for jruby and didn’t see anything, sorry if I missed it
Upgrade OH3 to OH4 and everything seems fine except jruby rules throwing an error
==> /var/log/openhab/events.log <==
2023-03-11 15:38:31.449 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OutsideLuxNum' changed from 3065.515869140625 to 3108.8778076171875
==> /var/log/openhab/openhab.log <==
2023-03-11 15:38:31.455 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'AmbientLightDimmer' failed: Error during evaluation of Ruby in org/jruby/RubyModule.java at line 4311: (NameError) uninitialized constant OutsideLuxNum
here is another
2023-03-11 15:38:32.401 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sun_Elevation' changed from 36.37246644373223 ° to 35.38033239923391 °
==> /var/log/openhab/openhab.log <==
2023-03-11 15:38:32.413 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'SunAngle' failed: Error during evaluation of Ruby in <script> at line 1: (NameError) undefined local variable or method `logger' for main:Object
a restart of openHAB didn’t help
Do I need to update my gem or something?
Bit of a ruby noob
The 5.0 version of the jRuby helper library was announced last week and there is ongoing changes which have moved the library into the openHAB project now and have it be included in the add-on same as how the JS Scripting add-on and library works.
This seems like the helper library didn’t load at all.
There are two current issues on 4.0M1 (and snapshot up to build #3363 that I’ve tested)
There’s an important PR that didn’t get merged before M1 release. This PR sets the default gem and require, and it is useful (not critical) for new users. It doesn’t affect you if you’ve already installed jrubyscripting addon previously. You would’ve had to set the gem settings in the past, thus overriding the default value anyway.
There is a current active bug (I think it lies in core) causing a race condition in the script file watcher, affecting the jrubyscripting addon. I’ve submitted a PR to fix it.
Because of this, I’d suggest going back to 3.4.2 or wait for an openhab-snapshot version once problem #2 above is fixed.
Currently, yes the addon is broken. It loads intermittently due to the race condition. If it does load, it would work. Either version of the helper library should work. I’ve just discovered my PR to fix #2 above didn’t quite solve the problem. Still debugging it right now. I’ll let you know here once it’s fixed.
Yes, JSONPATH is still available. The removal is due to the more generic Script Transformation Service. You can still use JS, but you have to change the call (i.e. set SCRIPT instead of JS, change extension to .script, set js option for the called Script)
SCRIPT can use any rule language which is supported by openHAB (as far as I know), so it’s only a breaking change, but not a go-away.
I just installed build #3380 and I’m found that my logs have stopped. In fact, they stopped around 4 PM three days ago (Friday).
I had this happen to me once before and I never figured out what caused it then.
Based on exploration, org.ops4j.pax.logging.cfg somehow got replaced with an empty file. Right when the logs stopped matches the timestamp on the file.
I have no idea how this file might be getting replaced. It’s not a file that I modify myself. The last update of my instance took place on the 16th and then on the 20th. The backup from the 16th shows the file as expected and the backup from today shows the file is empty so this isn’t related to an upgrade.
Is there any circumstance where Karaf or OH may open this file for writing and fail perhaps, leaving an empty file?
Based on the timestamp on the file I’m all but certain I was not doing anything to OH at that time last Friday, so this almost has to be related to some automated process. I’m at a loss on where to look next.
At least the fix on my end is super easy.
I’d love to find out I’m not alone and someone else has seen this too.
!@#$, it just happened again a couple minutes ago!
All I was doing was modifying Item metadata through the UI. I wasn’t doing anything on the host, docker container, or console. This is very mysterious indeed and certainly points to a pervasive if intermittent problem.