JS Transformations stopped working

So, completely out of the blue any call to a JS transformation does no longer work

I get the error log of:

Cannot invoke "javax.script.Compilable.compile(java.io.Reader)" because "engine" is null

My installation has remained unchanged for a couple of months and everything was working fine until a couple of days ago, I made no changes to anything at all. Completely at a loss as to what’s going on, can anyone help?

I’ve tried uninstalling and reinstalling the Javascript transformation Add-on but it did not resolve the issue

Something changed. If you didn’t change any openHAB configs we need to look at other things.

  • upgrade to OH or the operating system
  • the machine rebooted
  • a file system got full
  • an SD card has started to wear out

What’s the hardware, OS, version of OH? How was OH installed?

I agree, something must have changed, but can’t (as of yet) work it out, I was hoping the error may be known and an easy solution is available!

Apologies for not including this initially.

Openhabian on Rasp Pi 4

Openhab 3.3.0.M4 (was M3, but upgraded it today to see if it helped things)

The installation is on an SSD with plenty of room.

If you installed via openHABian, do you have ZRAM configured? Since you are on an SSD you shouldn’t. If you do, check the file systems and make sure they are not full. ZRAM puts the folders that are written to a lot into RAM and there isn’t much space in RAM.

If you’ve had an unexpected power outage/reboot on the machine, even with an SDD that can result in file system corruption. Some config file or part of OH proper could have become corrupted.

1 Like

My best bet would be an upgraded Java, since the transformation depends on Nashorn and that was removed in Java 15.

1 Like

So, having looked at various logs of other machines in the house, it appears we had a power outage last week, confirmed by my son who was most annoyed that his PC turned off during a game! Interestingly though, my go to source for power cuts is the cooker clock which was still up and running, so it must have been such a short outage that the capacitors in that didn’t get a chance to discharge.

Anyway, I restored from a back up and all is well again, so many thanks for the pointer. I’m surprised the corruption was so specific as to only affect the JS transformation functions, but anyway, that’s what it was, many thanks for the help.

Glad you have it back working. Allow me to follow up on this:
Note we do NOT support running openHABian off SSD.
We don’t intend breaking anything but any future code change won’t check or care for SSD existence so may be incompatible with that so just a reminder to reconsider that.-
Note it’s not just theory, we already had breaking changes, e.g. some device names are hardcoded.

Most people to use SSDs -no matter if aware or not of the support issue- do so because they believe it (fully) protects them from file corruption to happen.
But as your example shows well, this just isn’t true. So the prime hope and reason for moving isn’t really valid.

Thanks for that, I use SSD now because of the native SSD boot support on a Raspberry Pi 4, I didn’t realise this could have issues with openHABian.

I do feel SSD offers a more robust solution as the read writes don’t wear them out on the same way as they do with an SD card, but of course, any system is susceptible to corruption as a result of power loss. Maybe a UPS is required…

Sigh. Why do I keep writing docs when nobody is patient and thorough enough to read them before they embark on whatever (…not always…) clever idea of their own ?

Sigh I’ve since read that document, interestingly, back when I first installed openHABian, there was an option within config (I think 37?) to move the system over to SSD which I did until native support for SSD was offered on the Pi.

The Hardware modifications section of the documentation has been added since I installed OpenHABian, I feel its a pretty new addition.

I think it’s a bit unfair to suggest that I’ve embarked on some kind of outlandish approach.

I’ve run OpenHABian for a long time and on an SSD for well over a year, I’m aware of the fact that different systems may not be supported, But it doesn’t mean we as users aren’t allowed to do it. I also recognise that unsupported approaches will obviously not be supported. I honestly thought the issue I had was not something due to the SSD, apologies if it clearly is. The suggestion that it may have been a power outage pointed me in a helpful (and correct) direction to resolve the issue.

Didn’t want to do that. Granted the paragraph is fairly new in that it’s definitely a lot more to the point and a one-stop for this sort of information now (which had been scattered and less clear before).
Sure you can apply any modification you like to. Just wanted to make you aware of the implications.
And :+1: for reading upfront so sorry aiming at you wasn’t fair.
Quite many people simply don’t read the docs though.

1 Like

No problem, I am pretty thorough with these things in the main, so was sure when I went down the SSD route, it wasn’t so explicitly stated. Here’s hoping it will continue to work, but now understand that it might fail on me at some point, so thanks for pointing me to the documentation.