{"record":{"id":"1fc5d213647ad947","repo":"goharbor/harbor","slug":"can-not-bind-search-dn-error-v","errorCode":null,"errorMessage":"can not bind search dn, error: %v","messagePattern":"can not bind search dn, error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/ldap/ldap.go","lineNumber":253,"sourceCode":"\tattributes := []string{\"uid\", \"cn\", \"mail\", \"email\"}\n\tlowerUID := strings.ToLower(s.basicCfg.UID)\n\n\tif lowerUID != \"uid\" && lowerUID != \"cn\" && lowerUID != \"mail\" && lowerUID != \"email\" {\n\t\tattributes = append(attributes, s.basicCfg.UID)\n\t}\n\n\t// Add the Group membership attribute\n\tgroupAttr := strings.TrimSpace(s.groupCfg.MembershipAttribute)\n\tlog.Debugf(\"Membership attribute: %s\\n\", groupAttr)\n\tattributes = append(attributes, groupAttr)\n\n\treturn s.SearchLdapAttribute(s.basicCfg.BaseDn, filter, attributes)\n}\n\n// SearchLdapAttribute - to search ldap with the provide filter, with specified attributes\nfunc (s *Session) SearchLdapAttribute(baseDN, filter string, attributes []string) (*goldap.SearchResult, error) {\n\tif err := s.Bind(s.basicCfg.SearchDn, s.basicCfg.SearchPassword); err != nil {\n\t\treturn nil, fmt.Errorf(\"can not bind search dn, error: %v\", err)\n\t}\n\tfilter = normalizeFilter(filter)\n\tif len(filter) == 0 {\n\t\treturn nil, ErrInvalidFilter\n\t}\n\tif _, err := goldap.CompileFilter(filter); err != nil {\n\t\tlog.Errorf(\"Wrong filter format, filter:%v\", filter)\n\t\treturn nil, ErrInvalidFilter\n\t}\n\tlog.Debugf(\"Search ldap with filter:%v\", filter)\n\tsearchRequest := goldap.NewSearchRequest(\n\t\tbaseDN,\n\t\ts.basicCfg.Scope,\n\t\tgoldap.NeverDerefAliases,\n\t\t0,     // Unlimited results\n\t\t0,     // Search Timeout\n\t\tfalse, // Types only\n\t\tfilter,","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/ldap/ldap.go#L235-L271","documentation":"Error \"can not bind search dn, error: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/ldap/ldap.go:253 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"}