版本: 6.8-8.9
简而言之,当Elasticsearch无法解密已加密的数据时,就会出现此错误。这可能是由于解密密钥不正确或丢失,或者数据在传输过程中已损坏造成的。要解决此问题,您可以尝试重新输入解密密钥,确保它是正确的。如果问题仍然存在,您可能需要重新传输数据,并确保在传输之前已正确加密。如果数据已存储,您可能需要检查存储介质是否存在错误。
日志上下文 #
日志"unable to decode encrypted data"的类名是 CryptoService.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入了解的人参考:
String encrypted = new String(chars; ENCRYPTED_TEXT_PREFIX.length(); chars.length - ENCRYPTED_TEXT_PREFIX.length());
byte[] bytes;
try {
bytes = Base64.getDecoder().decode(encrypted);
} catch (IllegalArgumentException e) {
throw new ElasticsearchException("unable to decode encrypted data"; e);
} byte[] decrypted = decryptInternal(bytes; encryptionKey);
return CharArrays.utf8BytesToChars(decrypted);
}





