{"record":{"id":"90c801ec4925f9af","repo":"apache/hadoop","slug":"hadoop-zk-address-is-not-configured","errorCode":null,"errorMessage":"hadoop.zk.address is not configured.","messagePattern":"hadoop\\.zk\\.address is not configured\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/curator/ZKCuratorManager.java","lineNumber":178,"sourceCode":"\n  /**\n   * Start the connection to the ZooKeeper ensemble.\n   *\n   * @param authInfos  List of authentication keys.\n   * @param sslEnabled If the connection should be SSL/TLS encrypted.\n   * @param zkHostPort Host:Port of the ZooKeeper.\n   * @throws IOException            If the connection cannot be started.\n   */\n  public void start(List<AuthInfo> authInfos, boolean sslEnabled, String zkHostPort)\n      throws IOException {\n\n    ZKClientConfig zkClientConfig = new ZKClientConfig();\n\n    // Connect to the ZooKeeper ensemble\n    if (zkHostPort == null) {\n      zkHostPort = conf.get(CommonConfigurationKeys.ZK_ADDRESS);\n      if (zkHostPort == null) {\n        throw new IOException(\n            CommonConfigurationKeys.ZK_ADDRESS + \" is not configured.\");\n      }\n      LOG.debug(\"Configured {} as {}\", CommonConfigurationKeys.ZK_ADDRESS, zkHostPort);\n    }\n\n    int numRetries = conf.getInt(CommonConfigurationKeys.ZK_NUM_RETRIES,\n        CommonConfigurationKeys.ZK_NUM_RETRIES_DEFAULT);\n    int zkSessionTimeout = conf.getInt(CommonConfigurationKeys.ZK_TIMEOUT_MS,\n        CommonConfigurationKeys.ZK_TIMEOUT_MS_DEFAULT);\n    int zkRetryInterval = conf.getInt(\n        CommonConfigurationKeys.ZK_RETRY_INTERVAL_MS,\n        CommonConfigurationKeys.ZK_RETRY_INTERVAL_MS_DEFAULT);\n    RetryNTimes retryPolicy = new RetryNTimes(numRetries, zkRetryInterval);\n\n    // Set up ZK auths\n    List<ZKUtil.ZKAuthInfo> zkAuths = getZKAuths(conf);\n    if (authInfos == null) {\n      authInfos = new ArrayList<>();","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/curator/ZKCuratorManager.java#L160-L196","documentation":"ZKCuratorManager is hadoop-common's shared Curator/ZooKeeper helper. start(authInfos, sslEnabled, zkHostPort) needs a connect string: when the zkHostPort argument is null it falls back to the hadoop.zk.address Configuration property, and if that is also unset it throws IOException at startup.","triggerScenarios":"Calling start(authInfos), start(authInfos, sslEnabled) or start(authInfos, sslEnabled, null) while the passed Configuration has no hadoop.zk.address; a Configuration built without loading the core-site.xml that defines it; a typo'd property name such as hadoop.zk.addresses.","commonSituations":"Enabling a ZooKeeper-backed feature on a cluster that never ran ZooKeeper; the defining XML living in a conf dir that was not deployed; test fixtures relying on a site file not on the classpath.","solutions":["Add hadoop.zk.address=host:port[,host:port...] to the service's core-site.xml and redeploy","Or pass the connect string explicitly: zkManager.start(authInfos, false, \"zk1:2181,zk2:2181\")","Sanity-check the exact Configuration object: conf.get(\"hadoop.zk.address\") must return non-null in the JVM that calls start()"],"exampleFix":"<!-- before: core-site.xml lacks the property, start(authInfos) throws IOException -->\n<!-- after -->\n<property>\n  <name>hadoop.zk.address</name>\n  <value>zk1.example.com:2181,zk2.example.com:2181</value>\n</property>","handlingStrategy":"validation","validationCode":"String zk = conf.get(\"hadoop.zk.address\");\nif (zk == null || zk.trim().isEmpty()) {\n  throw new IllegalStateException(\n      \"hadoop.zk.address missing: set it in core-site.xml or pass zkHostPort to start()\");\n}\nzkManager.start(authInfos, sslEnabled, zk);","typeGuard":null,"tryCatchPattern":"try {\n  zkManager.start(authInfos, sslEnabled, null);\n} catch (IOException e) {\n  throw new ServiceConfigurationException(\"cannot start ZK client: \" + e.getMessage()\n      + \" - check hadoop.zk.address in core-site.xml\", e);\n}","preventionTips":["Include hadoop.zk.address in every environment template that enables a ZK-backed feature","Assert the config key is present in integration-test setup before calling start()","Prefer passing zkHostPort explicitly in tools where the Configuration may be bare"],"tags":["hadoop","zookeeper","configuration","java","startup"],"backgroundTag":"missing-configuration-key","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}