{"record":{"id":"90687ed6601d39a2","repo":"basecamp/kamal","slug":"failed-to-get-endpoint-for-role-on-host-did","errorCode":null,"errorMessage":"Failed to get endpoint for #{role} on #{host}, did the container boot?","messagePattern":"Failed to get endpoint for #(.+?) on #(.+?), did the container boot\\?","errorType":"exception","errorClass":"Kamal::Cli::BootError","httpStatus":null,"severity":"critical","filePath":"lib/kamal/cli/app.rb","lineNumber":54,"sourceCode":"          execute *KAMAL.auditor.record(\"Tagging #{KAMAL.config.absolute_image} as the latest image\"), verbosity: :debug\n          execute *KAMAL.app.tag_latest_image\n        end\n      end\n    end\n  end\n\n  desc \"start\", \"Start existing app container on servers\"\n  def start\n    modify(lock: true) do\n      on_roles(KAMAL.roles, hosts: KAMAL.app_hosts, parallel: KAMAL.config.boot.parallel_roles) do |host, role|\n        app = KAMAL.app(role: role, host: host)\n        execute *KAMAL.auditor.record(\"Started app version #{KAMAL.config.version}\"), verbosity: :debug\n        execute *app.start, raise_on_non_zero_exit: false\n\n        if role.running_proxy?\n          version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip\n          endpoint = capture_with_info(*app.container_id_for_version(version)).strip\n          raise Kamal::Cli::BootError, \"Failed to get endpoint for #{role} on #{host}, did the container boot?\" if endpoint.empty?\n\n          execute *app.deploy(target: endpoint)\n        end\n      end\n    end\n  end\n\n  desc \"stop\", \"Stop app container on servers\"\n  def stop\n    modify(lock: true) do\n      on_roles(KAMAL.roles, hosts: KAMAL.app_hosts, parallel: KAMAL.config.boot.parallel_roles) do |host, role|\n        app = KAMAL.app(role: role, host: host)\n        execute *KAMAL.auditor.record(\"Stopped app\", role: role), verbosity: :debug\n\n        if role.running_proxy?\n          version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip\n          endpoint = capture_with_info(*app.container_id_for_version(version)).strip\n          if endpoint.present?","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/basecamp/kamal/blob/eee0083b38661c3707c6b6052cc89e85038a096c/lib/kamal/cli/app.rb#L36-L72","documentation":"`kamal app start` starts existing app containers. When a role is configured with proxy: true (e.g. running Kamal's own proxy bundled in the app container), Kamal must re-point the proxy at the freshly started container: it captures the currently running version, then looks up the container id for that version with `docker ps -q`. If that lookup comes back empty, the container is not actually running, so there is no endpoint to deploy traffic to and Kamal raises Kamal::Cli::BootError.","triggerScenarios":"`kamal app start` (or `kamal redeploy`/`kamal deploy` reaching the start step) on a role with running_proxy? true, where `app.start` did not result in a running container: crashed image, missing env/secrets, wrong port, or the container exits immediately after starting. The error fires on the host/role named in the message.","commonSituations":"App container crash-loops after a host reboot or docker restart because the image was pruned; role-level env or secrets file missing so entrypoint fails; version captured via container_id_for_version returns nothing because the old container was already removed; mixing kamal proxy roles with manually managed containers.","solutions":["Inspect why the container is not running on the failing host: `kamal app logs -h <host>` (or ssh in and `docker ps -a`, `docker logs <container>`).","Fix the root cause (missing secrets/env, bad image tag, crashed entrypoint), then re-run `kamal app start`.","If the image/container was removed, run a full `kamal deploy` (or `kamal app boot`) instead of start, since start only starts an existing container.","Verify the role's proxy/labels config matches a container that exposes the expected endpoint."],"exampleFix":"# before\nkamal app start   # -> Failed to get endpoint for web on 1.2.3.4, did the container boot?\n# after: find and fix the crashed container first\nkamal app logs -h 1.2.3.4\nkamal deploy      # boots a fresh version instead of starting a dead one","handlingStrategy":"try-catch","validationCode":"# Before `kamal app start`, confirm a container exists for the role on each host:\n# `kamal app details` shows versions; or per host:\n# ssh <host> docker ps -a --filter name=<service>-<role> --format '{{.Names}} {{.Status}}'\n# Only run `app start` when a stopped container is present.","typeGuard":"def container_present?(service, role, host)\n  out = `ssh #{host} docker ps -aq --filter name=#{service}-#{role}`\n  !out.strip.empty?\nend","tryCatchPattern":"begin\n  Kamal::CLI::App.new.start\nrescue Kamal::Cli::BootError => e\n  warn \"app did not come up: #{e.message}\"\n  `kamal app logs`  # capture diagnostics before re-raising\n  raise\nend","preventionTips":["Treat `kamal app start` as start-existing-only; use a full deploy when the container/image may be gone.","Monitor container status after host reboots (systemd/docker restart policies) so start never runs against a removed container.","Validate secrets/env for proxy roles before restart windows."],"tags":["kamal","deploy","boot","proxy","container","docker"],"backgroundTag":"container-failed-to-start","analyzedSha":"eee0083b38661c3707c6b6052cc89e85038a096c","analyzedAt":"2026-08-21T15:17:22.045Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}