{"record":{"id":"5837b66cfc1c08cb","repo":"apache/hadoop","slug":"invalid-account-key","errorCode":null,"errorMessage":"Invalid account key.","messagePattern":"Invalid account key\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/SharedKeyCredentials.java","lineNumber":76,"sourceCode":"  private static final Pattern CRLF = Pattern.compile(\"\\r\\n\", Pattern.LITERAL);\n  private static final String HMAC_SHA256 = \"HmacSHA256\";\n  /**\n   * Stores a reference to the RFC1123 date/time pattern.\n   */\n  private static final String RFC1123_PATTERN = \"EEE, dd MMM yyyy HH:mm:ss z\";\n\n\n  private String accountName;\n  private byte[] accountKey;\n  private Mac hmacSha256;\n\n  public SharedKeyCredentials(final String accountName,\n                              final String accountKey) {\n    if (accountName == null || accountName.isEmpty()) {\n      throw new IllegalArgumentException(\"Invalid account name.\");\n    }\n    if (accountKey == null || accountKey.isEmpty()) {\n      throw new IllegalArgumentException(\"Invalid account key.\");\n    }\n    this.accountName = accountName;\n    this.accountKey = Base64.decode(accountKey);\n    initializeMac();\n  }\n\n  public void signRequest(AbfsHttpOperation connection, final long contentLength) throws UnsupportedEncodingException {\n\n    String gmtTime = getGMTTime();\n    connection.setRequestProperty(HttpHeaderConfigurations.X_MS_DATE, gmtTime);\n\n    final String stringToSign = canonicalize(connection, accountName, contentLength);\n\n    final String computedBase64Signature = computeHmac256(stringToSign);\n\n    String signature = String.format(\"%s %s:%s\", \"SharedKey\", accountName,\n        computedBase64Signature);\n    connection.setRequestProperty(HttpHeaderConfigurations.AUTHORIZATION,","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/SharedKeyCredentials.java#L58-L94","documentation":"Error \"Invalid account key.\" thrown in apache/hadoop.","triggerScenarios":"SharedKeyCredentials is constructed with a missing or invalid account key.","commonSituations":"See trigger scenarios.","solutions":["Set fs.azure.account.key.<account> to the correct base64 storage account key.","Check for truncation or extra whitespace in the configured key."],"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"}