{"record":{"id":"69dcfdfe606e5f2c","repo":"nektos/act","slug":"health-start-period-cannot-be-negative","errorCode":null,"errorMessage":"--health-start-period cannot be negative","messagePattern":"--health-start-period cannot be negative","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/docker_cli.go","lineNumber":595,"sourceCode":"\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,\n\t\t}\n\t}\n\n\tdeviceRequests := copts.gpus.Value()\n\tif len(cdiDeviceNames) > 0 {\n\t\tcdiDeviceRequest := container.DeviceRequest{","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/docker_cli.go#L577-L613","documentation":"Error [89]: The step's command inside the container exited with a non-zero code that is not 127. The wrapped number is the command's actual exit status. Act surfaces it as the step failure — this is the normal mechanism by which a failing run: step (or exec) fails the job. Fix the command/script, not act.","triggerScenarios":"Any Exec in the container (run step, git clone, chown, action entrypoint) whose process exits non-zero: failing tests, missing files, permission denied, failed tool invocations.","commonSituations":"A test suite failing inside act like it would on GitHub Actions; git safe.directory errors when act runs as a different UID inside the container; permission errors from bind mounts; environment differences (env vars set on GH but not locally).","solutions":["Read the step's stdout/stderr just above the error — the real failure is printed there","Reproduce locally: docker run --rm -it <image> <command> and iterate","For git 'dubious ownership': git config --global --add safe.directory '*' inside the container","Compare env/context: use act -v or add env dumps to see missing variables vs real CI"],"exampleFix":"# before\n- run: npm test   # exits 1\n# after (make failure diagnosable / fix the cause)\n- run: npm test || (cat /path/log; exit 1)","handlingStrategy":"try-catch","validationCode":"null // exit codes are the app under test; validate the command/toolchain exists instead\nif _, err := exec.LookPath(\"docker\"); err != nil { log.Fatal(err) }","typeGuard":null,"tryCatchPattern":"if err := job(ctx); err != nil {\n\tif m := regexp.MustCompile(`exitcode '(\\d+)': failure`).FindStringSubmatch(err.Error()); m != nil {\n\t\tlog.Printf(\"step failed with exit %s — see output above\", m[1])\n\t}\n}","preventionTips":["Read streamed step output before debugging act itself","Reproduce failing commands with docker run directly","Add git safe.directory config inside containers"],"tags":["docker","exit-code","step-failure","user-error"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}