{"record":{"id":"46a52f3b994e8cc5","repo":"argoproj/argo-workflows","slug":"w-46a52f","errorCode":null,"errorMessage":"%w","messagePattern":"%w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/supervisor.go","lineNumber":51,"sourceCode":"\tsupervisorHeartbeatInterval = 5 * time.Second\n\t// supervisorHeartbeatTimeout is how long main tolerates a status marker that\n\t// has neither appeared nor advanced before presuming the supervisor dead.\n\t// Generously larger than the interval so a GC pause or CPU starvation in the\n\t// supervisor doesn't trigger a false-positive death.\n\tsupervisorHeartbeatTimeout = 30 * time.Second\n\t// supervisorStatusPollInterval is how often main re-checks the marker's\n\t// freshness. inotify delivers the terminal READY/FAILED write promptly; this\n\t// poll exists only to notice the *absence* of heartbeats, which inotify can't.\n\tsupervisorStatusPollInterval = 2 * time.Second\n)\n\nfunc NewSupervisorCommand() *cobra.Command {\n\tcommand := cobra.Command{\n\t\tUse:   \"supervisor\",\n\t\tShort: \"init-less auxiliary: prepare main, signal readiness, then collect outputs\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif err := supervisorContainer(cmd.Context()); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%w\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn &command\n}\n\nfunc supervisorContainer(ctx context.Context) error {\n\treturn runAuxiliaryContainer(ctx,\n\t\tfunc(we *wfexecutor.WorkflowExecutor, ctx context.Context) (context.Context, trace.Span) {\n\t\t\treturn we.Tracing.StartRunSupervisorContainer(ctx, we.WorkflowName(), we.Namespace)\n\t\t},\n\t\tfunc(ctx, bgCtx context.Context, we *wfexecutor.WorkflowExecutor) error {\n\t\t\t// Heartbeat the status marker so main's emissary can tell a live (but\n\t\t\t// slow) supervisor from a dead one, rather than blocking to the pod\n\t\t\t// deadline. The initial write also overwrites any stale marker from a\n\t\t\t// prior attempt. Stop the heartbeat before the terminal write so no\n\t\t\t// heartbeat races it on the same path.","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/supervisor.go#L33-L69","documentation":"The `argoexec supervisor` cobra command (init-less pod layout) wraps any error from supervisorContainer with fmt.Errorf(\"%w\", err). This is a transparent pass-through wrapper: no message text is added and the original cause is preserved for errors.Is/errors.As. The real failure is inside the supervisor container lifecycle (prepare main, readiness signaling, or output collection).","triggerScenarios":"Running `argoexec supervisor` where supervisorContainer fails — e.g. the template cannot be read from /var/run/argo/template, the shared /var/run/argo mount is broken, or the main container's exit/status capture fails.","commonSituations":"Init-less (supervisor) workflows where the shared volume mount between main and supervisor containers is misconfigured; unreadable workflow template secret/ConfigMap; permission problems on /var/run/argo.","solutions":["Read the wrapped cause after this error for the concrete failure inside supervisorContainer","Verify the /var/run/argo shared volume is mounted in both main and supervisor containers","Check that the template is present at /var/run/argo/template and readable by argoexec","Confirm the pod uses a compatible executor version for init-less (beta) pods"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check pod wiring before init-less runs:\n// kubectl exec <pod> -c main -- ls -l /var/run/argo/template\n// kubectl exec <pod> -c main -- mount | grep argo","typeGuard":null,"tryCatchPattern":"// pass-through wrapper; unwrap at call site for the real cause\nif err := supervisorContainer(ctx); err != nil {\n    return fmt.Errorf(\"%w\", err) // errors.Unwrap to reach the root cause\n}","preventionTips":["Mount the /var/run/argo shared volume in every container of init-less pods","Pin an executor image version compatible with the init-less (beta) feature","Verify template readability inside pods with a smoke-test workflow","Watch supervisor container logs alongside main container logs when debugging"],"tags":["go","cobra","argo-executor","supervisor","error-wrapping"],"backgroundTag":"error-wrapping-passthrough","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"}