{"record":{"id":"ce11f4b15d4c05f8","repo":"apache/hadoop","slug":"the-data-parameter-is-not-a-valid-base64-encoded-s","errorCode":null,"errorMessage":"The data parameter is not a valid base64-encoded string.","messagePattern":"The data parameter is not a valid base64-encoded string\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/Base64.java","lineNumber":69,"sourceCode":"                                                                             */\n          41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 /*\n                                                                            * 112- 127\n                                                                            */\n  };\n\n  /**\n   * Decodes a given Base64 string into its corresponding byte array.\n   *\n   * @param data\n   *            the Base64 string, as a <code>String</code> object, to decode\n   *\n   * @return the corresponding decoded byte array\n   * @throws IllegalArgumentException\n   *             If the string is not a valid base64 encoded string\n   */\n  public static byte[] decode(final String data) {\n    if (data == null) {\n      throw new IllegalArgumentException(\"The data parameter is not a valid base64-encoded string.\");\n    }\n\n    int byteArrayLength = 3 * data.length() / 4;\n\n    if (data.endsWith(\"==\")) {\n      byteArrayLength -= 2;\n    }\n    else if (data.endsWith(\"=\")) {\n      byteArrayLength -= 1;\n    }\n\n    final byte[] retArray = new byte[byteArrayLength];\n    int byteDex = 0;\n    int charDex = 0;\n\n    for (; charDex < data.length(); charDex += 4) {\n      // get 4 chars, convert to 3 bytes\n      final int char1 = DECODE_64[(byte) data.charAt(charDex)];","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/Base64.java#L51-L87","documentation":"Error \"The data parameter is not a valid base64-encoded string.\" thrown in apache/hadoop.","triggerScenarios":"Base64 decoding is attempted on input containing non-base64 characters.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid base64-encoded string as input.","Check for URL-safe vs standard base64 alphabet mismatches in the producer."],"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"}