redis/jedis · error · JedisValidationException

Endpoint does not exist.

Error message

Endpoint  does not exist.

What it means

MultiDbClient.getWeight looks up the Database registered for the given Endpoint in the MultiDbConnectionProvider. If no database is registered under that endpoint, it throws JedisValidationException "Endpoint <endpoint> does not exist."

Solutions

  1. List configured databases and confirm the exact endpoint (host and port) before calling getWeight
  2. Use the same Endpoint instance or an equal one that was passed to the builder/addDatabase
  3. Catch JedisValidationException if the endpoint may legitimately be absent

Example fix

// before
float w = client.getWeight(Endpoint.builder().host("localhost").port(6380).build()); // not registered
// after
Endpoint ep = Endpoint.builder().host("localhost").port(6379).build(); // endpoint actually added to the config
float w = client.getWeight(ep);
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify registration before reading a weight
Database db = provider.getDatabase(endpoint);
if (db == null) {
  throw new IllegalArgumentException("Endpoint not registered: " + endpoint);
}

Try / catch

try {
  float w = client.getWeight(ep);
} catch (JedisValidationException e) {
  logger.warn("Endpoint not configured: {}", ep);
}

Prevention

When it happens

Trigger: Calling getWeight(Endpoint) with an endpoint that was never added, was removed via removeDatabase, or an Endpoint instance that does not equal (host/port/URI semantics) any registered one.

Common situations: Typos or port mismatches when constructing the Endpoint; querying a weight after removing the database; using an Endpoint built with a different scheme/URI form than the one configured.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of redis/jedis@6dac31d4c2 (2026-09-08). Data as JSON: /api/errors/c836fa1773856f0c. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/redis/clients/jedis/MultiDbClient.java:203

   * @return the health status of the endpoint
   */
  public boolean isHealthy(Endpoint endpoint) {
    return getMultiDbConnectionProvider().isHealthy(endpoint);
  }

  /**
   * Returns the weight of the specified database.
   * <p>
   * This method provides the current weight of a specific endpoint.
   * </p>
   * @param endpoint the endpoint to check
   * @throws redis.clients.jedis.exceptions.JedisValidationException if the endpoint doesn't exist
   * @return the weight of the endpoint
   */
  public float getWeight(Endpoint endpoint) {
    Database db = getMultiDbConnectionProvider().getDatabase(endpoint);
    if (db == null) {
      throw new JedisValidationException("Endpoint " + endpoint + " does not exist.");
    }
    return db.getWeight();
  }

  /**
   * Sets the weight of the specified database.
   * <p>
   * This method allows changing the weight of a specific endpoint at runtime. The weight determines
   * the priority of the endpoint during failover operations.
   * </p>
   * @param endpoint the endpoint to change
   * @param weight the new weight for the endpoint
   * @throws redis.clients.jedis.exceptions.JedisValidationException if the endpoint doesn't exist
   */
  public void setWeight(Endpoint endpoint, float weight) {
    Database db = getMultiDbConnectionProvider().getDatabase(endpoint);
    if (db == null) {
      throw new JedisValidationException("Endpoint " + endpoint + " does not exist.");

View on GitHub (pinned to 6dac31d4c2)