Claude/kasm manager start period - #104
Merged
thespad merged 2 commits intoAug 7, 2026
Merged
Conversation
The Dockerfile makes proxy wait for both kasm_manager and kasm_api to be healthy, then gives kasm_api a healthcheck grace period so that gate is usable on a slow host. kasm_manager is gated the same way but never got the same treatment, so on a cold start it can exhaust its retries and report unhealthy before it is ready. Compose only aborts a service_healthy wait when the dependency reports unhealthy; while it reports starting it waits indefinitely. So the missing grace period is what turns a slow start into: dependency failed to start: container kasm_manager is unhealthy s6-rc: warning: unable to start service svc-kasm: command exited 1 proxy is then left created and never started, and so is kasm_rdp_https_gateway, which depends on proxy. kasm_manager becomes healthy moments later, but svc-kasm is a oneshot, so nothing starts them: the container serves its installation wizard while KASM_PORT stays dead until /opt/kasm/bin/start is run by hand. Apply the same start_period and start_interval to kasm_manager, on both architectures.
There was a problem hiding this comment.
Thanks for opening this pull request! Be sure to follow the pull request template!
thespad
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The Dockerfile makes
proxywait for bothkasm_managerandkasm_apito be healthy:and then gives a healthcheck grace period to
kasm_apiso that gate is usable on a slow host:yq -i '.services.kasm_api.healthcheck += {"start_period": "60s","start_interval": "30s"}'kasm_manageris gated the same way but never got the same treatment. It keeps the stock healthcheck, which has no grace period suited to being used as a startup gate, so on a cold start it can exhaust its retries and reportunhealthybefore it is ready.This change applies the same
start_periodandstart_intervaltokasm_manager, immediately after thekasm_apiline. Same values, same mechanism, no new concept. Replicated inDockerfile.aarch64as per the contributing guidelines, and a changelog entry added toreadme-vars.yml.Benefits of this PR and context:
closes #103
Without a grace period, a slow cold start makes Compose abort the whole
up, because Compose only gives up on aservice_healthywait when the dependency reportsunhealthy— while it reportsstartingit waits indefinitely (pkg/compose/convergence.go):So a
start_periodis exactly what turns this failure into a successful wait.When it aborts, the result is:
proxyis left increatedand never started, and so iskasm_rdp_https_gateway, which the Dockerfile makes depend onproxy.kasm_managerbecomes healthy moments later, butsvc-kasmis aoneshot, so nothing runs/opt/kasm/bin/startagain and the container stays half started indefinitely: the installation wizard on port 3000 answers, because it runs in the outer container, whileKASM_PORTis dead until someone runsdocker exec kasm /opt/kasm/bin/startby hand.This is especially unpleasant behind a reverse proxy that uses Docker service discovery. Traefik's Docker provider skips any container whose health is not
healthy(pkg/provider/docker/config.go) without logging anything, so Kasm silently never gets a route and nothing anywhere points at the real cause.How Has This Been Tested?
Reported from a deployment on
1.19.0-ls139, Docker Engine 28.x, x86-64, on a host wherekasm_manageris consistently slow to become healthy. Every recreation of the container reproduced the failure, and running/opt/kasm/bin/startby hand afterwards recovered it every time, which is what identified the dependency wait as the failing step. Full container log anddocker ps -aoutput are in #103.Please note this change itself has not been verified by rebuilding the image, since I could not reproduce the build pipeline locally — the reasoning rests on the existing
kasm_apiline doing exactly this and on the Compose behaviour quoted above. Happy to adjust the values or the approach if you would rather solve it differently, for instance by retrying/opt/kasm/bin/startinsvc-kasm/run, which is aoneshottoday and so makes any transient boot failure permanent.Source / References:
Generated by Claude Code and reviewed by @tigerblue77