Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ranger-kms db_setup.py fails on Oracle Linux 9 #110

Open
zorel opened this issue Dec 16, 2024 · 1 comment
Open

ranger-kms db_setup.py fails on Oracle Linux 9 #110

zorel opened this issue Dec 16, 2024 · 1 comment

Comments

@zorel
Copy link

zorel commented Dec 16, 2024

Ambari 2.7.11-103
ODP-1.2.4.0-77

When installing Ranger-kms with postgresql-13 database:

2024-12-16 11:01:15,884  [JISQL] /etc/alternatives/java_sdk_1.8.0_openjdk/bin/java  -cp /usr/odp/current/ranger-kms/ews/lib/postgresql.jar:/usr/odp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver postgresql -cstring jdbc:postgresql://poc-003:5432/rangerkms -u rangerkms -p '********' -noheader -trim -c \; -query "SELECT 1;"
Exception in thread "main" java.lang.NoClassDefFoundError: com/ongres/scram/common/stringprep/StringPreparation
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:759)
        at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
        at org.postgresql.Driver.makeConnection(Driver.java:465)
        at org.postgresql.Driver.connect(Driver.java:264)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at org.apache.util.sql.Jisql.run(Jisql.java:289)
        at org.apache.util.sql.Jisql.main(Jisql.java:269)
Caused by: java.lang.ClassNotFoundException: com.ongres.scram.common.stringprep.StringPreparation
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 11 more

On Oracle Linux 9, postgresql-jdbc' has a dependency on 'ongres-scram' which is installed in /usr/share/java. This path is not in the classpath of the java command for testing the connection in db_setup.py` of ranger-kms.

I linked the content of /usr/share/java/ongres-scram/ in /usr/odp/1.2.4.0-77/ranger-kms/jisql/lib and recover the host, but it fails later on

/etc/alternatives/java_sdk_1.8.0_openjdk//bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/odp/current/ranger-kms/ews/lib/postgresql.jar org.apache.ambari.server.DBConnectionVerification 'jdbc:postgresql://poc-003:5432/rangerkms' rangerkms [PROTECTED] org.postgresql.Driver' returned 1. ERROR: Unable to connect to the DB. Please check DB connection properties.
java.lang.NoClassDefFoundError: com/ongres/scram/common/stringprep/StringPreparation

There is no "self sufficient" postgresql jdbc package on OL9 it seems. I created it manually and ambarr-server setup it for jdbcm it worked.

@lucasbak
Copy link
Collaborator

Hi @zorel

Thank you for the report opening a internal ticket for tracking the issue.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants