{"record":{"id":"c836fa1773856f0c","repo":"redis/jedis","slug":"endpoint-does-not-exist","errorCode":null,"errorMessage":"Endpoint  does not exist.","messagePattern":"Endpoint  does not exist\\.","errorType":"validation","errorClass":"JedisValidationException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/MultiDbClient.java","lineNumber":203,"sourceCode":"   * @return the health status of the endpoint\n   */\n  public boolean isHealthy(Endpoint endpoint) {\n    return getMultiDbConnectionProvider().isHealthy(endpoint);\n  }\n\n  /**\n   * Returns the weight of the specified database.\n   * <p>\n   * This method provides the current weight of a specific endpoint.\n   * </p>\n   * @param endpoint the endpoint to check\n   * @throws redis.clients.jedis.exceptions.JedisValidationException if the endpoint doesn't exist\n   * @return the weight of the endpoint\n   */\n  public float getWeight(Endpoint endpoint) {\n    Database db = getMultiDbConnectionProvider().getDatabase(endpoint);\n    if (db == null) {\n      throw new JedisValidationException(\"Endpoint \" + endpoint + \" does not exist.\");\n    }\n    return db.getWeight();\n  }\n\n  /**\n   * Sets the weight of the specified database.\n   * <p>\n   * This method allows changing the weight of a specific endpoint at runtime. The weight determines\n   * the priority of the endpoint during failover operations.\n   * </p>\n   * @param endpoint the endpoint to change\n   * @param weight the new weight for the endpoint\n   * @throws redis.clients.jedis.exceptions.JedisValidationException if the endpoint doesn't exist\n   */\n  public void setWeight(Endpoint endpoint, float weight) {\n    Database db = getMultiDbConnectionProvider().getDatabase(endpoint);\n    if (db == null) {\n      throw new JedisValidationException(\"Endpoint \" + endpoint + \" does not exist.\");","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MultiDbClient.java#L185-L221","documentation":"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.\"","triggerScenarios":"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.","commonSituations":"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.","solutions":["List configured databases and confirm the exact endpoint (host and port) before calling getWeight","Use the same Endpoint instance or an equal one that was passed to the builder/addDatabase","Catch JedisValidationException if the endpoint may legitimately be absent"],"exampleFix":"// before\nfloat w = client.getWeight(Endpoint.builder().host(\"localhost\").port(6380).build()); // not registered\n// after\nEndpoint ep = Endpoint.builder().host(\"localhost\").port(6379).build(); // endpoint actually added to the config\nfloat w = client.getWeight(ep);","handlingStrategy":"try-catch","validationCode":"// Verify registration before reading a weight\nDatabase db = provider.getDatabase(endpoint);\nif (db == null) {\n  throw new IllegalArgumentException(\"Endpoint not registered: \" + endpoint);\n}","typeGuard":null,"tryCatchPattern":"try {\n  float w = client.getWeight(ep);\n} catch (JedisValidationException e) {\n  logger.warn(\"Endpoint not configured: {}\", ep);\n}","preventionTips":["Store Endpoint objects you registered and reuse them instead of rebuilding by hand","Check host and port equality carefully (same scheme/URI construction)","Account for concurrent removeDatabase calls when reading weights"],"tags":["redis","multi-db","endpoint-lookup","validation"],"backgroundTag":"resource-not-found","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}