{"record":{"id":"e37e0761b526bbca","repo":"quarkusio/quarkus","slug":"got-empty-http-response-body-requesturi-complete","errorCode":null,"errorMessage":"Got empty HTTP response body ${requestURI.completeURLString()}","messagePattern":"Got empty HTTP response body (.+?)","errorType":"exception","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":223,"sourceCode":"                .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() {\n        this.webClient.close();\n        this.vertx.closeAndAwait();\n    }\n}\n","sourceCodeStart":205,"sourceCodeEnd":241,"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#L205-L241","documentation":"After receiving HTTP 200, exchange() reads the body; if the response body is an empty string it throws a RuntimeException with the request URL. A 200 with an empty body means the server answered but returned no configuration payload, which cannot be deserialized into a Response object.","triggerScenarios":"Config Server returning 200 with zero-length body — typically seen with misconfigured server endpoints, empty repositories where the server misbehaves instead of returning proper JSON, or intermediary proxies stripping bodies.","commonSituations":"Reverse proxies/load balancers answering 200 with empty content; server-side bugs on specific property sources; HEAD-like responses from misrouted requests.","solutions":["Curl the exact URL and inspect the raw response body","Verify the request goes to the Config Server, not a proxy/landing page (check the URL path /application/profile[/label])","Fix or bypass the intermediary stripping the body; upgrade the Config Server if it returns empty bodies for empty repos"],"exampleFix":"// before\nquarkus.spring-cloud-config.url=http://gateway.internal/config\n\n// after\nquarkus.spring-cloud-config.url=http://config-server:8888","handlingStrategy":"retry","validationCode":"// verify the server returns a JSON payload\nString body = httpClient.get(configUrl + \"/app/profile\").body();\nif (body == null || body.isEmpty()) throw new IllegalStateException(\"Empty config payload\");","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Got empty HTTP response body\")) {\n        log.error(\"Server returned 200 with empty body; check proxies/server\", e);\n    }\n}","preventionTips":["Curl the endpoint and inspect the raw body before blaming the client","Bypass proxies when testing","Keep the Config Server up to date"],"tags":["quarkus","spring-cloud-config","http","empty-body","network"],"backgroundTag":"empty-http-response-body","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}