#Error exec static executable file not found in $PATH 19

3 messages · Page 1 of 1 (latest)

reef turtle
#

For some reason executing relative commands (I'm not convinced this has anything to do with containers) fails with the above error, despite that command being in the $PATH which can be verified with command -v.

Here's a sample debug run:

localhost:~# ./box run prologic/static
2022/09/15 22:51:05 newCmd.Start() called
2022/09/15 22:51:05 newCmd.Wait() called
INFO[0000] Running command "static" with args #[] in container...
INFO[0000] Setting container env to: []string{"PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.14.2", "GOPATH=/go"}
Error: exec: "static": executable file not found in $PATH
2022/09/15 22:51:05 newCmd.Wait() ended
localhost:~#

See: https://git.mills.io/prologic/box/issues/19

I don't get it 🤦‍♂️ I thought it might be the new Go 1.19 DotErr behaviour that was introduced, but I disabled that and still the same result. Any ideas? 🤔

#

Oh dear god, this looks like its trying to find the executable on the host-side, which makes sense, but I don't recall this behaviour in previous versions of the Go compiler and stdlib?

localhost:~# ./box run prologic/static
2022/09/15 23:04:06 newCmd.Start() called
2022/09/15 23:04:06 newCmd.Wait() called
INFO[0000] Running command "static" with args #[] in container...
INFO[0000] cmd.Err: &exec.Error{Name:"static", Err:(*errors.errorString)(0xc000234f10)}: exec: "static": executable file not found in $PATH

Hmmm?

reef turtle
#

Solved. I'm confusing shell behaviour with executing a process directly.