quarkusio/quarkus · error · RuntimeException
Got unexpected HTTP response code ${r.statusCode()} from ${r
Error message
Got unexpected HTTP response code ${r.statusCode()} from ${requestURI.completeURLString()} What it means
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.
Source
Thrown at extensions/spring-cloud-config-client/runtime/src/main/java/io/quarkus/spring/cloud/config/client/runtime/VertxSpringCloudConfigGateway.java:218
@Override
public Uni<Response> exchange(String applicationName, String profile) {
final ConfigServerUrl requestURI = toConfigServerUrl(applicationName, profile);
HttpRequest<Buffer> request = webClient
.get(requestURI.port(), requestURI.host(), requestURI.completeURLString())
.ssl(UrlUtility.isHttps(requestURI.baseURI()))
.putHeader("Accept", "application/json");
if (config.usernameAndPasswordSet()) {
request.basicAuthentication(config.username().get(), config.password().get());
}
for (Map.Entry<String, String> entry : config.headers().entrySet()) {
request.putHeader(entry.getKey(), entry.getValue());
}
log.debug("Attempting to read configuration from '" + requestURI.completeURLString() + "'.");
return request.send().map(r -> {
log.debug("Received HTTP response code '" + r.statusCode() + "'");
if (r.statusCode() != 200) {
throw new RuntimeException("Got unexpected HTTP response code " + r.statusCode()
+ " from " + requestURI.completeURLString());
} else {
String bodyAsString = r.bodyAsString();
if (bodyAsString.isEmpty()) {
throw new RuntimeException("Got empty HTTP response body " + requestURI.completeURLString());
}
try {
log.debug("Attempting to deserialize response");
return OBJECT_MAPPER.readValue(bodyAsString, Response.class);
} catch (JacksonException e) {
throw new RuntimeException("Got unexpected error " + e.getOriginalMessage());
}
}
});
}
@Override
public void close() {View on GitHub (pinned to e1c734241f)
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
Example fix
// before quarkus.spring-cloud-config.url=http://config-server:8888 # secured server, no credentials -> 401 // after quarkus.spring-cloud-config.url=http://config-server:8888 quarkus.spring-cloud-config.username=user quarkus.spring-cloud-config.password=secret
Defensive patterns
Strategy: retry
Validate before calling
// preflight
curl -sS -o /dev/null -w "%{http_code}" -u user:pass "$CONFIG_URL/app/profile" Try / catch
catch (RuntimeException e) {
if (e.getMessage().contains("Got unexpected HTTP response code")) {
// parse status; retry on 5xx with backoff, fail fast on 4xx
}
} Prevention
- Verify app name/profile/label against Config Server repo layout
- Store credentials in a secure config source
- Use retries with backoff for transient 5xx
When it happens
Trigger: 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.
Common situations: Typo in quarkus.application.name vs Config Server repository layout; label/branch missing on the server; firewall or gateway intercepting the request.
Related errors
- Got empty HTTP response body ${requestURI.completeURLString(
- Unable to obtain configuration from Spring Cloud Config Serv
- Got unexpected error ${e.getOriginalMessage()}
- Failed to resolve application model <appArtifact> dependenci
- Failed to initialize Quarkus Maven extension manager
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/9ddcd8e27fc4746f.
Report an issue: GitHub.