{"record":{"id":"490056f6f0994f84","repo":"apache/hadoop","slug":"ec-policy-s-specified-at-s-is-not-a-valid-poli","errorCode":null,"errorMessage":"EC policy '%s' specified at %s is not a valid policy. Please choose from list of available policies: [%s]","messagePattern":"EC policy '(.+?)' specified at (.+?) is not a valid policy\\. Please choose from list of available policies: \\[(.+?)\\]","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java","lineNumber":519,"sourceCode":"\n  private void enableDefaultPolicy(Configuration conf) throws IOException {\n    defaultPolicyName = conf.getTrimmed(\n        DFSConfigKeys.DFS_NAMENODE_EC_SYSTEM_DEFAULT_POLICY,\n        DFSConfigKeys.DFS_NAMENODE_EC_SYSTEM_DEFAULT_POLICY_DEFAULT);\n    if (!defaultPolicyName.isEmpty()) {\n      final ErasureCodingPolicyInfo info =\n          policiesByName.get(defaultPolicyName);\n      if (info == null) {\n        String names = policiesByName.values()\n            .stream().map((pi) -> pi.getPolicy().getName())\n            .collect(Collectors.joining(\", \"));\n        String msg = String.format(\"EC policy '%s' specified at %s is not a \"\n                + \"valid policy. Please choose from list of available \"\n                + \"policies: [%s]\",\n            defaultPolicyName,\n            DFSConfigKeys.DFS_NAMENODE_EC_SYSTEM_DEFAULT_POLICY,\n            names);\n        throw new IOException(msg);\n      }\n      info.setState(ErasureCodingPolicyState.ENABLED);\n      enabledPoliciesByName.put(info.getPolicy().getName(), info.getPolicy());\n    }\n  }\n\n  private void updatePolicies() {\n    enabledPolicies =\n        enabledPoliciesByName.values().toArray(new ErasureCodingPolicy[0]);\n    allPolicies =\n        policiesByName.values().toArray(new ErasureCodingPolicyInfo[0]);\n  }\n\n  public String getEnabledPoliciesMetric() {\n    return StringUtils.join(\", \",\n            enabledPoliciesByName.keySet());\n  }\n","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java#L501-L537","documentation":"Error \"EC policy '%s' specified at %s is not a valid policy. Please choose from list of available policies: [%s]\" thrown in apache/hadoop.","triggerScenarios":"Unsetting an erasure coding policy on a directory whose explicitly set policy name does not match any known policy (typically after downgrade or policy removal).","commonSituations":"See trigger scenarios.","solutions":["Choose one of the listed available EC policies.","Enable the desired policy with 'hdfs ec -enablePolicy -policy <name>' before using it."],"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"}