{"record":{"id":"31060f84c3e75df4","repo":"nektos/act","slug":"health-interval-cannot-be-negative","errorCode":null,"errorMessage":"--health-interval cannot be negative","messagePattern":"--health-interval cannot be negative","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":586,"sourceCode":"\tvar healthConfig *container.HealthConfig\n\thaveHealthSettings := copts.healthCmd != \"\" ||\n\t\tcopts.healthInterval != 0 ||\n\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,","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L568-L604","documentation":"Error [86]: After a successful ExecCreate, the ExecAttach API call (opening the hijacked stream to the exec) failed. The exec instance exists but act could not attach its stdin/stdout/stdout pipes. Usually a connection-level failure to the daemon or the exec expired/was cleaned up between create and attach.","triggerScenarios":"cr.cli.ExecAttach erroring: daemon connection dropped (socket closed/TCP reset), exec instance removed before attach, or TTY mismatch with the daemon's expectations.","commonSituations":"DOCKER_HOST over tcp/ssh with flaky networking; Docker Desktop memory pressure restarting the daemon; heavy parallel execs timing out the attach window; VPN interfering with remote docker sockets.","solutions":["If DOCKER_HOST is remote, test stability: docker info repeatedly / switch to local socket","Reduce parallelism (act -j sequential) to lower daemon pressure","Restart Docker Desktop / dockerd if the socket is in a bad state, then re-run","Update Docker Engine; older daemons had attach race bugs"],"exampleFix":"# before: remote flaky socket\nexport DOCKER_HOST=tcp://flaky-host:2375\n# after: local or reliable socket\nunset DOCKER_HOST  # use /var/run/docker.sock","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var lastErr error\nfor i := 0; i < 3; i++ {\n\tlastErr = run(ctx)\n\tif lastErr == nil || !strings.Contains(lastErr.Error(), \"failed to attach to exec\") {\n\t\tbreak\n\t}\n\ttime.Sleep(time.Duration(i+1) * time.Second) // backoff, daemon may recover\n}","preventionTips":["Prefer unix socket DOCKER_HOST over tcp for local runs","Keepalives on ssh-tunneled docker sockets","Avoid daemon overload: cap parallel jobs"],"tags":["docker","exec-attach","network","daemon"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}