[Solved] OpenHAB 2.5.10 Build #250: Jython 2.7.2 won't start in docker environment

Hi all,

I am running OpenHAB in a docker container on my x86 NAS. I followed thoroughly the following documentation to enable the next gen rule engine (and I triple-checked that I did not miss something):

EDIT: There is only ONE difference I am using jython-standalone-2.7.2.jar instead of jython-standalone-2.7.0.jar !!!

I am starting my docker container through the UI provided by the NAS vendor but I have taken care that all JAVA_EXTRA_OPTS are passed at container startup.

But I don’t see anything related in the log regarding script engine or the “Hello World” script that should be running.

Can someone provide me a debug strategy on how to verify step by step what should be running and what is missing?
I really followed the installation instruction above very carefully. And if no one minds I would like to save the space and time to paste all my setup information here again.
It would be helpful if I can check for

  • some process that should be running
  • files that should be existing
  • some ACLs, permissions to be set correctly
  • some changes to scripts (init.py ???) that should be manually made
  • … what ever

Thank you for helping me digging

Cheers
Justus

1 Like

Look at the regular installation instructions… it looks like you might not have set the log levels (step 2 and 3).

Manual installations are a but complicated, so you may want to just use the beta Jython add-on. I also have some add-ons in the Eclipse Marketplace that I am polishing up (more info this weekend).

1 Like

Thanks Scott!!!

I used your addon and once copied to the addon directory I get the following errors in karaf.log:

15:53:25.501 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/000_startup.py'
15:53:26.460 [WARN ] [jython.Startup                       ] - 

*******************************************************************************
Jython version:       2.7.2.final
Operating system:     Linux
OS Version:           4.4.59+
Java vendor:          Azul Systems, Inc.
Java VM name:         OpenJDK 64-Bit Server VM
Java runtime name:    OpenJDK Runtime Environment
Java runtime version: 1.8.0_265-b11
sys.path:             /openhab/conf/automation/lib/python
                      /openhab/userdata/cache/org.eclipse.osgi/296/0/bundleFile/Lib
                      __classpath__
                      __pyclasspath__/
*******************************************************************************

