Oracle connection issue

183 views
Skip to first unread message

Andrew Meyer

unread,
Feb 1, 2024, 1:40:26 PMFeb 1
to rundeck-discuss
I am building my next server in our test env.  I mimiced the config and setup from the previous install you helped me with and now i'm getting the following error.  See attached text file.

Thanks!


rundeck-test-output.txt

rac...@rundeck.com

unread,
Feb 1, 2024, 1:52:18 PMFeb 1
to rundeck-discuss

Hi Andrew,

Is the ojdbc7.jar file in the $RDECK_BASE/server/lib directory? (not on the $RDECK_BASE/libext directory).

Also, make sure that your db connection is well configured, take a look at this (check carefully the rundeck-config.properties config).

Regards.

Andrew Meyer

unread,
Feb 1, 2024, 2:51:27 PMFeb 1
to rundeck-discuss
Here is what I have.  Everything looks good from what I can tell.  Maybe permissions?


[ansible@server~]$ ls -la /opt/rundeck/server/lib/
total 3616
drwxr-xr-x. 2 ansible ansible      24 Feb  1 17:20 .
drwxr-xr-x. 9 ansible ansible      93 Jan 30 15:41 ..
-rwx------. 1 ansible ansible 3698857 Feb  1 17:20 ojdbc7.jar
[ansible@server~]$


Oracle config:
# OracleDB connection string
dataSource.url = jdbc:oracle:thin:@F.q.D.n:port/SCHEMA
dataSource.driverClassName = oracle.jdbc.OracleDriver
dataSource.username = ORACLE_USERNAME
dataSource.password = $PASSWORD
dataSource.dialect = org.rundeck.hibernate.RundeckOracleDialect
dataSource.properties.validationQuery = SELECT 1 FROM DUAL
dataSource.dbCreate = update


Thanks!

rac...@rundeck.com

unread,
Feb 1, 2024, 3:24:37 PMFeb 1
to rundeck-discuss

Hi Andrew,

Ensure the rundeck user can reach the ojdbc7.jar file (or change the permissions).

Another thing, could you try the URL in this way?

jdbc:oracle:thin:@fqdn:port:orcl

instead of:

jdbc:oracle:thin:@fqdn:port/SCHEMA

Like the docs example. 

Three years ago I made a docker example, you can check the config there.

Regards.

Andrew Meyer

unread,
Feb 1, 2024, 3:42:36 PMFeb 1
to rundeck-discuss
It made no difference.  I will try more in a bit.

Andrew Meyer

unread,
Feb 1, 2024, 4:51:08 PMFeb 1
to rundeck-discuss
The example in your Docker shows the older driver....correct?

JP Lassnibatt

unread,
Feb 1, 2024, 7:37:30 PMFeb 1
to rundeck-discuss
Hi Andrew, on 4.11.0 rundeck-config.properties:
dataSource.dbCreate = none   -----> double check this one
grails.plugin.databasemigration.updateOnStart=true   ----> make sure this is there

Let us know how it goes.

rac...@rundeck.com

unread,
Feb 1, 2024, 7:48:48 PMFeb 1
to rundeck-discuss

Hi Andrew,

What Oracle DB version are you using? Did you test with the ojdbc8.jar file?

I saw the same error when the driver file wasn’t present.

Caused by: java.lang.ClassNotFoundException: Unable to load class: oracle.jdbc.OracleDriver .

Please make sure that the rundeck user can reach the driver.

To test I used the following Oracle 11g XE docker compose deployment file:

version: '3' services: oracle: image: oracleinanutshell/oracle-xe-11g:latest ports: - 1521:1521 volumes: - dbdata:/ORCL volumes: dbdata:

And then I created the Rundeck user as follows:

1) su - oracle
2) sqlplus / as sysdba
3) create USER rundeck IDENTIFIED BY rundeck
4) GRANT CONNECT, RESOURCE, DBA TO rundeck

So, I started Rundeck with the following rundeck-config.properties content:

dataSource.dbCreate = none dataSource.driverClassName = oracle.jdbc.OracleDriver dataSource.url = jdbc:oracle:thin:@localhost:1521:xe dataSource.username = rundeck dataSource.password = rundeck dataSource.dialect = org.rundeck.hibernate.RundeckOracleDialect dataSource.properties.validationQuery = SELECT 1 FROM DUAL grails.plugin.databasemigration.updateOnStart=true

