{"record":{"id":"76f8c215afedfcce","repo":"apache/hadoop","slug":"must-supply-an-id","errorCode":null,"errorMessage":"Must supply an ID.","messagePattern":"Must supply an 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":664,"sourceCode":"      throw new InvalidRequestException(\"Must supply an ID.\");\n    }\n    CacheDirective prevEntry = getById(id);\n    CacheDirectiveInfo newInfo = createFromInfoAndDefaults(info, prevEntry);\n    removeInternal(prevEntry);\n    addInternal(new CacheDirective(newInfo), getCachePool(newInfo.getPool()));\n  }\n\n  public void modifyDirective(CacheDirectiveInfo info,\n      FSPermissionChecker pc, EnumSet<CacheFlag> flags) throws IOException {\n    assert namesystem.hasWriteLock(RwLockMode.FS);\n    String idString =\n        (info.getId() == null) ?\n            \"(null)\" : info.getId().toString();\n    try {\n      // Check for invalid IDs.\n      Long id = info.getId();\n      if (id == null) {\n        throw new InvalidRequestException(\"Must supply an ID.\");\n      }\n      CacheDirective prevEntry = getById(id);\n      checkWritePermission(pc, prevEntry.getPool());\n\n      // Fill in defaults\n      CacheDirectiveInfo infoWithDefaults =\n          createFromInfoAndDefaults(info, prevEntry);\n      CacheDirectiveInfo.Builder builder =\n          new CacheDirectiveInfo.Builder(infoWithDefaults);\n\n      // Do validation\n      validatePath(infoWithDefaults);\n      validateReplication(infoWithDefaults, (short)-1);\n      // Need to test the pool being set here to avoid rejecting a modify for a\n      // directive that's already been forced into a pool\n      CachePool srcPool = prevEntry.getPool();\n      CachePool destPool = getCachePool(validatePoolName(infoWithDefaults));\n      if (!srcPool.getPoolName().equals(destPool.getPoolName())) {","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java#L646-L682","documentation":"Error \"Must supply an ID.\" thrown in apache/hadoop.","triggerScenarios":"removeCacheDirective called without supplying a directive ID.","commonSituations":"See trigger scenarios.","solutions":["Provide the directive ID with -id when modifying or removing a cache directive."],"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"}