Run a shell script using kubectl exec - OCI runtime exec failed: exec failed: container_linux.go:346

2/15/2021

I am trying a run a shell script via kubectl exec.

Eg- kubectl exec -n abc podxyz -- /root/test/./generate.sh

The script runs in the podxyz container but returns the below error, breaking the rest of the flow.

"command terminated with exit code 126"]

"OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused \"no such file or directory\": unknown"]}

I have tried to use -- /bin/sh and bash after the -- , but that did not help. Note - the above command is executed as part of another script.

-- Dilip
hyperledger
kubernetes
shell

0 Answers