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

[2.4.0] First time kamal setup fails when an accessory has proxy: section #1307

Open
pokonski opened this issue Dec 18, 2024 · 0 comments · May be fixed by #1308
Open

[2.4.0] First time kamal setup fails when an accessory has proxy: section #1307

pokonski opened this issue Dec 18, 2024 · 0 comments · May be fixed by #1308

Comments

@pokonski
Copy link

pokonski commented Dec 18, 2024

Setting up kamal with kamal setup on a brand new Ubuntu VM (hetzner), fails with No such container: kamal-proxy

It looks like setup command is not running kamal:cli:proxy:boot before booting accessories. should that now be executed unconditionally or only when an accessory has the proxy: section?

Feature introduced in 2.4.0 in #981

My proposed fix here: #1308

Output:

kamal setup
  INFO [545724da] Running /usr/bin/env mkdir -p .kamal on 123.123.123.123
  INFO [545724da] Finished in 1.561 seconds with exit status 0 (successful).
Acquiring the deploy lock...
Ensure Docker is installed...
  INFO [db7c098e] Running docker -v on 123.123.123.123
  INFO [db7c098e] Finished in 0.152 seconds with exit status 127 (failed).
  INFO [41c3f18c] Running [ "${EUID:-$(id -u)}" -eq 0 ] || command -v sudo >/dev/null || command -v su >/dev/null on 123.123.123.123
  INFO [41c3f18c] Finished in 0.160 seconds with exit status 0 (successful).
  INFO Missing Docker on 123.123.123.123. Installing…
  INFO [21366e3f] Running /usr/bin/env sh -c 'curl -fsSL https://get.docker.com || wget -O - https://get.docker.com || echo "exit 1"' | sh on 123.123.123.123
  INFO [21366e3f] Finished in 17.154 seconds with exit status 0 (successful).
  INFO [1681b27a] Running docker login ghcr.io -u [REDACTED] -p [REDACTED] on 123.123.123.123
  INFO [1681b27a] Finished in 0.616 seconds with exit status 0 (successful).
  INFO [2ec90e33] Running docker network create kamal on 123.123.123.123
  INFO [2ec90e33] Finished in 0.270 seconds with exit status 0 (successful).
  INFO [879d2dc0] Running /usr/bin/env mkdir -p .kamal/apps/example/env/accessories on 123.123.123.123
  INFO [879d2dc0] Finished in 0.158 seconds with exit status 0 (successful).
  INFO Uploading .kamal/apps/example/env/accessories/imgproxy.env 100.0%
  INFO [238cf393] Running docker run --name example-imgproxy --detach --restart unless-stopped --network kamal --log-opt max-size="10m" --env IMGPROXY_KEY="deadbeef" --env IMGPROXY_SALT="deadbeef" --env-file .kamal/apps/example/env/accessories/imgproxy.env --label service="example-imgproxy" ghcr.io/imgproxy/imgproxy:latest on 123.123.123.123
  INFO [238cf393] Finished in 4.197 seconds with exit status 0 (successful).
  INFO [5cf3b40e] Running docker container ls --filter name=^example-imgproxy$ --quiet on 123.123.123.123
  INFO [5cf3b40e] Finished in 0.176 seconds with exit status 0 (successful).
  INFO [6313e983] Running docker exec kamal-proxy kamal-proxy deploy example-imgproxy --target="13eb22bac12f:8080" --host="images.my-domain.com" --deploy-timeout="30s" --drain-timeout="30s" --health-check-path="/health" --buffer-requests --buffer-responses --log-request-header="Cache-Control" --log-request-header="Last-Modified" --log-request-header="User-Agent" on 123.123.123.123
Releasing the deploy lock...
  Finished all in 31.7 seconds
  ERROR (SSHKit::Command::Failed): Exception while executing on host 123.123.123.123: docker exit status: 1
docker stdout: Nothing written
docker stderr: Error response from daemon: No such container: kamal-proxy

deploy.yml

service: example

image: my-org/repo
registry:
  server: ghcr.io
  username:
    - KAMAL_REGISTRY_USER
  password:
    - KAMAL_REGISTRY_PASSWORD
builder:
  arch: arm64

servers:
  web:
    - 123.123.123.123
proxy:
  ssl: false
  host: my-domain.com
  app_port: 3000

env:
  secret:
    - RAILS_MASTER_KEY
    - DATABASE_URL

accessories:
  imgproxy:
    image: ghcr.io/imgproxy/imgproxy:latest
    host: 123.123.123.123
    proxy:
      ssl: false
      host: images.my-domain.com
      app_port: 8080
      healthcheck:
        path: /health
    env:
      clear:
        IMGPROXY_KEY: "deadbeef"
        IMGPROXY_SALT: "deadbeef"
@pokonski pokonski linked a pull request Dec 18, 2024 that will close this issue
@pokonski pokonski changed the title [2.4.0] First time kamal setup fails when accessory has proxy: section [2.4.0] First time kamal setup fails when an accessory has proxy: section Dec 18, 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

Successfully merging a pull request may close this issue.

1 participant