{"record":{"id":"7b3cbff820ea9335","repo":"apache/hadoop","slug":"no-directive-with-id-id-found","errorCode":null,"errorMessage":"No directive with ID id found.","messagePattern":"No directive with ID id found\\.","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":524,"sourceCode":"    return new CacheDirectiveStats.Builder()\n        .setBytesNeeded(requestedBytes * replication)\n        .setFilesCached(requestedFiles)\n        .build();\n  }\n\n  /**\n   * Get a CacheDirective by ID, validating the ID and that the directive\n   * exists.\n   */\n  private CacheDirective getById(long id) throws InvalidRequestException {\n    // Check for invalid IDs.\n    if (id <= 0) {\n      throw new InvalidRequestException(\"Invalid negative ID.\");\n    }\n    // Find the directive.\n    CacheDirective directive = directivesById.get(id);\n    if (directive == null) {\n      throw new InvalidRequestException(\"No directive with ID \" + id\n          + \" found.\");\n    }\n    return directive;\n  }\n\n  /**\n   * Get a CachePool by name, validating that it exists.\n   */\n  private CachePool getCachePool(String poolName)\n      throws InvalidRequestException {\n    CachePool pool = cachePools.get(poolName);\n    if (pool == null) {\n      throw new InvalidRequestException(\"Unknown pool \" + poolName);\n    }\n    return pool;\n  }\n\n  // RPC handlers","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L506-L542","documentation":"Error \"No directive with ID id found.\" thrown in apache/hadoop.","triggerScenarios":"modifyCacheDirective referencing a directive ID that does not exist.","commonSituations":"See trigger scenarios.","solutions":["List directives with hdfs cacheadmin -listDirectives and use an existing directive ID."],"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"}