{"record":{"id":"44359b538396e622","repo":"quarkusio/quarkus","slug":"multiple-redis-hosts-supplied-for-non-clustered-co","errorCode":null,"errorMessage":"Multiple Redis hosts supplied for non-clustered configuration","messagePattern":"Multiple Redis hosts supplied for non-clustered configuration","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java","lineNumber":92,"sourceCode":"        };\n\n        List<URI> hosts = new ArrayList<>();\n        if (config.hosts().isPresent()) {\n            hosts.addAll(config.hosts().get());\n            configureOptions.accept(config.hosts().get());\n        } else if (config.hostsProviderName().isPresent()) {\n            RedisHostsProvider hostsProvider = findProvider(config.hostsProviderName().get());\n            Collection<URI> computedHosts = hostsProvider.getHosts();\n            hosts.addAll(computedHosts);\n            configureOptions.accept(computedHosts);\n        } else {\n            throw new ConfigurationException(\"Redis host not configured - you must either configure 'quarkus.redis.hosts` or\" +\n                    \" 'quarkus.redis.host-provider-name' and have a bean providing the hosts programmatically.\");\n        }\n\n        if (RedisClientType.STANDALONE == config.clientType()) {\n            if (hosts.size() > 1) {\n                throw new ConfigurationException(\"Multiple Redis hosts supplied for non-clustered configuration\");\n            }\n        }\n\n        config.masterName().ifPresent(options::setMasterName);\n        options.setMaxNestedArrays(config.maxNestedArrays());\n        options.setMaxPoolSize(config.maxPoolSize());\n        options.setMaxPoolWaiting(config.maxPoolWaiting());\n        options.setMaxWaitingHandlers(config.maxWaitingHandlers());\n\n        options.setProtocolNegotiation(config.protocolNegotiation());\n        config.preferredProtocolVersion().ifPresent(options::setPreferredProtocolVersion);\n        options.setPassword(config.password().orElse(null));\n        config.poolCleanerInterval().ifPresent(d -> options.setPoolCleanerInterval((int) d.toMillis()));\n        config.poolRecycleTimeout().ifPresent(d -> options.setPoolRecycleTimeout((int) d.toMillis()));\n        config.topologyCacheTtl().ifPresent(d -> options.setTopologyCacheTTL((int) d.toMillis()));\n\n        config.role().ifPresent(options::setRole);\n        options.setType(config.clientType());","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java#L74-L110","documentation":"When the Redis client type is STANDALONE, VertxRedisClientFactory.create() enforces that at most one host is supplied. A standalone (non-cluster, non-sentinel) Redis client connects to a single endpoint, so multiple hosts are a configuration contradiction and startup fails with a ConfigurationException.","triggerScenarios":"At startup, after host resolution, when config.clientType() == RedisClientType.STANDALONE and the resolved hosts collection contains more than one URI (e.g. quarkus.redis.hosts=redis://h1:6379,redis://h2:6379).","commonSituations":"Copy-pasting a cluster-style comma-separated host list while leaving the default STANDALONE client type; defining hosts via a host provider that returns several URIs for a standalone setup.","solutions":["Supply exactly one host in quarkus.redis.hosts for a standalone client.","If you really connect to a Redis cluster, set quarkus.redis.client-type=cluster.","If using Redis Sentinel, set quarkus.redis.client-type=sentinel and configure quarkus.redis.master-name."],"exampleFix":"// before\nquarkus.redis.hosts=redis://host1:6379,redis://host2:6379\n\n// after (cluster)\nquarkus.redis.client-type=cluster\nquarkus.redis.hosts=redis://host1:6379,redis://host2:6379","handlingStrategy":"validation","validationCode":"String hosts = config.getValue(\"quarkus.redis.hosts\", String.class);\nString type = config.getOptionalValue(\"quarkus.redis.client-type\", String.class).orElse(\"standalone\");\nif (\"standalone\".equalsIgnoreCase(type) && hosts.split(\",\").length > 1) {\n    throw new IllegalStateException(\"Standalone Redis client accepts exactly one host\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match client-type to your topology: standalone=1 host, cluster/sentinel=multiple.","Never reuse cluster host lists in standalone configuration.","Add a startup config test asserting hosts count vs client type."],"tags":["redis","quarkus","configuration","cluster"],"backgroundTag":"invalid-redis-configuration","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}