{"record":{"id":"8d00782427ed0b25","repo":"apache/hadoop","slug":"invalid-cipher-suite-name-name","errorCode":null,"errorMessage":"Invalid cipher suite name: ${name}","messagePattern":"Invalid cipher suite name: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CipherSuite.java","lineNumber":91,"sourceCode":"    }\n    builder.append(\"}\");\n    return builder.toString();\n  }\n  \n  /**\n   * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for\n   * certain cipher suite, just need to compare the name.\n   * @param name cipher suite name\n   * @return CipherSuite cipher suite\n   */\n  public static CipherSuite convert(String name) {\n    CipherSuite[] suites = CipherSuite.values();\n    for (CipherSuite suite : suites) {\n      if (suite.getName().equals(name)) {\n        return suite;\n      }\n    }\n    throw new IllegalArgumentException(\"Invalid cipher suite name: \" + name);\n  }\n  \n  /**\n   * Returns suffix of cipher suite configuration.\n   * @return String configuration suffix\n   */\n  public String getConfigSuffix() {\n    String[] parts = name.split(\"/\");\n    StringBuilder suffix = new StringBuilder();\n    for (String part : parts) {\n      suffix.append(\".\").append(StringUtils.toLowerCase(part));\n    }\n    \n    return suffix.toString();\n  }\n}\n","sourceCodeStart":73,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CipherSuite.java#L73-L108","documentation":"CipherSuite.convert(String) resolves a cipher-suite name to the enum by exact, case-sensitive equals() over CipherSuite.values(). In this version the defined names are \"Unknown\", \"AES/CTR/NoPadding\", and \"SM4/CTR/NoPadding\"; anything else throws IllegalArgumentException \"Invalid cipher suite name: <name>\".","triggerScenarios":"hadoop.security.crypto.cipher.suites (or any code path) feeding convert() a lowercase variant like \"aes/ctr/nopadding\", a suite the enum does not define (e.g. \"AES/GCM/NoPadding\"), or a typo'd/whitespace-padded suite string.","commonSituations":"Crypto settings copied from another project with different suite naming; upgrading or downgrading Hadoop where the supported suite set differs; hand-editing core-site.xml encryption config without matching the enum exactly.","solutions":["Use an exact supported name, typically AES/CTR/NoPadding","Enumerate CipherSuite.values() for your Hadoop version and pick a getName() string verbatim","Match case exactly — the comparison is case-sensitive equals(), and trim any stray whitespace"],"exampleFix":"<!-- before -->\n<property><name>hadoop.security.crypto.cipher.suites</name><value>aes/ctr/nopadding</value></property>\n\n<!-- after -->\n<property><name>hadoop.security.crypto.cipher.suites</name><value>AES/CTR/NoPadding</value></property>","handlingStrategy":"validation","validationCode":"static boolean isSupportedSuite(String name) {\n  for (CipherSuite s : CipherSuite.values()) {\n    if (s.getName().equals(name)) { // case-sensitive\n      return true;\n    }\n  }\n  return false;\n}\n// if (!isSupportedSuite(name)) fail with the accepted list before calling convert()","typeGuard":"static Optional<CipherSuite> toSuite(String name) {\n  return Arrays.stream(CipherSuite.values())\n      .filter(s -> s.getName().equals(name))\n      .findFirst();\n}\n// toSuite(name).orElseThrow(() -> new ConfigException(\"unsupported suite: \" + name))","tryCatchPattern":"try {\n  suite = CipherSuite.convert(name);\n} catch (IllegalArgumentException e) {\n  throw new ConfigException(\"hadoop.security.crypto.cipher.suites: use one of \"\n      + Arrays.toString(Arrays.stream(CipherSuite.values()).map(CipherSuite::getName).toArray()), e);\n}","preventionTips":["Pin cipher suites to names verified against CipherSuite.values() for your Hadoop version","Copy crypto config from a known-good cluster instead of hand-typing","Add a startup assertion that logs the resolved suite"],"tags":["crypto","configuration","hadoop"],"backgroundTag":"unsupported-cipher-suite","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}