goharbor/harbor · error
unknown ldap protocol
Error message
unknown ldap protocol
What it means
Error "unknown ldap protocol" thrown in goharbor/harbor.
Source
Thrown at src/pkg/ldap/ldap.go:88
func NewSession(basicCfg models.LdapConf, groupCfg models.GroupConf) *Session {
return &Session{
basicCfg: basicCfg,
groupCfg: groupCfg,
}
}
func formatURL(ldapURL string) (string, error) {
var protocol, hostport string
_, err := url.Parse(ldapURL)
if err != nil {
return "", fmt.Errorf("parse Ldap Host ERR: %s", err)
}
if strings.Contains(ldapURL, "://") {
splitLdapURL := strings.Split(ldapURL, "://")
protocol, hostport = splitLdapURL[0], splitLdapURL[1]
if !((protocol == "ldap") || (protocol == "ldaps")) {
return "", fmt.Errorf("unknown ldap protocol")
}
} else {
hostport = ldapURL
protocol = "ldap"
}
if strings.Contains(hostport, ":") {
_, port, err := net.SplitHostPort(hostport)
if err != nil {
return "", fmt.Errorf("illegal ldap url, error: %v", err)
}
if port == "636" {
protocol = "ldaps"
}
} else {
switch protocol {
case "ldap":
hostport = hostport + ":389"View on GitHub (pinned to 7b2fd08cc5)
When it happens
Trigger: Thrown at src/pkg/ldap/ldap.go:88 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/f31282d703b4b3bb.
Report an issue: GitHub.