{"record":{"id":"fdbcef6eddce0c90","repo":"argoproj/argo-workflows","slug":"codenotfound","errorCode":"CodeNotFound","errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/hdfs/hdfs.go","lineNumber":153,"sourceCode":"\t\tHDFSUser:               art.HDFSUser,\n\t\tKrbOptions:             krbOptions,\n\t\tDataTransferProtection: art.DataTransferProtection,\n\t}\n\treturn &driver, nil\n}\n\n// Load downloads artifacts from HDFS compliant storage\nfunc (driver *ArtifactDriver) Load(ctx context.Context, _ *wfv1.Artifact, path string) error {\n\thdfscli, err := createHDFSClient(driver.Addresses, driver.HDFSUser, driver.DataTransferProtection, driver.KrbOptions)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer hdfscli.Close()\n\n\tsrcStat, err := hdfscli.Stat(driver.Path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn errors.New(errors.CodeNotFound, err.Error())\n\t\t}\n\t\treturn err\n\t}\n\tif srcStat.IsDir() {\n\t\treturn fmt.Errorf(\"HDFS artifact does not suppot directory copy\")\n\t}\n\n\t_, err = os.Stat(path)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn err\n\t}\n\n\tif os.IsNotExist(err) {\n\t\tdirPath := filepath.Dir(driver.Path)\n\t\tif dirPath != \".\" && dirPath != \"/\" {\n\t\t\t// Follow umask for the permission\n\t\t\terr = os.MkdirAll(dirPath, 0o777)\n\t\t\tif err != nil {","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/hdfs/hdfs.go#L135-L171","documentation":"While loading an HDFS artifact, the driver stats the source path on HDFS; if the stat reports the path does not exist, the underlying os error is re-wrapped as a coded Argo error with CodeNotFound. This lets callers (artifact server, controller) distinguish missing artifacts from other failures.","triggerScenarios":"Calling Load() on an HDFS artifact where `hdfscli.Stat(driver.Path)` returns an os.IsNotExist error — the configured hdfs path (path/subPath) is absent on the NameNode.","commonSituations":"Upstream step never produced the HDFS file; typo in path or subPath; wrong hdfsConf/hdfsAddress config pointing at a different cluster; file deleted before the consuming step runs.","solutions":["Verify the source path exists: `hdfs dfs -ls <path>` using the same NameNode config the workflow uses.","Fix the artifact's `path`/`subPath` in the spec, including any template expressions that may resolve incorrectly.","Check the producing step actually wrote the file before this step ran (ordering/depends)."],"exampleFix":"# before\nartifacts:\n- from: hdfs://namnode/wrong/dir/out.txt\n# after\nartifacts:\n- from: hdfs://namenode/correct/dir/out.txt","handlingStrategy":"try-catch","validationCode":"client, _ := hdfs.New(hdfsAddress, hdfs.User(\"hdfs\"))\nif _, err := client.Stat(hdfsPath); err != nil {\n    return fmt.Errorf(\"hdfs source %s missing: %w\", hdfsPath, err)\n}","typeGuard":null,"tryCatchPattern":"if argoerr, ok := err.(errors.CodedError); ok && argoerr.Code() == errors.CodeNotFound {\n    // regenerate the artifact or fail gracefully\n}\nif os.IsNotExist(errors.Cause(err)) { ... }","preventionTips":["Pre-check the HDFS path exists in the producing step before it completes","Use explicit, non-templated paths or verify template expressions resolve correctly","Ensure depends/ordering guarantees the producer ran first"],"tags":["hdfs","artifact","not-found"],"backgroundTag":"artifact-source-not-found","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"}