eclipse-vertx/vert.x · info · IllegalArgumentException
eventLoopPoolSize must be > 0
Error message
eventLoopPoolSize must be > 0
What it means
SC_NETWORK_AUTHENTICATION_REQUIRED is an HttpResponseExpectation constant asserting HTTP 511 (RFC 6585). It validates that a response has status 511 — typically returned by captive portals requiring network login — and fails expectation checks on any other status.
Source
Thrown at vertx-core/src/main/java/io/vertx/core/VertxOptions.java:211
/**
* Get the number of event loop threads to be used by the Vert.x instance.
*
* @return the number of threads
*/
public int getEventLoopPoolSize() {
return eventLoopPoolSize;
}
/**
* Set the number of event loop threads to be used by the Vert.x instance.
*
* @param eventLoopPoolSize the number of threads
* @return a reference to this, so the API can be used fluently
*/
public VertxOptions setEventLoopPoolSize(int eventLoopPoolSize) {
if (eventLoopPoolSize < 1) {
throw new IllegalArgumentException("eventLoopPoolSize must be > 0");
}
this.eventLoopPoolSize = eventLoopPoolSize;
return this;
}
/**
* Get the maximum number of worker threads to be used by the Vert.x instance.
* <p>
* Worker threads are used for running blocking code and worker verticles.
*
* @return the maximum number of worker threads
*/
public int getWorkerPoolSize() {
return workerPoolSize;
}
/**
* Set the maximum number of worker threads to be used by the Vert.x instance.View on GitHub (pinned to fb308bd8c3)
Solutions
- Detect the 511 status and redirect the user to the portal login page before retrying the request.
- Complete network authentication, then re-issue the original request.
- Use SC_NETWORK_AUTHENTICATION_REQUIRED in tests where captive-portal behavior is simulated deliberately.
Example fix
// before
request.expect(HttpResponseExpectation.SC_OK).send();
// after
request.send().onSuccess(resp -> {
if (resp.statusCode() == 511) {
// redirect user to captive portal login, then retry
}
}); Defensive patterns
Strategy: try-catch
Validate before calling
if (response.statusCode() == 511) {
String loginUrl = response.getHeader("Location");
// redirect user to captive portal, then retry the original request
} Try / catch
request.send().onFailure(err -> {
if (err instanceof HttpExpectationFailedException e && e.response().statusCode() == 511) {
// handle captive portal: prompt network login and retry
}
}); Prevention
- Proactively probe for captive portals on untrusted networks before app traffic.
- Detect 511 responses and drive users to the portal login flow.
- Cache portal-completion state and retry original requests after authentication.
When it happens
Trigger: Using HttpResponseExpectation.SC_NETWORK_AUTHENTICATION_REQUIRED against a response whose status is not 511; detecting captive-portal interception of requests.
Common situations: Applications used on public Wi-Fi where a captive portal hijacks HTTP(S) requests and returns 511; network-onboarding flows that must redirect users to a login page.
Related errors
- size must be > 0
- maxExecuteTime must be > 0
- Result is already complete
- Promise already completed
- Unit must not be null
AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06).
Data as JSON: /api/errors/561f667e005884d7.
Report an issue: GitHub.