{"record":{"id":"29ce3a0c6e2260ed","repo":"apache/hadoop","slug":"identifier-identifier-does-not-exist-in-refre","errorCode":null,"errorMessage":"Identifier '${identifier}' does not exist in RefreshRegistry. Valid options are: ${validOptions}","messagePattern":"Identifier '(.+?)' does not exist in RefreshRegistry\\. Valid options are: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RefreshRegistry.java","lineNumber":102,"sourceCode":"  }\n\n  /**\n   * Lookup the responsible handler and return its result.\n   * This should be called by the RPC server when it gets a refresh request.\n   * @param identifier the resource to refresh\n   * @param args the arguments to pass on, not including the program name\n   * @throws IllegalArgumentException on invalid identifier\n   * @return the response from the appropriate handler\n   */\n  public synchronized Collection<RefreshResponse> dispatch(String identifier, String[] args) {\n    Collection<RefreshHandler> handlers = handlerTable.get(identifier);\n\n    if (handlers.size() == 0) {\n      String msg = \"Identifier '\" + identifier +\n        \"' does not exist in RefreshRegistry. Valid options are: \" +\n        Joiner.on(\", \").join(handlerTable.keySet());\n\n      throw new IllegalArgumentException(msg);\n    }\n\n    ArrayList<RefreshResponse> responses =\n      new ArrayList<RefreshResponse>(handlers.size());\n\n    // Dispatch to each handler and store response\n    for(RefreshHandler handler : handlers) {\n      RefreshResponse response;\n\n      // Run the handler\n      try {\n        response = handler.handleRefresh(identifier, args);\n        if (response == null) {\n          throw new NullPointerException(\"Handler returned null.\");\n        }\n\n        LOG.info(handlerName(handler) + \" responds to '\" + identifier +\n          \"', says: '\" + response.getMessage() + \"', returns \" +","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/RefreshRegistry.java#L84-L120","documentation":"RefreshRegistry.dispatch looks up handlers by identifier in a Guava Multimap; when no handler is registered it throws IllegalArgumentException listing every registered identifier as 'Valid options'. It is how refresh requests (dfsadmin/rmadmin '-refresh...' style flows over the admin protocol) reject an unknown resource name. Note the registry is a JVM-global singleton, so validity depends on what that process registered.","triggerScenarios":"Dispatching a refresh whose identifier differs from any registered handler: a typo, different casing, an identifier registered in a different daemon, or a handler never registered because the feature is not loaded. Because handlerTable is a Multimap keyed by exact string, only an exact match dispatches.","commonSituations":"Running a refresh command against a service that does not support it (e.g., user-to-group mapping refresh on a daemon that never registered it); custom refreshables where client and server disagree on the identifier string; version differences changing which refreshables exist.","solutions":["Use one of the valid options printed in the message itself — they are the registered identifiers of the target process.","Register the handler server-side with the exact identifier the admin client sends; matching is exact string comparison.","For custom refreshables, share the identifier as a constant between registration code and client invocation code so the two can never drift."],"exampleFix":"// before\nString id = readFromConfig(); // \"MyPlugin\" — not registered anywhere\nRefreshRegistry.defaultRegistry().dispatch(id, args); // IllegalArgumentException\n// after\n// server init: RefreshRegistry.defaultRegistry().register(MyPlugin.REFRESH_ID, handler);\nRefreshRegistry.defaultRegistry().dispatch(MyPlugin.REFRESH_ID, args); // exact same constant","handlingStrategy":"validation","validationCode":"// share one constant between registration and dispatch so they cannot drift\npublic static final String REFRESH_ID = \"com.example.myplugin\";\n// server init:\nRefreshRegistry.defaultRegistry().register(REFRESH_ID, handler);\n// client / test, before dispatch:\nif (!REFRESH_ID.equals(requestedId)) {\n  throw new IllegalArgumentException(\n      \"unknown refresh id '\" + requestedId + \"', expected \" + REFRESH_ID);\n}\nRefreshRegistry.defaultRegistry().dispatch(requestedId, args);","typeGuard":null,"tryCatchPattern":"Catch IllegalArgumentException around dispatch and surface its message to the operator — the 'Valid options are:' list is the authoritative set of registered identifiers for that process.","preventionTips":["Define the identifier once as a shared constant used by both server registration and client invocation.","Confirm the target daemon actually registers the refreshable before exposing the admin command.","Remember the registry is per-JVM: an identifier valid on the NameNode may not exist on another daemon."],"tags":["refresh","registry","admin","dispatch","identifier"],"backgroundTag":"unknown-command","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}