As you see, the dataSource.dbCreate is configured with the none value (your config contains this line with update, change it).

Also, check your grails.plugin.databasemigration.updateOnStart=true, this value must be present in your rundeck-config.properties file.

Regards.

On Thursday, February 1, 2024 at 6:51:08 PM UTC-3 andrew...@panerabread.com wrote:

rac...@rundeck.com

unread,
Feb 2, 2024, 10:11:27 AMFeb 2
to rundeck-discuss

Hi Andrew,

Also tested on Oracle 21XE with the following config:

dataSource.dbCreate = none dataSource.driverClassName = oracle.jdbc.OracleDriver dataSource.url = jdbc:oracle:thin:@localhost:1521:xe dataSource.username = rundeck dataSource.password = rundeck dataSource.dialect = org.rundeck.hibernate.RundeckOracleDialect dataSource.properties.validationQuery = SELECT 1 FROM DUAL grails.plugin.databasemigration.updateOnStart=true

I created a basic Database as follows:

1) alter session set "_ORACLE_SCRIPT"=true;
2) sudo su -
3) su - oracle
4) sqlplus / as sysdba
5) create USER rundeck IDENTIFIED BY rundeck
6) GRANT CONNECT, RESOURCE, DBA TO rundeck

Regards!

Andrew Meyer

unread,
Feb 2, 2024, 10:17:24 AMFeb 2
to rundeck-discuss
Thanks for testing this.  I really do appreciate it.

I double-checked the grails.plugin line.  That is good.  I did change the dataSource.dbCreate to none.

The Oracle version is 12.1.  And we can move it to a new DB if need be.

I also tried with ojdbc8.jar again.  Same thing.  Errors out like what I put in the first message.

rac...@rundeck.com

unread,
Feb 2, 2024, 10:43:05 AMFeb 2
to rundeck-discuss

Weird, try with an empty DB then :/

Did you check the ojdbc8.jar permissions?

BTW, the DB creation order in my example is wrong, this is the real order, my bad:

1) sudo su -
2) su - oracle
3) sqlplus / as sysdba
4) alter session set "_ORACLE_SCRIPT"=true;


5) create USER rundeck IDENTIFIED BY rundeck;

6) GRANT CONNECT, RESOURCE, DBA TO rundeck;

Regards.

Andrew Meyer

unread,
Feb 2, 2024, 2:31:02 PMFeb 2
to rundeck-discuss
I just tried with an empty DB on 12 and 19c.  Same issue.  Made sure ojdbc8.jar was owned by ansible but still only has 700 permissions.

rac...@rundeck.com

unread,
Feb 2, 2024, 2:43:22 PMFeb 2
to rundeck-discuss
Hello, Andrew. 

Why ansible user? 700 Only the owner can read and edit the file (the rundeck user cannot access it). Could you "open" the rights like 644 for testing?

Andrew Meyer

unread,
Feb 2, 2024, 3:20:51 PMFeb 2
to rundeck-discuss
Yes.  But rundeck runs as the ansible user.

Andrew Meyer

unread,
Feb 2, 2024, 3:24:49 PMFeb 2
to rundeck-discuss
Opened it up and tried it again.  Same issue.  I am currently using Java 11, but tried Java 1.8.   Same issue.

rac...@rundeck.com

unread,
Feb 2, 2024, 5:22:57 PMFeb 2
to rundeck-discuss

Hi Andrew,

Just tested Rundeck 4.11 (OpenJDK 11.0.21) + ojdbc8.jar driver + Oracle 12.1.0.2.

