{"record":{"id":"85a9bb9594e51569","repo":"argoproj/argo-workflows","slug":"stat-supervisor-status-w","errorCode":null,"errorMessage":"stat supervisor status: %w","messagePattern":"stat supervisor status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/emissary.go","lineNumber":526,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n}\n\n// evaluateSupervisorStatus reads the status marker once and decides whether main\n// can stop waiting. done=false means keep waiting. start is main's wait-start\n// reference, used to bound the case where the marker never appears at all. It is\n// safe to call concurrently — it only reads the filesystem.\nfunc evaluateSupervisorStatus(statusPath string, timeout time.Duration, start time.Time) (done bool, err error) {\n\tfi, statErr := os.Stat(statusPath)\n\tif statErr != nil {\n\t\tif os.IsNotExist(statErr) {\n\t\t\tif time.Since(start) > timeout {\n\t\t\t\treturn true, fmt.Errorf(\"supervisor presumed dead: status marker never appeared within %s\", timeout)\n\t\t\t}\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, fmt.Errorf(\"stat supervisor status: %w\", statErr)\n\t}\n\tbody, readErr := os.ReadFile(statusPath)\n\tif readErr != nil {\n\t\t// Stat just succeeded, so a read failure here means we raced the\n\t\t// supervisor's atomic rename (the old inode vanished between stat and\n\t\t// read). Treat it as transient and re-evaluate on the next tick/event\n\t\t// rather than failing the wait.\n\t\t//nolint:nilerr // deliberate: swallow the transient read error and retry\n\t\treturn false, nil\n\t}\n\ttoken, message := parseSupervisorStatus(body)\n\tswitch token {\n\tcase statusReady:\n\t\treturn true, nil\n\tcase statusFailed:\n\t\treturn true, fmt.Errorf(\"supervisor reported pre-main failure: %s\", message)\n\tdefault:\n\t\t// RUNNING, or a transient/partial read: the supervisor is alive only if","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/emissary.go#L508-L544","documentation":"When polling the supervisor status marker, a stat error other than NotExist (e.g. EACCES, ELOOP, or the containing directory vanished) is treated as fatal and returned wrapped as 'stat supervisor status'. Unlike a read failure right after stat (which is a benign rename race), a failing stat cannot be retried safely, so the wait terminates with this error.","triggerScenarios":"os.Stat on /var/run/argo/ctr/<name>/status returns a non-IsNotExist error during waitForSupervisorReady — permission denied on the directory, path became a symlink loop, or the ctr directory was deleted mid-run.","commonSituations":"Something in the pod removing /var/run/argo/ctr/<container>; restrictive securityContext blocking access to /var/run/argo; corrupted tmpfs/emptyDir backing /var/run/argo.","solutions":["Read the wrapped errno in the full error to identify the exact stat failure","Ensure no sidecar/init process deletes or chmods /var/run/argo/ctr/<name> while the workflow runs","Run the container with a securityContext that keeps access to /var/run/argo (default should suffice; check fsGroup/readOnly tweaks)","Re-run the workflow; persistent occurrence warrants collecting argoexec debug logs and an issue report"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Ensure nothing mutates /var/run/argo mid-run; verify from a debug pod:\nkubectl exec -it <pod> -c init -- ls -la /var/run/argo/ctr/\n# The ctr/<name> directory must persist for the lifetime of the pod.","typeGuard":null,"tryCatchPattern":"if err := waitForSupervisorReady(ctx); err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) && perr.Op == \"stat\" {\n        log.Printf(\"status marker stat failed path=%s err=%v\", perr.Path, perr.Err)\n        // EACCES -> securityContext; ENOENT after dir removal -> rogue process\n    }\n    return err\n}","preventionTips":["Do not run sidecars that clean or chmod /var/run/argo","Keep default securityContext; avoid restrictive fsGroup/readOnly overrides on /var/run","Re-run once on transient stat failures before treating as a product bug","Collect argoexec debug logs when reproducible"],"tags":["kubernetes","argo-workflows","argoexec","supervisor","filesystem"],"backgroundTag":"supervisor-not-ready","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}