portainer/portainer · error · errUserNotFound

User not found or too many entries returned

Error message

User not found or too many entries returned

What it means

Error "User not found or too many entries returned" thrown in portainer/portainer.

Source

Thrown at api/ldap/ldap.go:19

package ldap

import (
	"fmt"
	"strings"

	portainer "github.com/portainer/portainer/api"
	"github.com/portainer/portainer/api/crypto"
	httperrors "github.com/portainer/portainer/api/http/errors"
	"github.com/portainer/portainer/api/logs"

	ldap "github.com/go-ldap/ldap/v3"
	"github.com/pkg/errors"
)

var (
	// errUserNotFound defines an error raised when the user is not found via LDAP search
	// or that too many entries (> 1) are returned.
	errUserNotFound = errors.New("User not found or too many entries returned")
)

// Service represents a service used to authenticate users against a LDAP/AD.
type Service struct{}

func createConnection(settings *portainer.LDAPSettings) (*ldap.Conn, error) {
	conn, err := createConnectionForURL(settings.URL, settings)
	if err != nil {
		return nil, errors.Wrap(err, "failed creating LDAP connection")
	}

	return conn, nil
}

func createConnectionForURL(url string, settings *portainer.LDAPSettings) (*ldap.Conn, error) {
	if !settings.TLSConfig.TLS && !settings.StartTLS {
		return ldap.Dial("tcp", url)
	}

View on GitHub (pinned to 17e74456ff)

When it happens

Trigger: Thrown at api/ldap/ldap.go:19 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of portainer/portainer@17e74456ff (2026-08-26). Data as JSON: /api/errors/1a78b0fdc0417a3d. Report an issue: GitHub.