{"record":{"id":"a23482d15768044f","repo":"argoproj/argo-workflows","slug":"codenotimplemented","errorCode":"CodeNotImplemented","errorMessage":"IsDirectory currently unimplemented for HDFS","messagePattern":"IsDirectory currently unimplemented for HDFS","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"workflow/artifacts/hdfs/hdfs.go","lineNumber":254,"sourceCode":"\n// SaveStream saves an artifact from an io.Reader to HDFS compliant storage\nfunc (driver *ArtifactDriver) SaveStream(ctx context.Context, reader io.Reader, outputArtifact *wfv1.Artifact) error {\n\treturn common.SaveStreamViaTempFile(reader, \"hdfs-upload-*\", func(path string) error {\n\t\treturn driver.Save(ctx, path, outputArtifact)\n\t})\n}\n\n// Delete is unsupported for the hdfs artifacts\nfunc (driver *ArtifactDriver) Delete(ctx context.Context, s *wfv1.Artifact) error {\n\treturn common.ErrDeleteNotSupported\n}\n\nfunc (driver *ArtifactDriver) ListObjects(ctx context.Context, artifact *wfv1.Artifact) ([]string, error) {\n\treturn nil, fmt.Errorf(\"ListObjects is currently not supported for this artifact type, but it will be in a future version\")\n}\n\nfunc (driver *ArtifactDriver) IsDirectory(ctx context.Context, artifact *wfv1.Artifact) (bool, error) {\n\treturn false, errors.New(errors.CodeNotImplemented, \"IsDirectory currently unimplemented for HDFS\")\n}\n","sourceCodeStart":236,"sourceCodeEnd":256,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/hdfs/hdfs.go#L236-L256","documentation":"The HDFS artifact driver does not implement the IsDirectory capability of the ArtifactDriver interface, so any call returns a CodeNotImplemented error. Argo uses IsDirectory to decide how to serve/expand artifact directories; HDFS artifacts cannot be probed this way.","triggerScenarios":"Calling IsDirectory(ctx, artifact) on an HDFS artifact — e.g. the artifact server or UI attempting to browse an HDFS artifact as a directory.","commonSituations":"Browsing HDFS artifacts in the UI; generic artifact-serving code paths that call IsDirectory regardless of driver type.","solutions":["Avoid directory-style access to HDFS artifacts; treat them as files only.","Copy the HDFS artifact into a supported store (S3/GCS/Azure) if directory browsing is needed.","Patch the driver to implement IsDirectory via hdfscli.Stat().IsDir() if you control the deployment."],"exampleFix":"// after (custom patch)\nfunc (d *ArtifactDriver) IsDirectory(ctx context.Context, artifact *wfv1.Artifact) (bool, error) {\n\tcli, err := d.getHDFSClient()\n\tif err != nil { return false, err }\n\tdefer cli.Close()\n\tst, err := cli.Stat(artifact.HDFS.Path)\n\tif err != nil { return false, err }\n\treturn st.IsDir(), nil\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":"// feature-detect before calling\ndriverName := \"hdfs\"\nif driverName == \"hdfs\" {\n    // skip IsDirectory; treat artifact as a file\n}","tryCatchPattern":"isDir, err := driver.IsDirectory(ctx, art)\nif err != nil && errors.Is(err, errors.New(errors.CodeNotImplemented, \"\")) || strings.Contains(err.Error(), \"unimplemented\") {\n    isDir = false // assume file\n}","preventionTips":["Never rely on directory browsing for HDFS artifacts in UI/server flows","Mirror HDFS outputs to S3/GCS when directory semantics are needed","Check the driver's supported capabilities before generic artifact code paths"],"tags":["hdfs","unimplemented","artifact"],"backgroundTag":"artifact-driver-not-implemented","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"}