{"record":{"id":"453ff516fe0763af","repo":"apache/hadoop","slug":"cannot-find-namenode-resolver","errorCode":null,"errorMessage":"Cannot find namenode resolver.","messagePattern":"Cannot find namenode resolver\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java","lineNumber":181,"sourceCode":"\n    // Enable the security for the Router\n    UserGroupInformation.setConfiguration(conf);\n    SecurityUtil.login(conf, DFS_ROUTER_KEYTAB_FILE_KEY,\n        DFS_ROUTER_KERBEROS_PRINCIPAL_KEY, getHostName(conf));\n\n    if (conf.getBoolean(\n        RBFConfigKeys.DFS_ROUTER_STORE_ENABLE,\n        RBFConfigKeys.DFS_ROUTER_STORE_ENABLE_DEFAULT)) {\n      // Service that maintains the State Store connection\n      this.stateStore = new StateStoreService();\n      addService(this.stateStore);\n    }\n\n    // Resolver to track active NNs\n    this.namenodeResolver = newActiveNamenodeResolver(\n        this.conf, this.stateStore);\n    if (this.namenodeResolver == null) {\n      throw new IOException(\"Cannot find namenode resolver.\");\n    }\n\n    // Lookup interface to map between the global and subcluster name spaces\n    this.subclusterResolver = newFileSubclusterResolver(this.conf, this);\n    if (this.subclusterResolver == null) {\n      throw new IOException(\"Cannot find subcluster resolver\");\n    }\n\n    if (conf.getBoolean(\n        RBFConfigKeys.DFS_ROUTER_RPC_ENABLE,\n        RBFConfigKeys.DFS_ROUTER_RPC_ENABLE_DEFAULT)) {\n      // Create RPC server\n      this.rpcServer = createRpcServer();\n      addService(this.rpcServer);\n      this.setRpcServerAddress(rpcServer.getRpcAddress());\n    }\n\n    checkRouterId();","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java#L163-L199","documentation":"During Router.init(), FederationUtil.newActiveNamenodeResolver() reflectively instantiates the class in dfs.federation.router.namenode.resolver.client.class (default MembershipNamenodeResolver). If instantiation throws ReflectiveOperationException (class missing, wrong constructor signature, constructor failure) the helper returns null and Router throws IOException('Cannot find namenode resolver.') at startup. The real cause is logged just above as 'Could not instantiate: <class>'.","triggerScenarios":"Setting dfs.federation.router.namenode.resolver.client.class to a class not on the Router classpath, not implementing ActiveNamenodeResolver, or lacking a (Configuration, StateStoreService) constructor; a custom resolver whose constructor throws; dependency shading trimming the resolver class.","commonSituations":"Deploying a custom State Store/resolver plugin jar to only some Routers; typo in the class name in the config; version upgrades that moved/renamed resolver classes; test configurations pointing at a mock class not packaged.","solutions":["Check the Router log for 'Could not instantiate: <resolver>' with the underlying ReflectiveOperationException stack","Fix the key dfs.federation.router.namenode.resolver.client.class to a class on the classpath implementing ActiveNamenodeResolver with a (Configuration, StateStoreService) constructor, or remove the key to use the default MembershipNamenodeResolver","Ship the plugin jar to the Router's classpath (lib/ or static service loading) on every Router host and restart"],"exampleFix":"<!-- before: class not found / wrong signature -->\n<property>\n  <name>dfs.federation.router.namenode.resolver.client.class</name>\n  <value>com.myco.resolver.MyResolver</value>\n</property>\n\n<!-- after: fall back to default or fix the impl -->\n<!-- remove the property to use MembershipNamenodeResolver, or fix MyResolver to expose\n     MyResolver(Configuration conf, StateStoreService stateStore) -->","handlingStrategy":"validation","validationCode":"// Smoke-test resolver instantiation before Router init in a launcher\nString cls = conf.get(\"dfs.federation.router.namenode.resolver.client.class\",\n    \"org.apache.hadoop.hdfs.server.federation.resolver.MembershipNamenodeResolver\");\nClass<?> c = Class.forName(cls); // fails fast with real cause\nif (!org.apache.hadoop.hdfs.server.federation.resolver.ActiveNamenodeResolver.class.isAssignableFrom(c)) {\n  throw new IllegalArgumentException(cls + \" does not implement ActiveNamenodeResolver\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  router.init(conf);\n} catch (IOException e) {\n  if (\"Cannot find namenode resolver.\".equals(e.getMessage())) {\n    // look for 'Could not instantiate' in the log; fix classpath/config for\n    // dfs.federation.router.namenode.resolver.client.class, then restart\n  } else { throw e; }\n}","preventionTips":["Keep resolver class names in config fully qualified and verify the jar exists on all Router hosts","Custom resolvers must expose a (Configuration, StateStoreService) constructor","Add a startup preflight that Class.forName()s configured plugin classes"],"tags":["hdfs","router-based-federation","startup","configuration","resolver","reflection"],"backgroundTag":"class-instantiation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}