Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with using docker with FTL introduced in v0.215.0 #1523

Closed
alec-brooks opened this issue May 17, 2024 · 2 comments
Closed

Issues with using docker with FTL introduced in v0.215.0 #1523

alec-brooks opened this issue May 17, 2024 · 2 comments
Assignees

Comments

@alec-brooks
Copy link
Contributor

alec-brooks commented May 17, 2024

It seems that v0.215.0 has introduced a bug where it is no longer possible to run commands such as ftl serve locally.

I am attempting to run these commands in the ftl repo using the ftl script located at scripts/ftl.

Below is some of my terminal output that demonstrates this bug having been introduced in v0.215.0.

ftl🐚 ftl ((v0.214.0)) $ which ftl             
/Users/abrooks/Development/ftl/scripts/ftl
ftl🐚 ftl ((v0.214.0)) $ ftl serve
trace: Loading config from /Users/abrooks/Development/ftl/ftl-project.toml
trace: /xyz.block.ftl.v1.ControllerService/Ping (unary)
trace:localhost: Trying authenticator
trace:localhost: No authenticator found for http://localhost:8892/xyz.block.ftl.v1.ControllerService/Ping in map[ftl.tbddev.org:ftl-authenticator-tbddev]
debug: Unary RPC failed: unavailable: dial tcp [::1]:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/Ping
info: Starting FTL with 1 controller(s)
trace: exec: cd . && docker ps -a --filter name=^/ftl-db-1\$ --format \{\{.Names}}
trace: exec: cd . && docker start ftl-db-1
trace: exec: cd . && docker port ftl-db-1 5432/tcp
debug: Reusing existing docker container "ftl-db-1" on port "54320" for postgres db
debug: Waiting for ftl-db-1 to be healthy
trace: exec: cd . && docker inspect --format \{\{.State.Health.Status}} ftl-db-1
debug: Postgres DSN: postgres://postgres:secret@localhost:54320/ftl?sslmode=disable
^Cdebug: FTL terminating with signal interrupt
ftl🐚 ftl ((v0.214.0)) $ git checkout tags/v0.215.0
Previous HEAD position was c3c7077f feat: use secrets instead of env vars for DSNs (#1483)
HEAD is now at 9860ee37 feat: use docker api instead of exec (fixes #1169) (#1488)
ftl🐚 ftl ((v0.215.0)) $ ftl serve
trace: Loading config from /Users/abrooks/Development/ftl/ftl-project.toml
trace: /xyz.block.ftl.v1.ControllerService/Ping (unary)
trace:localhost: Trying authenticator
trace:localhost: No authenticator found for http://localhost:8892/xyz.block.ftl.v1.ControllerService/Ping in map[ftl.tbddev.org:ftl-authenticator-tbddev]
debug: Unary RPC failed: unavailable: dial tcp [::1]:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/Ping
info: Starting FTL with 1 controller(s)
ftl: error: failed to list containers: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ftl🐚 ftl ((v0.215.0)) $ docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED       STATUS                  PORTS                     NAMES
b4ba4dff08de   postgres:latest   "docker-entrypoint.s…"   7 weeks ago   Up 20 hours (healthy)   0.0.0.0:54320->5432/tcp   ftl-db-1

It is worth noting that I am running on an M1 MBP running macOS 14.4.1. Using Docker Desktop for macOS.
Docker desktop stats below:
Version: 4.29.0 (145265)
Engine: 26.0.0
Compose: v2.26.1-desktop.1
Credential Helper: v0.8.1
Kubernetes: v1.29.2

@github-actions github-actions bot added the triage Issue needs triaging label May 17, 2024
@ftl-robot ftl-robot mentioned this issue May 17, 2024
@github-actions github-actions bot removed the triage Issue needs triaging label May 17, 2024
@alecthomas
Copy link
Collaborator

alecthomas commented May 17, 2024

@gak not urgent, as Alec has a workaround for now, but we should try and figure out why client.FromEnv isn't working in this scenario, and I guess why the docker CLI is working, and try and emulate whatever it's doing.

@gak
Copy link
Contributor

gak commented May 17, 2024

The fix was a setting in Docker Desktop allowing the socket to be available:

Settings -> Advanced (it was not obvious for me--had to scroll the left pane down) -> "Allow the default Docker socket to be used (requires password)" -> Needs to be enabled

@gak gak closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants