{"record":{"id":"7bd264b57478de20","repo":"quarkusio/quarkus","slug":"redis-host-not-configured-you-must-either-config","errorCode":null,"errorMessage":"Redis host not configured - you must either configure 'quarkus.redis.hosts` or 'quarkus.redis.host-provider-name' and have a bean providing the hosts programmatically.","messagePattern":"Redis host not configured - you must either configure 'quarkus\\.redis\\.hosts` or 'quarkus\\.redis\\.host-provider-name' and have a bean providing the hosts programmatically\\.","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"critical","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java","lineNumber":86,"sourceCode":"                        options.addConnectionString(newURI);\n                    } else {\n                        options.addConnectionString(uri.toString().trim());\n                    }\n                }\n            }\n        };\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));","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java#L68-L104","documentation":"VertxRedisClientFactory.create() builds the Redis client from Quarkus configuration. If neither `quarkus.redis.hosts` is set nor `quarkus.redis.host-provider-name` points to a bean providing hosts programmatically, the hosts collection is empty and no connection target exists, so a ConfigurationException is thrown. This is a fail-fast guard so startup fails instead of producing a client that cannot connect.","triggerScenarios":"At application startup, when create() processes a RedisConfig whose hosts property is absent and hostsProviderName is absent (the final else branch of the hosts resolution).","commonSituations":"Adding the redis-client extension but never setting quarkus.redis.hosts in application.properties; profiles (test/prod) where hosts is only defined in one profile; relying on a RedisHostsProvider bean but forgetting to set host-provider-name or forgetting @Identifier on the bean.","solutions":["Set quarkus.redis.hosts=redis://localhost:6379 (or your Redis URI) in application.properties.","If hosts must be computed at runtime, define a RedisHostsProvider bean and set quarkus.redis.host-provider-name to its @Identifier value.","Check that the active Quarkus profile includes the redis hosts property (e.g. %prod.quarkus.redis.hosts)."],"exampleFix":"// before (application.properties)\n# quarkus.redis.hosts not set\n\n// after\nquarkus.redis.hosts=redis://localhost:6379","handlingStrategy":"validation","validationCode":"if (!ConfigUtils.isPropertyPresent(\"quarkus.redis.hosts\") && !ConfigUtils.isPropertyPresent(\"quarkus.redis.host-provider-name\")) {\n    throw new IllegalStateException(\"Configure quarkus.redis.hosts or quarkus.redis.host-provider-name before using the Redis client\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set quarkus.redis.hosts when adding the redis-client extension.","Use SmallRye Config mapping tests (e.g. @TestProfile) to verify Redis config for every profile.","Document required Redis properties per environment (dev/test/prod)."],"tags":["redis","quarkus","configuration","startup"],"backgroundTag":"missing-config-property","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"}