{"record":{"id":"bf5581d2cb5bf23f","repo":"nektos/act","slug":"health-timeout-cannot-be-negative","errorCode":null,"errorMessage":"--health-timeout cannot be negative","messagePattern":"--health-timeout cannot be negative","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":589,"sourceCode":"\t\tcopts.healthTimeout != 0 ||\n\t\tcopts.healthStartPeriod != 0 ||\n\t\tcopts.healthRetries != 0 ||\n\t\tcopts.healthStartInterval != 0\n\tif copts.noHealthcheck {\n\t\tif haveHealthSettings {\n\t\t\treturn nil, errors.New(\"--no-healthcheck conflicts with --health-* options\")\n\t\t}\n\t\thealthConfig = &container.HealthConfig{Test: []string{\"NONE\"}}\n\t} else if haveHealthSettings {\n\t\tvar probe []string\n\t\tif copts.healthCmd != \"\" {\n\t\t\tprobe = []string{\"CMD-SHELL\", copts.healthCmd}\n\t\t}\n\t\tif copts.healthInterval < 0 {\n\t\t\treturn nil, errors.New(\"--health-interval cannot be negative\")\n\t\t}\n\t\tif copts.healthTimeout < 0 {\n\t\t\treturn nil, errors.New(\"--health-timeout cannot be negative\")\n\t\t}\n\t\tif copts.healthRetries < 0 {\n\t\t\treturn nil, errors.New(\"--health-retries cannot be negative\")\n\t\t}\n\t\tif copts.healthStartPeriod < 0 {\n\t\t\treturn nil, errors.New(\"--health-start-period cannot be negative\")\n\t\t}\n\t\tif copts.healthStartInterval < 0 {\n\t\t\treturn nil, errors.New(\"--health-start-interval cannot be negative\")\n\t\t}\n\n\t\thealthConfig = &container.HealthConfig{\n\t\t\tTest:          probe,\n\t\t\tInterval:      copts.healthInterval,\n\t\t\tTimeout:       copts.healthTimeout,\n\t\t\tStartPeriod:   copts.healthStartPeriod,\n\t\t\tStartInterval: copts.healthStartInterval,\n\t\t\tRetries:       copts.healthRetries,","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L571-L607","documentation":"Error [87]: After running a command in the container, act calls ExecInspect to fetch the exit code; that API call failed. Act cannot determine success/failure of the step command because the daemon did not answer the inspect request for the finished exec instance.","triggerScenarios":"cr.cli.ExecInspect erroring after waitForCommand completed: daemon connection lost right after command end, exec record garbage-collected by the daemon before inspection, or API version incompatibility on the exec inspect endpoint.","commonSituations":"Daemon restart racing the end of a step; remote DOCKER_HOST with connection drops under load; very long-running steps where intermediate proxies (ssh -L, VPN) close idle streams.","solutions":["Check daemon health right after failure: docker info","If proxying the socket (ssh/VPN), extend keepalive/idle timeouts","Re-run the job; if reproducible only for long steps, shorten or split the step","Update Docker Engine to match the moby API version act uses (or set DOCKER_API_VERSION)"],"exampleFix":"# before: idle ssh tunnel drops\nssh -L /tmp/docker.sock:/var/run/docker.sock host &\n# after: keepalives on\nssh -o ServerAliveInterval=30 -o ServerAliveCountMax=6 -L /tmp/docker.sock:/var/run/docker.sock host &","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to inspect exec\") {\n\t// command output already streamed; treat as inconclusive, re-run the step once\n}","preventionTips":["Keep daemon connection alive during long steps (ServerAliveInterval on tunnels)","Update Docker Engine alongside act upgrades","Split very long steps so each exec finishes within proxy idle windows"],"tags":["docker","exec-inspect","daemon","exit-code"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}