{"record":{"id":"fa74aee514247d13","repo":"argoproj/argo-workflows","slug":"failed-to-create-s-w","errorCode":null,"errorMessage":"failed to create %s: %w","messagePattern":"failed to create (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/emissary.go","lineNumber":752,"sourceCode":"\t\tlogger.WithField(\"src\", srcPath).WithError(err).Warn(ctx, \"cannot save parameter, does not exist\")\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to open %s: %w\", srcPath, err)\n\t}\n\tdefer func() { _ = src.Close() }()\n\tdstPath := varRunArgo + \"/outputs/parameters/\" + srcPath\n\tlogger.WithFields(logging.Fields{\n\t\t\"src\": srcPath,\n\t\t\"dst\": dstPath,\n\t}).Info(ctx, \"saving parameter\")\n\tz := filepath.Dir(dstPath)\n\tif mkdirErr := os.MkdirAll(z, 0o755); mkdirErr != nil { // chmod rwxr-xr-x\n\t\treturn fmt.Errorf(\"failed to create directory %s: %w\", z, mkdirErr)\n\t}\n\tdst, err := os.Create(dstPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create %s: %w\", srcPath, err)\n\t}\n\tdefer func() { _ = dst.Close() }()\n\tif _, err = io.Copy(dst, src); err != nil {\n\t\treturn fmt.Errorf(\"failed to copy %s to %s: %w\", srcPath, dstPath, err)\n\t}\n\tif err = dst.Close(); err != nil {\n\t\treturn fmt.Errorf(\"failed to close %s: %w\", dstPath, err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":734,"sourceCodeEnd":763,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/emissary.go#L734-L763","documentation":"saveParameter failed to create the destination file under /var/run/argo/outputs/parameters/ via os.Create after the directory was made. The parameter value cannot be written out for controller pickup. The wrapped OS error carries the concrete reason.","triggerScenarios":"os.Create(dstPath) fails: dstPath resolves to an existing directory, EMFILE (fd exhaustion), ENOSPC, or permission denied in the freshly created outputs directory.","commonSituations":"Nested parameter paths where dstPath already exists as a directory; many outputs saved concurrently hitting the fd limit; disk full; securityContext blocking writes.","solutions":["Check the wrapped error: EISDIR means the mirrored dstPath is a directory — use a distinct file path for the parameter.","Raise RLIMIT_NOFILE / reduce concurrent outputs if EMFILE.","Free disk space if ENOSPC.","Fix /var/run/argo/outputs write permissions (volume + securityContext)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// fd headroom + destination sanity check before saving outputs\nvar lim syscall.Rlimit\n_ = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &lim)\nif fi, err := os.Stat(dstPath); err == nil && fi.IsDir() {\n    return fmt.Errorf(\"%s is a directory\", dstPath)\n}","typeGuard":null,"tryCatchPattern":"err := runStep(ctx)\nif err != nil && strings.Contains(err.Error(), \"failed to create\") {\n    if errors.Is(errors.Unwrap(err), syscall.EISDIR) {\n        return useDistinctParameterPath(ctx)\n    }\n    if errors.Is(errors.Unwrap(err), syscall.EMFILE) {\n        return raiseNoFileAndRetry(ctx)\n    }\n    return err\n}","preventionTips":["Use one file per parameter; don't point two outputs at overlapping paths","Limit outputs per step or raise RLIMIT_NOFILE","Keep disk headroom for parameter writes","Pin securityContext so the executor can write /var/run/argo/outputs"],"tags":["argo-workflows","argoexec","parameters","filesystem"],"backgroundTag":"file-create-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"}