portainer/portainer · error · HandlerError
An administrator user already exists
Error message
An administrator user already exists
What it means
Error "An administrator user already exists" thrown in portainer/portainer.
Source
Thrown at api/http/handler/users/handler.go:20
import (
"errors"
"net/http"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/apikey"
"github.com/portainer/portainer/api/dataservices"
"github.com/portainer/portainer/api/http/security"
"github.com/portainer/portainer/api/internal/authorization"
"github.com/portainer/portainer/api/kubernetes/cli"
httperror "github.com/portainer/portainer/pkg/libhttp/error"
"github.com/gorilla/mux"
)
var (
errUserAlreadyExists = errors.New("User already exists")
errAdminAlreadyInitialized = errors.New("An administrator user already exists")
errAdminCannotRemoveSelf = errors.New("Cannot remove your own user account. Contact another administrator")
errCannotRemoveLastLocalAdmin = errors.New("Cannot remove the last local administrator account")
errCryptoHashFailure = errors.New("Unable to hash data")
)
func hideFields(user *portainer.User) {
user.Password = ""
}
// Handler is the HTTP handler used to handle user operations.
type Handler struct {
*mux.Router
bouncer security.BouncerService
apiKeyService apikey.APIKeyService
DataStore dataservices.DataStore
CryptoService portainer.CryptoService
passwordStrengthChecker security.PasswordStrengthChecker
AdminCreationDone chan<- struct{}View on GitHub (pinned to 17e74456ff)
When it happens
Trigger: Thrown at api/http/handler/users/handler.go:20 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/da9309ffae867c8e.
Report an issue: GitHub.