{"record":{"id":"9ddcd8e27fc4746f","repo":"quarkusio/quarkus","slug":"got-unexpected-http-response-code-r-statuscode","errorCode":null,"errorMessage":"Got unexpected HTTP response code ${r.statusCode()} from ${requestURI.completeURLString()}","messagePattern":"Got unexpected HTTP response code (.+?) from (.+?)","errorType":"http","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java","lineNumber":218,"sourceCode":"\n    @Override\n    public Uni<Response> exchange(String applicationName, String profile) {\n        final ConfigServerUrl requestURI = toConfigServerUrl(applicationName, profile);\n        HttpRequest<Buffer> request = webClient\n                .get(requestURI.port(), requestURI.host(), requestURI.completeURLString())\n                .ssl(UrlUtility.isHttps(requestURI.baseURI()))\n                .putHeader(\"Accept\", \"application/json\");\n        if (config.usernameAndPasswordSet()) {\n            request.basicAuthentication(config.username().get(), config.password().get());\n        }\n        for (Map.Entry<String, String> entry : config.headers().entrySet()) {\n            request.putHeader(entry.getKey(), entry.getValue());\n        }\n        log.debug(\"Attempting to read configuration from '\" + requestURI.completeURLString() + \"'.\");\n        return request.send().map(r -> {\n            log.debug(\"Received HTTP response code '\" + r.statusCode() + \"'\");\n            if (r.statusCode() != 200) {\n                throw new RuntimeException(\"Got unexpected HTTP response code \" + r.statusCode()\n                        + \" from \" + requestURI.completeURLString());\n            } else {\n                String bodyAsString = r.bodyAsString();\n                if (bodyAsString.isEmpty()) {\n                    throw new RuntimeException(\"Got empty HTTP response body \" + requestURI.completeURLString());\n                }\n                try {\n                    log.debug(\"Attempting to deserialize response\");\n                    return OBJECT_MAPPER.readValue(bodyAsString, Response.class);\n                } catch (JacksonException e) {\n                    throw new RuntimeException(\"Got unexpected error \" + e.getOriginalMessage());\n                }\n            }\n        });\n    }\n\n    @Override\n    public void close() {","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java#L200-L236","documentation":"VertxSpringCloudConfigGateway.exchange() performs the HTTP call to the Config Server with Vert.x and requires HTTP 200. Any other status code (404 unknown app/profile, 401 bad credentials, 500 server error, connection-level failures surfaced by Vert.x) is converted into a RuntimeException embedding both the status code and the full request URL.","triggerScenarios":"Config Server returns 404 because the application name or profile has no configuration; 401/403 when credentials (quarkus.spring-cloud-config.username/password) are wrong or missing; 5xx when the server fails; a proxy returning an unexpected status.","commonSituations":"Typo in quarkus.application.name vs Config Server repository layout; label/branch missing on the server; firewall or gateway intercepting the request.","solutions":["Run curl -u user:pass <config-url>/<app>/<profile> against the server to reproduce and see the real status/body","Fix the application name, profile, and label so the server locates the config","Provide correct quarkus.spring-cloud-config.username/password if the server is secured","Check server logs for the 5xx cause if the status is 500"],"exampleFix":"// before\nquarkus.spring-cloud-config.url=http://config-server:8888\n# secured server, no credentials -> 401\n\n// after\nquarkus.spring-cloud-config.url=http://config-server:8888\nquarkus.spring-cloud-config.username=user\nquarkus.spring-cloud-config.password=secret","handlingStrategy":"retry","validationCode":"// preflight\ncurl -sS -o /dev/null -w \"%{http_code}\" -u user:pass \"$CONFIG_URL/app/profile\"","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Got unexpected HTTP response code\")) {\n        // parse status; retry on 5xx with backoff, fail fast on 4xx\n    }\n}","preventionTips":["Verify app name/profile/label against Config Server repo layout","Store credentials in a secure config source","Use retries with backoff for transient 5xx"],"tags":["quarkus","spring-cloud-config","http","http-status","network"],"backgroundTag":"unexpected-http-status","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}