The log is saying: [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine ‘[node, /openhab/conf/scripts/test.js]’
The owner of the file is set to 9001:9001 which is the openhab user/group. The script is working when I ssh into the host machine. So I guess docker may be the problem. Normal bash scripts can be called from Openhab. I’ve tried everything that came to my mind for hours and I’m out of options now. Any idea? Could it simply be that node is not available in the container? If so, I have no idea how to install it. Thank you for help.
Yes, of course node is not available in the container. The main point of a container is to contain just enough to run the one service. openHAB doesn’t require node so node isn’t installed. Neither is Python nor SSH, nor X nor a whole host of other stuff. In fact, for a long time even ping wasn’t installed.
The proper Docker answer would be that you shouldn’t install node into the container. You should set up a separate container with a node service that openHAB calls via some API (e.g. MQTT, REST HTTP call, etc.). The whole point of Docker is to isolate all the services from each other. When you put it all in one container, you’ve lost the flexibility Docker offers and you may as well just run on bare metal or a VM.
But that’s not always practical. So you have two options:
build a new custom image using the openHAB image as the base and install node that way