{"record":{"id":"59c33cb734cd555c","repo":"goharbor/harbor","slug":"invalid-dn-v","errorCode":null,"errorMessage":"invalid DN: %v","messagePattern":"invalid DN: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/ldap/manager.go","lineNumber":153,"sourceCode":"\nfunc (m *manager) SearchGroup(_ context.Context, sess *Session, groupName, groupDN string) ([]model.Group, error) {\n\terr := sess.Open()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer sess.Close()\n\n\tldapGroups := make([]model.Group, 0)\n\n\t// Search LDAP group by groupName or group DN\n\tif len(groupName) > 0 {\n\t\tldapGroups, err = sess.SearchGroupByName(groupName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if len(groupDN) > 0 {\n\t\tif _, err := goldap.ParseDN(groupDN); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid DN: %v\", err)\n\t\t}\n\t\tldapGroups, err = sess.SearchGroupByDN(groupDN)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn ldapGroups, nil\n}\n","sourceCodeStart":135,"sourceCodeEnd":163,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/ldap/manager.go#L135-L163","documentation":"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.","triggerScenarios":"Thrown at src/pkg/ldap/manager.go:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"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"}