Getting "exec format error" when trying to run postprocess.sh file from Plex docker container

I’ve just switched over from windows to Docker on OpenMediaVault and I’m having trouble getting my DVR postprocessing script to run. The script runs fine from the host machine as the same user the Plex container is running from so I feel confident that it is good.

I am having trouble getting the script to run from within the container. It appeared that it was not running. I tried running the command from within the docker container and this is the error message:

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec format error": unknown

Here’s the script. Note that I am referencing everything to the correct paths as known by the container:

echo $1
echo "$1" >> /config/tools/handbrake.log
echo  "${1%.*}.mp4"  >> /config/tools/handbrake.log
/config/tools/handbrakecli  -i "$1" -o "${1%.*}.mp4" --preset="Very Fast 720p30" --encoder-preset="veryfast" -O --aencoder ac3 --ab 256 >> /config/tools/handbrake.log

The echo lines are just in there to see if any part of the script was working. Nothing worked at all. The handbrakecli executable is standalone.

I’m very new to docker so it may be something painfully obvious that I’m doing wrong and would appreciate any help on getting this working. Thanks!

First try running the script yourself from the command-line. You may find docker exec -it plex /bin/bash useful (substitute your container name in for plex).

My random guess is that you might resolve this by adding a #!/bin/bash as the first line of the file, but I’m not certain.

Thanks for the advice. Yes, the shebang needed to be added but it still did not work until I set the library path using:

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/

In the meantime I wrote a script to check for .ts files at midnight and then do the conversions. This allows me to watch the recordings right after they air and not have to wait for the transcoding to a smaller size to complete before I can watch the programs. I’m not sure if I will continue with this or add the line above to my post processing script, but at any rate this question is now solved for me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.