{"record":{"id":"bcff9c94fa1813d3","repo":"argoproj/argo-workflows","slug":"failed-to-stage-files-w","errorCode":null,"errorMessage":"failed to stage files: %w","messagePattern":"failed to stage files: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/supervisor.go","lineNumber":147,"sourceCode":"func supervisorPreMain(ctx context.Context, wfExecutor *wfexecutor.WorkflowExecutor) error {\n\t// Zero umask so files/dirs created here are accessible to main when it\n\t// runs as a different uid. The legacy init container does the same.\n\tosspecific.AllowGrantingAccessToEveryone()\n\n\t// A stale marker from a prior attempt needs no explicit cleanup: the\n\t// heartbeat's initial RUNNING write (startStatusHeartbeat, before we get\n\t// here) has already overwritten it with a fresh mtime.\n\treturn runSupervisorPreMain(ctx, wfExecutor, inputArtifactPluginNames())\n}\n\n// runSupervisorPreMain is the testable core of supervisorPreMain. Takes\n// the plugin name list explicitly so tests don't have to mutate env vars.\nfunc runSupervisorPreMain(ctx context.Context, stages preMainStages, pluginNames []wfv1.ArtifactPluginName) error {\n\tif err := stages.WriteTemplate(); err != nil {\n\t\treturn fmt.Errorf(\"failed to write template: %w\", err)\n\t}\n\tif err := stages.StageFiles(ctx); err != nil {\n\t\treturn fmt.Errorf(\"failed to stage files: %w\", err)\n\t}\n\n\tg, gctx := errgroup.WithContext(ctx)\n\tg.Go(func() error {\n\t\tif err := stages.LoadArtifactsWithoutPlugins(gctx); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load non-plugin input artifacts: %w\", err)\n\t\t}\n\t\treturn nil\n\t})\n\tfor _, name := range pluginNames {\n\t\tg.Go(func() error {\n\t\t\tif err := stages.LoadArtifactsFromPlugin(gctx, name); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to load input artifacts from plugin %q: %w\", name, err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\treturn g.Wait()","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/supervisor.go#L129-L165","documentation":"runSupervisorPreMain wraps failures of the StageFiles stage as \"failed to stage files\". StageFiles materializes file-type inputs (e.g. artifact files or staged manifest files) into the pod before the main container starts; failure aborts pre-main via short-circuit, so the main container never becomes ready.","triggerScenarios":"supervisorPreMain → runSupervisorPreMain where the StageFiles stage returns an error — destination directory not writable, source file missing, or a copy failure during staging.","commonSituations":"Init-less workflows with input artifacts staged as files where the /var/run/argo mount is broken or full; wrong paths in template inputs; permissions preventing the supervisor from creating staged files.","solutions":["Inspect the wrapped cause for the concrete staging error (ENOENT/EACCES/ENOSPC)","Verify the source paths referenced by the template inputs exist in the pod","Ensure /var/run/argo (or the stage target dir) is writable and has free space","Re-run the workflow node after fixing the volume mount or template paths"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify staged sources exist and target dir is writable:\n// kubectl exec <pod> -c main -- ls -l <staged-source-paths>\n// kubectl exec <pod> -c main -- test -w /var/run/argo","typeGuard":null,"tryCatchPattern":"if err := stages.StageFiles(ctx); err != nil {\n    return fmt.Errorf(\"failed to stage files: %w\", err)\n}\n// caller: unwrap to distinguish missing source (ENOENT) vs permission (EACCES)","preventionTips":["Double-check file paths in template inputs.artifacts/paths","Ensure the staging directory has space and correct permissions","Lint workflows so bad paths are caught before submit","Log stage failures with the wrapped cause for quick diagnosis"],"tags":["go","argo-executor","supervisor","staging","filesystem"],"backgroundTag":"file-write-failed","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"}