goharbor/harbor · error

path conflicts: exists with different type

Error message

path conflicts: %s exists with different type

What it means

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.

Solutions

  1. Remove the manifest layer that reuses an existing name as a different node type.
  2. Ensure every intermediate path segment is consistently a directory.
  3. Rename one of the conflicting entries and re-push the artifact.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/controller/artifact/processor/cnai/parser/util.go:192 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/85ff4d297172d545. Report an issue: GitHub.

Appendix: source

Thrown at src/controller/artifact/processor/cnai/parser/util.go:192

					newNode = NewFile(part, size)
				}
			} else {
				newNode = NewDirectory(part)
			}

			if err := current.AddChild(newNode); err != nil {
				return nil, err
			}

			current = newNode
		} else {
			child.mu.RLock()
			nodeType := child.Type
			child.mu.RUnlock()

			if isLastPart {
				if (isDir && nodeType != TypeDirectory) || (!isDir && nodeType != TypeFile) {
					return nil, fmt.Errorf("path conflicts: %s exists with different type", part)
				}
			}

			current = child
		}
	}

	return current, nil
}

View on GitHub (pinned to 7b2fd08cc5)