{"record":{"id":"cdbae1c81654b51a","repo":"goharbor/harbor","slug":"no-auth-handler-registered-for-mode-s","errorCode":null,"errorMessage":"no auth handler registered for mode: %s","messagePattern":"no auth handler registered for mode: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/p2p/preheat/provider/client/http_client.go","lineNumber":223,"sourceCode":"\t}\n\n\tif (res.StatusCode / 100) != 2 {\n\t\t// Return the server error content in the error.\n\t\treturn nil, errors.Errorf(\"%s %q error: %s %s\", http.MethodPost, res.Request.URL.String(), res.Status, bytes)\n\t} else if res.StatusCode == http.StatusAlreadyReported {\n\t\t// Currently because if image was already preheated at least once, Dragonfly will return StatusAlreadyReported.\n\t\t// And we should preserve http status code info to process this case later.\n\t\treturn bytes, &common_http.Error{Code: http.StatusAlreadyReported, Message: \"status already reported\"}\n\t}\n\n\treturn bytes, nil\n}\n\nfunc (hc *HTTPClient) authorize(req *http.Request, cred *auth.Credential) error {\n\tif cred != nil {\n\t\tauthorizer, ok := auth.GetAuthHandler(cred.Mode)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"no auth handler registered for mode: %s\", cred.Mode)\n\t\t}\n\t\tif err := authorizer.Authorize(req, cred); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":205,"sourceCodeEnd":232,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/p2p/preheat/provider/client/http_client.go#L205-L232","documentation":"The p2p preheat HTTP client's authorize step found no auth handler registered for the configured authorization mode, so it cannot build credentials for the request — the mode string does not match any registered handler (basic, bearer, etc.).","triggerScenarios":"Thrown at src/pkg/p2p/preheat/provider/client/http_client.go:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the provider auth mode to a supported value (e.g. 'none', 'basic' or the documented modes)","Verify the auth registry initialization imported the handler for that mode"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}