15:53:26.463 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_DirectoryTrigger.py'
15:53:27.544 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/100_DirectoryTrigger.py': ImportError: No module named configuration in <script> at line number 20
15:53:27.546 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_OsgiEventTrigger.py'
15:53:28.468 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/100_OsgiEventTrigger.py': ImportError: No module named configuration in <script> at line number 10
15:53:28.470 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_StartupTrigger.py'
15:53:29.251 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/100_StartupTrigger.py': ImportError: No module named configuration in <script> at line number 10
15:53:29.253 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonBindingInfoProvider.py'
15:53:29.876 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonBindingInfoProvider.py': ImportError: No module named configuration in <script> at line number 8
15:53:29.878 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonExtensionProvider.py'
15:53:31.268 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonExtensionProvider.py': ImportError: No module named configuration in <script> at line number 10
15:53:31.270 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemChannelLinkProvider.py'
15:53:31.875 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemChannelLinkProvider.py': ImportError: No module named configuration in <script> at line number 9
15:53:31.876 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemProvider.py'
15:53:32.465 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemProvider.py': ImportError: No module named configuration in <script> at line number 9
15:53:32.467 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingProvider.py'
15:53:33.057 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingProvider.py': ImportError: No module named configuration in <script> at line number 8
15:53:33.059 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingTypeProvider.py'
15:53:33.622 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingTypeProvider.py': ImportError: No module named configuration in <script> at line number 8
15:53:33.624 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonTransform.py'
15:53:34.195 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/core/components/200_JythonTransform.py': ImportError: No module named configuration in <script> at line number 10
15:53:34.197 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/personal/hello_world.py'
15:53:35.426 [ERROR] [ript.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/openhab/conf/automation/jsr223/python/personal/hello_world.py': ImportError: No module named configuration in <script> at line number 5

EDIT: Found this solution:

Trying it out …

16:14:32.925 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/000_startup.py'
16:14:33.857 [WARN ] [jython.Startup                       ] - 

*******************************************************************************
Jython version:       2.7.2.final
Operating system:     Linux
OS Version:           4.4.59+
Java vendor:          Azul Systems, Inc.
Java VM name:         OpenJDK 64-Bit Server VM
Java runtime name:    OpenJDK Runtime Environment
Java runtime version: 1.8.0_265-b11
sys.path:             /openhab/conf/automation/lib/python
                      /openhab/userdata/cache/org.eclipse.osgi/296/0/bundleFile/Lib
                      __classpath__
                      __pyclasspath__/
*******************************************************************************

16:14:33.859 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_DirectoryTrigger.py'
16:14:34.900 [INFO ] [223.jython.core.DirectoryEventTrigger] - TriggerHandler added [jsr223.DirectoryTrigger]
16:14:34.907 [INFO ] [223.jython.core.DirectoryEventTrigger] - TriggerType added [jsr223.DirectoryTrigger]
16:14:34.909 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_OsgiEventTrigger.py'
16:14:35.881 [INFO ] [jsr223.jython.core.OsgiEventTrigger  ] - TriggerHandler added 'jsr223.OsgiEventTrigger'
16:14:35.884 [INFO ] [jsr223.jython.core.OsgiEventTrigger  ] - TriggerType added 'jsr223.OsgiEventTrigger'
16:14:35.886 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/100_StartupTrigger.py'
16:14:37.348 [INFO ] [jsr223.jython.core.StartupTrigger    ] - TriggerHandler added [jsr223.StartupTrigger]
16:14:37.351 [INFO ] [jsr223.jython.core.StartupTrigger    ] - TriggerType added [jsr223.StartupTrigger]
16:14:37.354 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonBindingInfoProvider.py'
16:14:37.983 [DEBUG] [ythonBindingInfoProvider.scriptLoaded] - Registered service
16:14:37.985 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonExtensionProvider.py'
16:14:38.917 [DEBUG] [.JythonExtensionProvider.scriptLoaded] - Added JythonExtensionProvider
16:14:38.919 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemChannelLinkProvider.py'
16:14:39.516 [DEBUG] [nItemChannelLinkProvider.scriptLoaded] - Registered service
16:14:39.518 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemProvider.py'
16:14:39.924 [DEBUG] [.core.JythonItemProvider.scriptLoaded] - Registered service
16:14:39.925 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingProvider.py'
16:14:40.339 [DEBUG] [core.JythonThingProvider.scriptLoaded] - Registered service
16:14:40.341 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingTypeProvider.py'
16:14:40.872 [DEBUG] [.JythonThingTypeProvider.scriptLoaded] - Registered service
16:14:40.874 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonTransform.py'
16:14:42.118 [DEBUG] [honTransformationService.scriptLoaded] - Registered service
16:14:42.121 [INFO ] [ome.core.service.AbstractWatchService] - Loading script 'python/personal/hello_world.py'
16:14:44.576 [DEBUG] [jsr223.jython.core.triggers          ] - when: target='Time cron 0/10 * * * * ?', target_type='Time', trigger_target='cron', trigger_type='0/10 * * * * ?', old_state='None', new_state='None'
16:14:46.055 [DEBUG] [jsr223.jython.core.triggers          ] - when: Created cron_trigger: 'Time_cron_0_10_20749400268c11eb8b9f63a78e55ec18'
16:14:46.061 [DEBUG] [jsr223.jython.core.rules             ] - Added rule [Jython Hello World (cron decorators)]

Seems to look good now … :+1:

16:14:46.061 [DEBUG] [jsr223.jython.core.rules             ] - Added rule [Jython Hello World (cron decorators)]
16:14:46.066 [INFO ] [smarthome.event.RuleAddedEvent       ] - Rule 'ceb05784-49f8-4864-89a3-e0cd85dad133' has been added.
16:14:46.067 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: UNINITIALIZED
16:14:46.068 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: INITIALIZING
16:14:46.070 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: IDLE
16:14:50.072 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: RUNNING
16:14:50.084 [INFO ] [.Jython Hello World (cron decorators)] - Hello World!
16:14:50.086 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: IDLE
16:15:00.073 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: RUNNING
16:15:00.074 [INFO ] [.Jython Hello World (cron decorators)] - Hello World!
16:15:00.077 [INFO ] [smarthome.event.RuleStatusInfoEvent  ] - ceb05784-49f8-4864-89a3-e0cd85dad133 updated: IDLE


:clap: :clap: :clap:

@5iver, the jython addon is great and a bullet proof method to ease the setup of ng-ruleengine in docker environments. Please continue your efforts to make it a standard addon.

Thank you for your efforts!!!

1 Like