{"record":{"id":"921753123f022aa5","repo":"docker/compose","slug":"container-s-has-no-healthcheck-configured","errorCode":null,"errorMessage":"container %s has no healthcheck configured","messagePattern":"container (.+?) has no healthcheck configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/convergence.go","lineNumber":490,"sourceCode":"\t\tres, err := s.apiClient().ContainerInspect(ctx, c.ID, client.ContainerInspectOptions{})\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tctr := res.Container\n\t\tname := ctr.Name[1:]\n\n\t\tif ctr.State.Status == container.StateExited {\n\t\t\treturn false, fmt.Errorf(\"container %s exited (%d)\", name, ctr.State.ExitCode)\n\t\t}\n\n\t\tnoHealthcheck := ctr.Config.Healthcheck == nil || (len(ctr.Config.Healthcheck.Test) > 0 && ctr.Config.Healthcheck.Test[0] == \"NONE\")\n\t\tif noHealthcheck && fallbackRunning {\n\t\t\t// Container does not define a health check, but we can fall back to \"running\" state\n\t\t\treturn ctr.State != nil && ctr.State.Status == container.StateRunning, nil\n\t\t}\n\n\t\tif ctr.State == nil || ctr.State.Health == nil {\n\t\t\treturn false, fmt.Errorf(\"container %s has no healthcheck configured\", name)\n\t\t}\n\t\tswitch ctr.State.Health.Status {\n\t\tcase container.Healthy:\n\t\t\t// Continue by checking the next container.\n\t\tcase container.Unhealthy:\n\t\t\treturn false, fmt.Errorf(\"container %s is unhealthy\", name)\n\t\tcase container.Starting:\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\treturn false, fmt.Errorf(\"container %s had unexpected health status %q\", name, ctr.State.Health.Status)\n\t\t}\n\t}\n\treturn true, nil\n}\n\nfunc (s *composeService) isServiceCompleted(ctx context.Context, containers Containers) (bool, int, error) {\n\tfor _, c := range containers {\n\t\tres, err := s.apiClient().ContainerInspect(ctx, c.ID, client.ContainerInspectOptions{})","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/convergence.go#L472-L508","documentation":"Error \"container %s has no healthcheck configured\" thrown in docker/compose.","triggerScenarios":"Raised when a dependency condition requires 'service_healthy' but the target container defines no healthcheck, so compose can never observe a healthy state.","commonSituations":"The compose file uses depends_on with condition: service_healthy on a service whose definition (or image) lacks a HEALTHCHECK instruction.","solutions":["Add a healthcheck section to the service in the compose file, or drop the depends_on condition: service_healthy requirement.","Use condition: service_started instead of service_healthy if no healthcheck is needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}