{"record":{"id":"630bef4c3687c2cc","repo":"goharbor/harbor","slug":"failed-to-walk-manifest-w","errorCode":null,"errorMessage":"failed to walk manifest: %w","messagePattern":"failed to walk manifest: %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/artifact/processor/cnai/parser/files.go","lineNumber":57,"sourceCode":"\t*base\n}\n\ntype FileList struct {\n\tName     string     `json:\"name\"`\n\tType     string     `json:\"type\"`\n\tSize     int64      `json:\"size,omitempty\"`\n\tChildren []FileList `json:\"children,omitempty\"`\n}\n\n// Parse parses the files list.\nfunc (f *files) Parse(_ context.Context, _ *artifact.Artifact, manifest *ocispec.Manifest) (string, []byte, error) {\n\tif manifest == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"manifest cannot be nil\")\n\t}\n\n\trootNode, err := walkManifest(*manifest)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"failed to walk manifest: %w\", err)\n\t}\n\n\tfileLists := traverseFileNode(rootNode)\n\tdata, err := json.Marshal(fileLists)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\treturn contentTypeJSON, data, nil\n}\n\n// walkManifest walks the manifest and returns the root file node.\nfunc walkManifest(manifest ocispec.Manifest) (*FileNode, error) {\n\troot := NewDirectory(\"/\")\n\tfor _, layer := range manifest.Layers {\n\t\tif layer.Annotations != nil && layer.Annotations[modelspec.AnnotationFilepath] != \"\" {\n\t\t\tfilepath := layer.Annotations[modelspec.AnnotationFilepath]\n\t\t\t// mark it to directory if the file path ends with \"/\".","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/cnai/parser/files.go#L39-L75","documentation":"Wrapping error in the CNAI files parser Parse: walkManifest failed while converting the OCI manifest's layers into a file tree. The %w is usually a path-conflict or invalid-path error from AddNode, so the file listing cannot be produced.","triggerScenarios":"Thrown at src/controller/artifact/processor/cnai/parser/files.go:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error to find the conflicting or invalid path in manifest layers.","Fix duplicate paths where the same name appears as both file and directory.","Validate layer filepath annotations before pushing the model artifact."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}