Skip to content

EMR Upgrade from 6.5 to 7.5 causing Failed to load OpenSSL Cipher.java.lang.UnsatisfiedLinkError: causing Classnotfound exception

0

After upgrading EMR from 6.5 to 7.5 I am getting following error OpensslCipher: Failed to load OpenSSL Cipher.java.lang.UnsatisfiedLinkError: EVP_CIPHER_CTX_block_sizeBased on the HADOOP-18994 Failed to initialize filesystem s3a://: org.apache.hadoop.fs.s3a.impl.InstantiationIOException: s3a://: Class com. instantiation exception java.lang.ClassNotFoundException:

1 Answer
0

1. Ensure OpenSSL Is Available

Ensure that your EMR cluster nodes have the required native OpenSSL libraries installed:

sudo yum install -y openssl

For EMR 7.x (based on Amazon Linux 2023), this should be:

sudo dnf install openssl openssl-devel

2. Disable OpenSSL Crypto (If Not Needed)

If you don’t need OpenSSL-based crypto (most typical jobs don’t), you can disable it in Hadoop configuration:

Add this to your core-site.xml:

<property>
  <name>hadoop.security.crypto.codec.classes</name>
  <value>org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec</value>
</property>

Or, if you want to disable native crypto entirely:

<property>
  <name>hadoop.security.crypto.codec.classes</name>
  <value>org.apache.hadoop.crypto.JceAesCtrCryptoCodec</value>
</property>

This ensures it defaults to the Java implementation.

3. Verify s3a Classes Are Present

Check if you're explicitly overriding or packaging Hadoop JARs in your job, especially:

  • hadoop-aws
  • aws-java-sdk-bundle

If your job includes older versions of these (e.g., via a fat JAR), they may be incompatible with EMR 7.5 and break s3a:// initialization.

Solution:

  • Don't include Hadoop AWS JARs in your application unless explicitly needed.
  • Use EMR's built-in version instead.
  • If you must override, ensure it's compatible with Hadoop 3.4.

4. Enable Verbose Logging to Diagnose

Add to log4j.properties:

log4j.logger.org.apache.hadoop.crypto=DEBUG
log4j.logger.org.apache.hadoop.fs.s3a=DEBUG

This will help narrow down if it's OpenSSL, classpath, or FS plugin-related.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.