Help with "Cannot run program 'sh': error=0, Failed to exec spawn helper"

Hi everyone,

I’ve been struggling with the following error when running shell commands or scripts in OpenHAB:

Cannot run program "sh": error=0, Failed to exec spawn helper  

I’ve tried several solutions found on the forums, including:

  • Restarting the OpenHAB service or the entire system
  • Adjusting script permissions
  • Adding commands to exec.whitelist

These approaches only provide temporary fixes, and the problem keeps coming back.

Has anyone found a permanent, reliable fix for this issue?
If it’s related to Java configuration, OpenHAB updates, or OS-level settings, I’d be grateful for clear guidance.

Thanks a lot for your insights and help!

I experienced the same a year ago, and this fixed it for me: executeCommandLine fails with Java exception "Failed to exec spawn helper" - #2 by seime

Maybe a solution for standard openhabian? Or for the openhab distro?