{"record":{"id":"85ff4d297172d545","repo":"goharbor/harbor","slug":"path-conflicts-s-exists-with-different-type","errorCode":null,"errorMessage":"path conflicts: %s exists with different type","messagePattern":"path conflicts: (.+?) exists with different type","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/artifact/processor/cnai/parser/util.go","lineNumber":192,"sourceCode":"\t\t\t\t\tnewNode = NewFile(part, size)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewNode = NewDirectory(part)\n\t\t\t}\n\n\t\t\tif err := current.AddChild(newNode); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcurrent = newNode\n\t\t} else {\n\t\t\tchild.mu.RLock()\n\t\t\tnodeType := child.Type\n\t\t\tchild.mu.RUnlock()\n\n\t\t\tif isLastPart {\n\t\t\t\tif (isDir && nodeType != TypeDirectory) || (!isDir && nodeType != TypeFile) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"path conflicts: %s exists with different type\", part)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent = child\n\t\t}\n\t}\n\n\treturn current, nil\n}\n","sourceCodeStart":174,"sourceCodeEnd":202,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/artifact/processor/cnai/parser/util.go#L174-L202","documentation":"Conflict error from AddNode in the CNAI parser util: a path segment already exists in the tree but with the opposite type (a file where a directory is expected, or vice versa) when the final path part is reached. The input at fault is a set of manifest layers whose filepaths collide, e.g. \"a\" as a file and \"a/b\" as a file path.","triggerScenarios":"Thrown at src/controller/artifact/processor/cnai/parser/util.go:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the manifest layer that reuses an existing name as a different node type.","Ensure every intermediate path segment is consistently a directory.","Rename one of the conflicting entries and re-push the artifact."],"exampleFix":null,"handlingStrategy":"validation","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"}