Description
OS Information
- OS: macOS (Intel, amd64)
coder --version
: Coder v0.0.0-devel+ba818b3 Wed May 18 00:07:20 UTC 2022 ba818b3
Steps to Reproduce
- Have
coder
repo in some fringe state with old builds and what not - Run
make bin
- Run
coder server --dev ...
- Run
coder templates create -d examples/docker-local
- Run
coder create dev
- See error in Docker container:
Syntax error: redirection unexpected
(not reproducible aftermake build
)
Expected
No error, or protection against serving an incompatible agent binary.
It seems coder server
is serving an incompatible agent
for the given architecture. I'm not entirely sure how my project ended up in that state, but it's something that could possibly trip up someone contributing to this project, or prefer to build it themselves.
Actual
Workspace creation fails:
docker_container.workspace[0]: Creating...
docker_container.workspace[0]: Creation errored after 1s
Error: container exited immediately
✘ Starting workspace [5921ms]
exit status 1
(The lack of error information is already documented in #1544, this is not about that.)
If we view the docker log we simply see:
Syntax error: redirection unexpected
Indicating that the binary was incompatible with the target architecture (server macOS amd64, container linux amd64).
Notes
I've not dug into exactly what went wrong here, it could be that the issue sits between keyboard and chair.
Running make bin
isn't perhaps the supported approach, but I imagine simply running go build -tags embed ./cmd/coder
or make dev
could have similar issues given the right circumstance.