{"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":"Error \"failed to walk manifest: %w\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/artifact/processor/cnai/parser/files.go:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}