eclipse-vertx/vert.x · error · VertxException

Invalid url:

Error message

Invalid url: 

What it means

URL parsing failure in HttpConnectOptions.parseUrl: the supplied URI string could not be parsed (bad syntax, unsupported scheme, or missing authority). The message is a generic sentinel prefixed 'Invalid url: ' with the parse error appended; the input at fault is the url string being parsed.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpConnectOptions.java:295

   *
   * Note this is not related to the TCP {@link HttpClientOptions#setConnectTimeout(int)} option, when a request is made against
   * a pooled HTTP client, the timeout applies to the duration to obtain a connection from the pool to serve the request, the timeout
   * might fire because the server does not respond in time or the pool is too busy to serve a request.
   *
   * @param timeout the amount of time in milliseconds.
   * @return a reference to this, so the API can be used fluently
   */
  public HttpConnectOptions setConnectTimeout(long timeout) {
    this.connectTimeout = timeout;
    return this;
  }

  private URL parseUrl(String surl) {
    // Note - parsing a URL this way is slower than specifying host, port and relativeURI
    try {
      return new URL(surl);
    } catch (MalformedURLException e) {
      throw new VertxException("Invalid url: " + surl, e);
    }
  }

  public JsonObject toJson() {
    JsonObject json = new JsonObject();
    HttpConnectOptionsConverter.toJson(this, json);
    Address serverAddr = this.server;
    if (serverAddr instanceof SocketAddress) {
      SocketAddress socketAddr = (SocketAddress) serverAddr;
      json.put("server", socketAddr.toJson());
    }
    return json;
  }
}

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Fix or URL-encode the URI string before passing it
  2. Validate user-supplied URLs with a URI parser before configuring the request
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpConnectOptions.java:295 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/29ccf41930646719. Report an issue: GitHub.