How the DB was created on Oracle 12.1.0.2:

  1. sudo su -
  2. su - oracle
  3. sqlplus / as sysdba
  1. alter session set "_ORACLE_SCRIPT"=true;
  1. CREATE USER rundeck IDENTIFIED BY rundeck;
  1. GRANT CONNECT, RESOURCE, DBA TO rundeck;

    My Rundeck rundeck-config.properties db section (Rundeck 4.11):

    dataSource.dbCreate = none dataSource.driverClassName = oracle.jdbc.OracleDriver dataSource.url = jdbc:oracle:thin:@my_oracle_host:1521:ORCLCDB dataSource.username = rundeck dataSource.password = rundeck dataSource.dialect = org.rundeck.hibernate.RundeckOracleDialect dataSource.properties.validationQuery = SELECT 1 FROM DUAL grails.plugin.databasemigration.updateOnStart=true

    Also works using your dataSource.url way: dataSource.url = jdbc:oracle:thin:@my_oracle_host:1521/ORCLCDB

    So, some tips here:

    1. You are launching Rundeck with the sudo command (why?). This indicates you’re launching Rundeck as the root user. This is not a good practice. The best option is to launch it as a normal user.
    2. If you elect not to launch Rundeck as the root user, keep in mind that all Rundeck files are now owned by the root user (so, nobody can’t launch Rundeck then, only the root user).
    3. Another possible underlying problem is the integrity of the ojdbc8.jar file; try redownloading it and ensuring that the user launching Rundeck has read permissions. I downloaded the file from here.
    4. Verify the rundeck-config.properties file integrity. I mean, a blank space in the connection string or in the driver class name could be the source of your problem. Check the whole file carefully.
    5. Check the Oracle server’s database settings and network security. It is most likely configured to avoid connections from your Rundeck host. Could you double-check it?

    Regards.

    Message has been deleted

    Andrew Meyer

    unread,
    Feb 7, 2024, 1:23:59 PMFeb 7
    to rundeck-discuss
    What does this mean:

    [2024-02-07T17:47:36,264] ERROR plugins.JarPluginProviderLoader [pool-3-thread-1] - /opt/rundeck/libext/ojdbc8.jar: Jar plugin manifest attribute missing: Rundeck-Plugin-Archive
    [2024-02-07T18:22:18,277] ERROR plugins.JarPluginProviderLoader [pool-3-thread-1] - /opt/rundeck/libext/ojdbc8.jar: Jar plugin manifest attribute missing: Rundeck-Plugin-Archive

    ??

    rac...@rundeck.com

    unread,
    Feb 7, 2024, 1:27:11 PMFeb 7
    to rundeck-discuss

    Hi Andrew,

    You saved the ojdbc8.jar file in the /opt/rundeck/libext/ directory. This is only for plugins, not for db drivers.

    Just delete the ojdbc8.jar file in the /opt/rundeck/libext/ directory.

    The right place is /opt/rundeck/server/lib/.

    Regards.

    Andrew Meyer

    unread,
    Feb 7, 2024, 4:36:35 PMFeb 7
    to rundeck-discuss

    rac...@rundeck.com

    unread,
    Feb 8, 2024, 8:44:33 AMFeb 8
    to rundeck-discuss
    Hello, Andrew. Could you please describe your problem again? 

    By accident, your post only shows two unformatted files.

    Greetings.
    On Wednesday, February 7, 2024 at 6:36:35 PM UTC-3 andrew...@panerabread.com wrote:

    Andrew Meyer

    unread,
    Feb 8, 2024, 10:03:06 AMFeb 8
    to rundeck-discuss
    Let me attach the output.  I'm getting errors regarding log4j and other plugins.  I assume I need to delete the plugins and let it copy those again. 

    The text file is huge.  Sorry about that.
    t1xrundkadm01-errors.txt

    rac...@rundeck.com

    unread,
    Feb 8, 2024, 10:09:23 AMFeb 8
    to rundeck-discuss

    According to this:

    com.dtolabs.rundeck.core.plugins.PluginException: Error loading class: com.rundeck.plugin.HttpNotificationPlugin

    It seems that you need the HTTP notification plugin. Download this jar file and save it in the libext directory (/opt/rundeck/libext in your case), then restart the rundeck service.

    Regards.

    rac...@rundeck.com

    unread,
    Feb 8, 2024, 10:12:58 AMFeb 8
    to rundeck-discuss
    If you have an old HTTP notification plugin version, delete it and use the latest version (provided in my last post, this one).

    Andrew Meyer

    unread,
    Feb 8, 2024, 12:08:05 PMFeb 8
    to rundeck-discuss
    I figured that's what the issue was.  Thank you.
    Reply all
    Reply to author
    Forward
    0 new messages