{"record":{"id":"195ea905ae31133a","repo":"pentaho/pentaho-kettle","slug":"provider-lookup-failed-with-http-status-status","errorCode":null,"errorMessage":"Provider lookup failed with HTTP status {status}","messagePattern":"Provider lookup failed with HTTP status (.+?)","errorType":"http","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/util/SsoProviderService.java","lineNumber":51,"sourceCode":"\n  public List<SsoProvider> fetchProviders( String serverUrl ) throws IOException {\n    String providersUrl = buildProvidersUrl( serverUrl );\n    HttpURLConnection connection = null;\n\n    try {\n      connection = (HttpURLConnection) new URL( providersUrl ).openConnection();\n      connection.setRequestMethod( \"GET\" );\n      connection.setConnectTimeout( CONNECT_TIMEOUT_MS );\n      connection.setReadTimeout( READ_TIMEOUT_MS );\n      connection.setRequestProperty( \"Accept\", \"application/json\" );\n\n      int responseCode = connection.getResponseCode();\n      if ( responseCode == HttpURLConnection.HTTP_NOT_FOUND ) {\n        // The SSO providers endpoint does not exist on this server — SSO is not configured.\n        return Collections.emptyList();\n      }\n      if ( responseCode < 200 || responseCode >= 300 ) {\n        throw new IOException( \"Provider lookup failed with HTTP status \" + responseCode );\n      }\n\n      try ( InputStreamReader reader =\n              new InputStreamReader( connection.getInputStream(), StandardCharsets.UTF_8 ) ) {\n        Object parsed = new JSONParser().parse( reader );\n        if ( !( parsed instanceof JSONArray providersArray ) ) {\n          return Collections.emptyList();\n        }\n\n        List<SsoProvider> providers = new ArrayList<>();\n        for ( Object item : providersArray ) {\n          if ( item instanceof JSONObject providerObject ) {\n            boolean enabled = getBoolean( providerObject.get( \"enabled\" ) );\n            String clientName = stringValue( providerObject.get( \"clientName\" ) );\n            String authorizationUri = stringValue( providerObject.get( \"authorizationUri\" ) );\n            String registrationId = stringValue( providerObject.get( \"registrationId\" ) );\n            if ( enabled && !isBlank( clientName ) && !isBlank( authorizationUri ) ) {\n              providers.add( new SsoProvider( clientName, authorizationUri, registrationId ) );","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/util/SsoProviderService.java#L33-L69","documentation":"SsoProviderService.fetchProviders calls the server's SSO providers endpoint; any HTTP status outside 2xx (other than 404, which is treated as 'SSO not configured' and returns an empty list) is converted into this IOException. It means the server was reachable but rejected or failed the lookup request.","triggerScenarios":"Calling fetchProviders() against a Pentaho server whose /plugin/login/api/v0/oauth-providers endpoint returns a non-2xx, non-404 status (e.g. 401 unauthorized, 403 forbidden, 500 server error).","commonSituations":"Server requires authentication and none was supplied; a proxy or gateway returns 502/503; the server version exposes the endpoint but errors on it; wrong server URL pointing at a service that answers with an error status.","solutions":["Verify the server URL and network path; test the endpoint directly (curl <server>/plugin/login/api/v0/oauth-providers) to see the real status","If 401/403, supply valid authentication credentials for the repository server","Check the Pentaho server logs for a 500 on the login plugin and fix server-side configuration","If the server simply doesn't support SSO, treat a 404/empty result as expected (the code already does this for 404)","Retry later if the status is 5xx from a temporarily unhealthy server"],"exampleFix":"// before\nthrow new IOException( \"Provider lookup failed with HTTP status \" + responseCode );\n// after\nif ( responseCode == HttpURLConnection.HTTP_UNAUTHORIZED ) {\n  throw new IOException( \"SSO provider lookup unauthorized: check credentials for \" + connection.getURL() );\n}\nthrow new IOException( \"Provider lookup failed with HTTP status \" + responseCode );","handlingStrategy":"try-catch","validationCode":"HttpURLConnection c = (HttpURLConnection) new URL( buildProvidersUrl( serverUrl ) ).openConnection();\nc.setRequestMethod( \"HEAD\" );\nint code = c.getResponseCode();\nif ( code != 404 && ( code < 200 || code >= 300 ) ) {\n  throw new IllegalStateException( \"SSO endpoint will fail, HTTP \" + code );\n}","typeGuard":null,"tryCatchPattern":"try {\n  List<SsoProvider> providers = ssoProviderService.fetchProviders( serverUrl );\n} catch ( IOException e ) {\n  log.warn( \"SSO provider lookup failed: \" + e.getMessage(), e );\n  providers = Collections.emptyList(); // degrade to non-SSO login\n}","preventionTips":["Treat 404 as 'SSO not supported' (the code already does) and other non-2xx as degraded mode","Pre-flight the endpoint with a lightweight request before the full call","Validate the server URL before calling the service","Log the response code and server URL to speed diagnosis"],"tags":["http","sso","network"],"backgroundTag":"http-error-response","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}