{"record":{"id":"789cedd179c57069","repo":"apache/hadoop","slug":"did-not-find-requested-id-id","errorCode":null,"errorMessage":"Did not find requested id id","messagePattern":"Did not find requested id id","errorType":"exception","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java","lineNumber":759,"sourceCode":"        listCacheDirectives(long prevId,\n            CacheDirectiveInfo filter,\n            FSPermissionChecker pc) throws IOException {\n    assert namesystem.hasReadLock(RwLockMode.FS);\n    final int NUM_PRE_ALLOCATED_ENTRIES = 16;\n    String filterPath = null;\n    if (filter.getPath() != null) {\n      filterPath = validatePath(filter);\n    }\n    if (filter.getReplication() != null) {\n      throw new InvalidRequestException(\n          \"Filtering by replication is unsupported.\");\n    }\n\n    // Querying for a single ID\n    final Long id = filter.getId();\n    if (id != null) {\n      if (!directivesById.containsKey(id)) {\n        throw new InvalidRequestException(\"Did not find requested id \" + id);\n      }\n      // Since we use a tailMap on directivesById, setting prev to id-1 gets\n      // us the directive with the id (if present)\n      prevId = id - 1;\n    }\n\n    ArrayList<CacheDirectiveEntry> replies =\n        new ArrayList<CacheDirectiveEntry>(NUM_PRE_ALLOCATED_ENTRIES);\n    int numReplies = 0;\n    SortedMap<Long, CacheDirective> tailMap =\n      directivesById.tailMap(prevId + 1);\n    for (Entry<Long, CacheDirective> cur : tailMap.entrySet()) {\n      if (numReplies >= maxListCacheDirectivesNumResponses) {\n        return new BatchedListEntries<CacheDirectiveEntry>(replies, true);\n      }\n      CacheDirective curDirective = cur.getValue();\n      CacheDirectiveInfo info = cur.getValue().toInfo();\n","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L741-L777","documentation":"Error \"Did not find requested id id\" thrown in apache/hadoop.","triggerScenarios":"listCacheDirectives filtering by an ID that matches no directive.","commonSituations":"See trigger scenarios.","solutions":["Verify the requested directive ID exists with hdfs cacheadmin -listDirectives."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}