goharbor/harbor · error

Unauthorized

Error message

Unauthorized

What it means

Error "Unauthorized" thrown in goharbor/harbor.

Source

Thrown at src/registryctl/handlers/handler.go:79

func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	if a.authenticator == nil {
		log.Errorf("No authenticator found in registry controller.")
		http.Error(w, http.StatusText(http.StatusInternalServerError),
			http.StatusInternalServerError)
		return
	}

	if a.insecureAPIs != nil && a.insecureAPIs[r.URL.Path] {
		if a.handler != nil {
			a.handler.ServeHTTP(w, r)
		}
		return
	}

	err := a.authenticator.AuthorizeRequest(r)
	if err != nil {
		log.Errorf("failed to authenticate request: %v", err)
		http.Error(w, http.StatusText(http.StatusUnauthorized),
			http.StatusUnauthorized)
		return
	}

	if a.handler != nil {
		a.handler.ServeHTTP(w, r)
	}
}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/registryctl/handlers/handler.go:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/3501dc8f4f7343c5. Report an issue: GitHub.