Platform Information
Hardware: Raspberry Pi 3B+
OS: Raspberry Pi OS (32 Bit - Buster)
Java Runtime Environment:
openjdk version “1.8.0_152”
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
Jython 2.7.0
openHAB 2.5.5 (Release Build)
Hello Community,
I’m migrating rules to NGRE using the Beta Helper Libraries. This evening I ran across a “RuntimeError: maximum recursion depth exceeded (Java StackOverflowError) in at line number 82.” Does anyone have any ideas what’s causing the error? It seems to be related to the “log_traceback” decorator. When comment out that decorator startup after and openhab restart appears normal. The odd thing about this was that I was using the decorator successfully, on and off for a few hours debugging rules. Then Java crashed with a flurry of exceptions, and I was not able to restart openHAB. I ended up rebooting the system and stopping openhab, and clearing the cache. Logs and rule follow.
openhab.log
2020-06-09 22:23:17.823 [INFO ] [jsr223.jython.core.startup_delay ] - Checking for initialized context
2020-06-09 22:23:17.829 [INFO ] [jsr223.jython.core.startup_delay ] - Context initialized... waiting 30s before allowing scripts to load
2020-06-09 22:23:47.832 [INFO ] [jsr223.jython.core.startup_delay ] - Complete
2020-06-09 22:23:47.838 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/100_DirectoryTrigger.py'
2020-06-09 22:23:47.840 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/100_DirectoryTrigger.py
2020-06-09 22:23:49.847 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/python/core/components/100_DirectoryTrigger.py': RuntimeError: maximum recursion depth exceeded (Java StackOverflowError) in <script> at line number 82
2020-06-09 22:23:49.854 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/100_OsgiEventTrigger.py'
2020-06-09 22:23:49.857 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/100_OsgiEventTrigger.py
2020-06-09 22:23:50.937 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/python/core/components/100_OsgiEventTrigger.py': SystemError: Automatic proxy initialization should only occur on proxy classes in <script> at line number 72
2020-06-09 22:23:50.942 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/100_StartupTrigger.py'
2020-06-09 22:23:50.944 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/100_StartupTrigger.py
2020-06-09 22:23:51.007 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/python/core/components/100_StartupTrigger.py': RuntimeError: maximum recursion depth exceeded (Java StackOverflowError) in <script> at line number 49
2020-06-09 22:23:51.011 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonBindingInfoProvider.py'
2020-06-09 22:23:51.014 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonBindingInfoProvider.py
2020-06-09 22:23:51.219 [WARN ] [ython.core.JythonBindingInfoProvider] - Traceback (most recent call last):
File "<script>", line 39, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:51.224 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonExtensionProvider.py'
2020-06-09 22:23:51.227 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonExtensionProvider.py
2020-06-09 22:23:52.695 [DEBUG] [.jython.core.JythonExtensionProvider] - Start init
2020-06-09 22:23:52.753 [DEBUG] [.jython.core.JythonExtensionProvider] - End init
2020-06-09 22:23:52.762 [WARN ] [.jython.core.JythonExtensionProvider] - Traceback (most recent call last):
File "<script>", line 87, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:52.769 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemChannelLinkProvider.py'
2020-06-09 22:23:52.771 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonItemChannelLinkProvider.py
2020-06-09 22:23:52.888 [WARN ] [n.core.JythonItemChannelLinkProvider] - Traceback (most recent call last):
File "<script>", line 52, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:52.894 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonItemProvider.py'
2020-06-09 22:23:52.899 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonItemProvider.py
2020-06-09 22:23:53.060 [ERROR] [sr223.jython.core.JythonItemProvider] - Traceback (most recent call last):
File "<script>", line 57, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:53.066 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingProvider.py'
2020-06-09 22:23:53.069 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonThingProvider.py
2020-06-09 22:23:53.189 [ERROR] [r223.jython.core.JythonThingProvider] - Traceback (most recent call last):
File "<script>", line 50, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:53.196 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonThingTypeProvider.py'
2020-06-09 22:23:53.199 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonThingTypeProvider.py
2020-06-09 22:23:53.318 [ERROR] [.jython.core.JythonThingTypeProvider] - Traceback (most recent call last):
File "<script>", line 39, in <module>
SystemError: Automatic proxy initialization should only occur on proxy classes
2020-06-09 22:23:53.326 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/core/components/200_JythonTransform.py'
2020-06-09 22:23:53.329 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/core/components/200_JythonTransform.py
2020-06-09 22:23:53.389 [ERROR] [hon.core.JythonTransformationService] - Traceback (most recent call last):
File "<script>", line 28, in <module>
RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)
2020-06-09 22:23:53.394 [INFO ] [me.core.service.AbstractWatchService] - Loading script 'python/personal/python_test.py'
2020-06-09 22:23:53.396 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language 'py' with identifier: file:/etc/openhab2/automation/jsr223/python/personal/python_test.py
2020-06-09 22:23:58.946 [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
2020-06-09 22:24:00.137 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab2/automation/jsr223/python/personal/python_test.py': SystemError: Automatic proxy initialization should only occur on proxy classes in <script> at line number 10
python_test.py
from core.rules import rule
from core.triggers import when
from core.actions import ScriptExecution
from core.log import log_traceback
from datetime import datetime, date, time
import re
@rule("Lights On When Waking Up for High School2")
@when("Time cron 0/10 * * * * ?")
#@when("Time cron 0 00 17 ? * MON-FRI *")
@log_traceback
def lights_on_when_waking_up_for_high_school2(event):
now=datetime.now()
time_now=now.time()
date_now=now.date()
item_Mehlville_School_District_current_event_name=itemRegistry.getItem("Mehlville_School_District_current_event_name")
First_Day_of_School="2020-06-08"
Last_Day_of_School="2021-06-08"
First_Day_of_School_Date=datetime.strptime(First_Day_of_School, "%Y-%m-%d").date()
Last_Day_of_School_Date=datetime.strptime(Last_Day_of_School, "%Y-%m-%d").date()
if date_now >= First_Day_of_School_Date and date_now <= Last_Day_of_School_Date and not item_Mehlville_School_District_current_event_name.startswith("No School"):
events.sendCommand("gUpstairs_Hallway_Lights", "ON")
str_Sunrise_Start_Time=itemRegistry.getItem("Sunrise_Start_Time").state.toString()
Sunrise_Start_DateTime=re.sub(r"\..*", "", str_Sunrise_Start_Time)
Sunrise_Start_Time=datetime.strptime(Sunrise_Start_DateTime, "%Y-%m-%dT%H:%M:%S").time()
if Sunrise_Start_Time > time_now:
events.sendCommand("gKitchen_Island_Lights", "ON")
events.sendCommand("gLiving_Room_Lights", "ON")
lights_on_when_waking_up_for_high_school2.log.info("Rule: 'Lights On When Waking Up for High School' fired.")
Regards,
Burzin