#Failed to transfer dagger-engine-session bin, docker resolves to executable in current directory

1 messages Β· Page 1 of 1 (latest)

waxen roost
#

any idea as to why this might be happening? πŸ™ˆ

i'm not 100% sure where this command is running. Looking at the code it looks just like an os.Exec in the current working directory. In my pwd there is nothing named docker. The code I'm working with is a bit complex so I'm seeing if I can kind of find a reproducible example.

waxen roost
#

I modified dagger and added a go mod replace to do an ls -al right before execing the docker run --rm command and I don't see docker either. πŸ‘€

INFO[0016] #9 0.188 time="2022-12-02T04:21:01Z" level=info msg="-rw-r--r--    1 root     root           272 Nov 26 15:58 config.go"
INFO[0016] #9 0.188 time="2022-12-02T04:21:01Z" level=info msg="-rw-r--r--    1 root     root           172 Nov 26 15:58 counter.go"
INFO[0016] #9 0.188 time="2022-12-02T04:21:01Z" level=info msg="drwxr-xr-x   19 root     root          4096 Dec  2 04:16 dagger"
INFO[0016] #9 0.188 time="2022-12-02T04:21:01Z" level=info msg="drwxr-xr-x    9 root     root          4096 Dec  2 00:35 demo"
INFO[0016] #9 0.188 time="2022-12-02T04:21:01Z" level=info msg="-rw-r--r--    1 root     root          1651 Nov 26 15:58 docker-compose.yaml"
waxen roost
#

if I change docker to ./docker. πŸ˜‚ I think that's enough for me tonight.

inland oxide
#

Huh, can you share your $PATH env var? I'm wondering if it has a . in it anywhere: https://github.com/golang/go/issues/43724

That doesn't explain why go is claiming it resolves to an executable in your cwd even though it doesn't exist, but that's my only immediate hunch

waxen roost
waxen roost
#

So here's what I gathered after editing that file and adding checks for the os.Wd() and $PATH:

The container is just alpine:latest by the way.

#8 0.173 2022/12/02 15:29:34 PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

#8 0.173 2022/12/02 15:29:34 wd /

and if I change my workdir to my source code path

#8 0.156 2022/12/02 15:30:09 wd /opt/src

still the same failure. thinkies

#8 0.156 time="2022-12-02T15:30:09Z" level=fatal msg="error in execution" error="failed to transfer dagger-engine-session bin with command \"docker run --rm --entrypoint /bin/cat ghcr.io/dagger/engine:v0.3.7@sha256:9ad18aca71b1b1bae137d3ac5b8d1c62bd548d4f3b01c42b48120fdbc1490f22 /usr/bin/dagger-engine-session-linux-amd64\": docker resolves to executable in current directory (./docker)\nPlease visit https://dagger.io/help#go for troubleshooting guidance."

Very weird that the error is the same no matter what directory I'm in. I think that's a good clue that I'm looking in the wrong place.

waxen roost
#

yeah after a bunch of trying to isolate and reproduce it, it turned out to be that I was mounting a binary in my container and running it, and that binary was trying to run dagger. Not sure exactly how that works but changing the binary seemed to have resolved it. definitely user error

glad pivot
#

I was about to mention this. The log lines showing things like #9 or #8 seemed odd at the beginning since those prefixes are usually part of buildkit logs and not the dagger binary

#

so basically kevin you were accidentally doing dagger-in-dagger I'd assume