#Failed to transfer dagger-engine-session bin, docker resolves to executable in current directory
1 messages Β· Page 1 of 1 (latest)
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"
if I change docker to ./docker. π I think that's enough for me tonight.
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
Whenever I change this to also print the working directory and the contents of the directory, it looks like it's running in the container.
https://github.com/dagger/dagger/blob/main/sdk/go/internal/engineconn/dockerprovision/image.go#L70
I can share the value of $PATH in a moment! Do you want my local $PATH or the one in the container?
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. 
#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.
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