goharbor/harbor · error
invalid DN
Error message
invalid DN: %v
What it means
SearchGroup called goldap.ParseDN on the supplied group DN and the DN is syntactically invalid (bad attribute naming, malformed commas/escapes), so the group lookup is aborted before querying the directory.
Solutions
- Correct the group DN syntax, e.g. 'cn=dev,ou=groups,dc=example,dc=com'
- Check for missing attribute names, unescaped commas or stray spaces
- Verify the DN against the directory server's actual group entries
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/pkg/ldap/manager.go:153 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/59c33cb734cd555c.
Report an issue: GitHub.
Appendix: source
Thrown at src/pkg/ldap/manager.go:153
func (m *manager) SearchGroup(_ context.Context, sess *Session, groupName, groupDN string) ([]model.Group, error) {
err := sess.Open()
if err != nil {
return nil, err
}
defer sess.Close()
ldapGroups := make([]model.Group, 0)
// Search LDAP group by groupName or group DN
if len(groupName) > 0 {
ldapGroups, err = sess.SearchGroupByName(groupName)
if err != nil {
return nil, err
}
} else if len(groupDN) > 0 {
if _, err := goldap.ParseDN(groupDN); err != nil {
return nil, fmt.Errorf("invalid DN: %v", err)
}
ldapGroups, err = sess.SearchGroupByDN(groupDN)
if err != nil {
return nil, err
}
}
return ldapGroups, nil
}
View on GitHub (pinned to 7b2fd08cc5)