Failed to execute commandLine

I’ve got a few rules which run a python script, and I now noticed that sometimes something goes wrong. In critical.log, I found these entries:

{
    "timestamp": "2026-02-03T09:56:55.224",
    "level": "WARN",
    "message": "Failed to execute commandLine '[python, bin/python/millie/tractive.py]'",
    "threadName": "OH-rule-niet-thuis-1",
    "threadId": 1138,
    "loggerName": "org.openhab.core.io.net.exec.ExecUtil",
    "loggerFQCN": "org.ops4j.pax.logging.slf4j.Slf4jLogger",
    "bundle.id": "183",
    "bundle.name": "org.openhab.core.io.net",
    "bundle.version": "5.1.1"
},
{
    "timestamp": "2026-02-03T09:56:55.238",
    "level": "WARN",
    "message": "Failed to execute commandLine '[/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python, /var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py, set_home_state, -s, False]'",
    "threadName": "OH-rule-tado-API-1",
    "threadId": 1137,
    "loggerName": "org.openhab.core.io.net.exec.ExecUtil",
    "loggerFQCN": "org.ops4j.pax.logging.slf4j.Slf4jLogger",
    "bundle.id": "183",
    "bundle.name": "org.openhab.core.io.net",
    "bundle.version": "5.1.1"
},
[...]
{
    "timestamp": "2026-02-03T10:46:09.076",
    "level": "WARN",
    "message": "Failed to execute commandLine '[/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python, /var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py, set_home_state, -s, True]'",
    "threadName": "OH-rule-tado-API-1",
    "threadId": 1137,
    "loggerName": "org.openhab.core.io.net.exec.ExecUtil",
    "loggerFQCN": "org.ops4j.pax.logging.slf4j.Slf4jLogger",
    "bundle.id": "183",
    "bundle.name": "org.openhab.core.io.net",
    "bundle.version": "5.1.1"
},
[...]
{
    "timestamp": "2026-02-03T21:59:36.344",
    "level": "WARN",
    "message": "Failed to execute commandLine '[/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python, /var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py, back_to_schedule, -z, 5]'",
    "threadName": "OH-rule-tado-API-1",
    "threadId": 1137,
    "loggerName": "org.openhab.core.io.net.exec.ExecUtil",
    "loggerFQCN": "org.ops4j.pax.logging.slf4j.Slf4jLogger",
    "bundle.id": "183",
    "bundle.name": "org.openhab.core.io.net",
    "bundle.version": "5.1.1"
},
{
    "timestamp": "2026-02-03T22:00:21.357",
    "level": "WARN",
    "message": "Failed to execute commandLine '[/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python, /var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py, back_to_schedule, -z, 5]'",
    "threadName": "OH-scheduler-22923",
    "threadId": 582844,
    "loggerName": "org.openhab.core.io.net.exec.ExecUtil",
    "loggerFQCN": "org.ops4j.pax.logging.slf4j.Slf4jLogger",
    "bundle.id": "183",
    "bundle.name": "org.openhab.core.io.net",
    "bundle.version": "5.1.1"
}

I now assume this problem has been around for a long time, but I recently added scripts that control my heating, which makes it easier to spot this problem.

Does anyone have any idea what might be going wrong, or how I could increase logging, so more clues reveal themselves?

It gives you the logger name there in the JSON so my first recommendation would be to put that logger into TRACE level logging. You might want to put it into a different log file if there’s a lot. The timestamp of open of these entries should tell you where to look in openhab.log.

I know nothing about critical.log though. Is this something you set up? I don’t see anything in log4j2.xml to write to that log file.

Aha, turns out you’re right. I created it myself, in order to get an error overview (which I someday hope to really use…): Getting daily error overview - #16 by Oliver2.

Like this, right?

<Configuration>
	<Appenders>
		<RollingRandomAccessFile fileName="${sys:openhab.logdir}/ExecUtil.log" filePattern="${sys:openhab.logdir}/ExecUtil.log.%i" name="EXECUTIL">
			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c - %-10.10tid] - %m%n"/>
				<Policies>
					<OnStartupTriggeringPolicy/>
					<SizeBasedTriggeringPolicy size="100 MB"/>
				</Policies>
		</RollingRandomAccessFile>
	</Appenders>
	<Loggers>
		<Logger additivity="false" level="TRACE" name="org.openhab.core.io.net.exec.ExecUtil">
			<AppenderRef ref="EXECUTIL"/>
		</Logger>
	</Loggers>

</Configuration>

That looks right but I’m not a computer so can’t say there isn’t a typo or something like that in there. Try it out and see if it works.

The log turns out to be less informative than I had hoped:

2026-02-14 00:00:03.576 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil - 492858    ] - Timeout occurred when executing commandLine '[/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python, /var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py, set_schedule_type, -s, 0]'

This is the JavaScript code that was run:

var pythoninvenv = '/var/lib/openhab/bin/python/tado-manual-control/venv/bin/python';
var pythonscript = '/var/lib/openhab/bin/python/tado-manual-control/tado-manual-control.py';

function callPython(command) {
  var pythonOutput = actions.Exec.executeCommandLine(time.Duration.ofSeconds(3), command);
  console.log("python output = "+pythonOutput);
}


function startVakantieschemaTado() {
  var command = [pythoninvenv, pythonscript, 'set_schedule_type', '-s',  '0'];
  callPython(command);
}

startVakantieschemaTado();

I suppose I should make the time-out longer…

I had som i stabillity with python too, so recently me and my AI gemini have been converting alot of python and node scripts to run ad .js scrip instead.

Done this for balboa swimspa integration and Homey P1 energymeter dongle.

I dont know if that could be a way for you or not.

No, the python script relies on an external library…

btw (sorry off-topic): how do you integrate your balboa spa? Is it the one with wifi-module? I use a very old unofficial ported binding and every oh-update I’m terrified it might not work anymore.

Hi

I wrote this post earlier, and now I converted the python scripts to js and it seems like it’s running smooth. If the .js scrips run really smooth they will bu added to the post below. It’s been running for a few weeks now, but i do some tweaking now and then still.

Balboa hottub integration without wifi module - Hardware / Home Automation - openHAB Community

1 Like

Hi

I wrote this post earlier, and now I converted the python scripts to js and it seems like it’s running smooth. If the .js scrips run really smooth they will bu added to the post below. It’s been running for a few weeks now, but i do some tweaking now and then still.

Balboa hottub integration without wifi module - Hardware / Home Automation - openHAB Community