-
Notifications
You must be signed in to change notification settings - Fork 786
JSR223 Groovy rule throws exception on startup only (MissingPropertyException: No such property: itemRegistry) #4324
Comments
The root cause according to @smerschjohann in #4808 is:
|
This however is not really a dependency on "the system", but in this case clearly on the availability of I know, potentially there could be an arbitrary, unknown number of |
Hello, I have a similar issues with javascript and jython. Both jsr223 implementations have similar trouble with not initialized context. https://community.openhab.org/t/jython-jsr223-not-properly-initialised-during-startup/46031 and a timeout of 25 seconds is far from being enough. I have a Intel Atom CPU which needs between 2 - 4 minutes to startup my openhab 2.3 system with several hundred items. During this time a I get a lot of errors like rules which are fired to early (before persistence, items, transformation maps), jsr223 context is not properly initialized... Every startup gives different errors, depending what is already loaded and what not. Only the jsr223 error is always the same. After 2-4 minutes the rules errors are less and less until they are gone. And at the end if i call "touch *" on all jython files, every thing loads fine and the jython scripts are working correctly. just to give you an impression about my complex setup, you can take a look here http://www.intranet-of-things.com/smarthome As I'm a developer too, maybe I can help with debugging, testing, providing limited access to my system/setup |
I extended the burntime script a little bit. Instead of waiting a specific amount of time, I'm waiting now until the automationManager is initialized. This works for me, independently how long my openhab startup need to finish.
|
I had been using @HolgerHees solution, but found in testing that it is no longer needed. I'm currently using OH snapshot 1374. I'm not sure which PR might have corrected this, but I think this issue can be closed. @vbier? |
I just updated to 1374 and still have the error:
|
Strange... my Jython scripts are loading properly without the 'burntime' script, but it was needed before. I must be getting lucky! |
I don't know about your "burntime" script, but that it is now working might be a positive side effect of #6284. |
It certainly is: Before #6284 the |
For me, it actually has become worse. Previously, things started to work when I touched the script file in a system startup rule, but this does now no longer work. It does give now the same exception that I do get when the file is initially loaded, which means I can no longer use the groovy rules at all. Edit: forget what I just wrote, it worked as before on the next restart. But the original problem is still there. |
my guess is that the need of the burntime script depends how "heavy" your startup procedure is. With heavy I mean the amount of items, rules, etc. If there are a lot of parallel tasks running and you have a slow server like raspberry or atom based one, the availability of the script engine may take longer. |
Yes, there is the chance that the
What still holds true is @SJKA's analysis here #4324 (comment): The The most reliable way of having everything ready would be a static list of @adimova what is your take on this? |
I'm also affected by this issue. Is there anything I can contribute or is the issue already understood well enough to work on a solution? |
With the reintegration of ESH into openhab-core, openhab/openhab-core#610 and possibly other issues will need to be addressed before this can be looked into again. |
I have a groovy rule that works fine once the system has started, but on startup I
always get:
I have to touch the rule once the system is up and then it works. The rule can be stripped down to one line and still triggers the error:
itemRegistry.get("gShutterLocks")
I have openhabian running and just updated to openHAB 2.2.0 Build #1044 in hope that
the problem will go away, but is still there.
Expected Behavior
The rule should parse without errors on system startup.
Current Behavior
I do get the above mentioned MissingPropertyException.
Steps to Reproduce (for Bugs)
Install openHAB with JSR223 groovy support, add a rule with the above mentioned content and restart openHAB.
Environment
openhabian [master]v1.3-303(0e2437c)
openHAB 2.2.0 Build # 1044
The text was updated successfully, but these errors were encountered: