goharbor/harbor · error
parse Ldap Host ERR: %s
Error message
parse Ldap Host ERR: %s
What it means
Error "parse Ldap Host ERR: %s" thrown in goharbor/harbor.
Source
Thrown at src/pkg/ldap/ldap.go:81
type Session struct {
basicCfg models.LdapConf
groupCfg models.GroupConf
ldapConn *goldap.Conn
}
// NewSession create session with configs
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)
}View on GitHub (pinned to 7b2fd08cc5)
When it happens
Trigger: Thrown at src/pkg/ldap/ldap.go:81 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/04761a1fc2ae338a.
Report an issue: GitHub.