eclipse-vertx/vert.x · info · IllegalStateException
Promise already completed
Error message
Promise already completed
What it means
SC_HTTP_VERSION_NOT_SUPPORTED is an HttpResponseExpectation constant asserting an HTTP 505 status. As an expectation it fails responses whose status is not 505, surfacing '505 HTTP Version Not Supported'.
Source
Thrown at vertx-core/src/main/java/io/vertx/core/Promise.java:87
* Any handler set on the associated promise will be called.
*
* @param result the result
* @throws IllegalStateException when the promise is already completed
*/
default void complete(T result) {
if (!tryComplete(result)) {
throw new IllegalStateException("Result is already complete");
}
}
/**
* Calls {@code complete(null)}
*
* @throws IllegalStateException when the promise is already completed
*/
default void complete() {
if (!tryComplete(null)) {
throw new IllegalStateException("Promise already completed");
}
}
default void succeed(T result) {
if (!tryComplete(result)) {
throw new IllegalStateException("Promise already completed");
}
}
default void succeed() {
complete(null, null);
}
default void fail(Throwable failure) {
if (!tryFail(failure)) {
throw new IllegalStateException("Promise already completed");
}
}View on GitHub (pinned to fb308bd8c3)
Solutions
- Have the client use an HTTP version the server supports (e.g. force HTTP/1.1) or upgrade the server/proxy.
- Fix the expectation to the status actually returned if 505 was not the intent.
- For version-capability tests, keep SC_HTTP_VERSION_NOT_SUPPORTED and send the unsupported version deliberately.
Example fix
// before request.expect(HttpResponseExpectation.SC_HTTP_VERSION_NOT_SUPPORTED).send(); // after client.options().setProtocolVersion(HttpVersion.HTTP_1_1); request.expect(HttpResponseExpectation.status(200)).send();
Defensive patterns
Strategy: fallback
Validate before calling
HttpVersion v = client.options().getProtocolVersion(); if (v != HttpVersion.HTTP_1_1 && !serverSupports(v)) client.options().setProtocolVersion(HttpVersion.HTTP_1_1);
Prevention
- Pin the HTTP version explicitly in client options when the server only supports HTTP/1.1.
- Verify proxy/ALPN configuration before enabling HTTP/2.
- Keep server and client stacks on tested Vert.x/protocol versions.
When it happens
Trigger: Using HttpResponseExpectation.SC_HTTP_VERSION_NOT_SUPPORTED against a response with another status; verifying a server rejects an unsupported HTTP protocol version.
Common situations: Clients negotiating unusual HTTP versions (e.g. HTTP/2 or experimental versions) against servers supporting only HTTP/1.1; protocol-compatibility test suites.
Related errors
- size must be > 0
- maxExecuteTime must be > 0
- Result is already complete
- eventLoopPoolSize must be > 0
- Unit must not be null
AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06).
Data as JSON: /api/errors/3ae0ca8b452770d0.
Report an issue: GitHub.