openHAB 4.0 SNAPSHOT discussion

This question is actually not answered. :slight_smile: I hope I’m not making a fuss if this only happens for me. Does anyone else see this problem?

I can confirm that I can see the same issue on the latest snapshot.

Please see latest comments from @wborn in the issue. Maybe not to be considered a blocker?

I think I can provide a fix soon, so please wait a bit.

3 Likes

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.

1 Like

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)

  1. 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.
  2. 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.

1 Like

If I did so I have no idea what I sent them to or what they should be. So you are saying jruby is broken in OH4? with no work around?

On another note my Hue bridge had to be set to HTTP instead of HTTPS which I guess it defaulted itself to on upgrade

The settings are documented in the installation instructions for the relevant helper libraries:
For openhab-scripting 4.x and openhab-scripting 5.x.

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.

1 Like

@Andrew_Rowe please uninstall the built in jrubyscripting addon from OH4 and drop this jar into your addons folder: Release jrubyscripting-oh4.0-0.0.1: [lcn] Add shutter positioning/angle, operating hours counters, tunabl… · jimtng/openhab-addons · GitHub

Then if you still encounter the same error message, please open a separate topic to track it and tag me on it.

1 Like

Is there already an option to upgrade using openHABian??

you can try to switch to snapshots. Let me know if that works.

I may not see the point. But as 4.0.0 M1 is released it would be enough to switch to testing releases to install the milestone, woudn’t it ?

But JSONPath Transformation is still available in OH4.x, right? Just JS (Java Script) is replaced.

I think, that’s what also @mstormi meant :wink:
If JSONPath Transformation is still available on OH4, I might give it a try.

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.

1 Like

Does anyone know why the SCRIPT transformation was designed to use .script? Is there a reason not to use myscript.js, myscript.rb, myscript.rules?

Yes. Because all transformations use the name of the transformation service as file extension.

1 Like

Alternative option is to include this in your pom.xml, see:

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.