1

I am getting following exception while running debezium with confluent enterprise.

org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped. at io.debezium.connector.base.ChangeEventQueue.throwProducerFailureIfPresent(ChangeEventQueue.java:171) at io.debezium.connector.base.ChangeEventQueue.poll(ChangeEventQueue.java:151) at io.debezium.connector.oracle.OracleConnectorTask.poll(OracleConnectorTask.java:110) at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:259) at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:226) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:177) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:227) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@orclnode:1527/mydb at io.debezium.relational.RelationalSnapshotChangeEventSource.execute(RelationalSnapshotChangeEventSource.java:108) at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:87) at io.debezium.pipeline.ChangeEventSourceCoordinator$$Lambda$485/1478798798.run(Unknown Source) ... 5 more Caused by: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@orclnode:1527/mydb at io.debezium.connector.oracle.OracleConnection.setSessionToPdb(OracleConnection.java:51) at io.debezium.connector.oracle.OracleSnapshotChangeEventSource.prepare(OracleSnapshotChangeEventSource.java:72) at io.debezium.relational.RelationalSnapshotChangeEventSource.execute(RelationalSnapshotChangeEventSource.java:104) ... 7 more Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@orclnode:1527/mydb at java.sql.DriverManager.getConnection(DriverManager.java:689) at java.sql.DriverManager.getConnection(DriverManager.java:247) at io.debezium.connector.oracle.OracleConnectionFactory.connect(OracleConnectionFactory.java:25) at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:768) at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:763) at io.debezium.connector.oracle.OracleConnection.setSessionToPdb(OracleConnection.java:47) ... 9 more [2020-01-15 12:15:25,447] ERROR WorkerSourceTask{id=test-debezium-1-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:180)

Now at first glance it looks like a minor issue but I have tried different drivers and its not working for me. Debezium uses OCI drivers and this is the first time I setup that but I followed the instruction from Oracle website to setup the driver.

My Oracle Version is :

`SELECT * FROM v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE   11.2.0.4.0  Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production`

I have tried following few drivers and more

`
[user@nodexxx oracle]$ ls -l
total 8
drwxr-xr-x. 2 root    root  271 Jan 10 10:45 instantclient_11_2
drwxr-xr-x. 2 user root 4096 Jan 15 11:36 instantclient_12_2
drwxr-xr-x. 3 user root 4096 Jan  8 16:54 instantclient_19_5
[user@nodexxx oracle]$ echo $LD_LIBRARY_PATH
/opt/oracle/instantclient_12_2:
[user@nodexxx oracle]$ echo $PATH
/opt/oracle/instantclient_12_2::/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/app/confluent-5.3.1/bin:/usr/java/jdk1.8.0_231/bin:/home/user/.local/bin:/home/user/bin
[user@nodexxx oracle]$
`

I am installing instant client in my local and oracle DB is running on remote. Do I need to add any other files apart from the instant client downloaded zip.

My Linux Distribution is as shown below:

`
[user@nodexxx oracle]$ sudo lsb_release -a
[sudo] password for user:
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 7.6 (Maipo)
Release:        7.6
Codename:       Maipo
`

My connector's deployed configuration is as shown below:

    {
  "name": "test-debezium-1",
  "config": {
    "connector.class": "io.debezium.connector.oracle.OracleConnector",
    "tasks.max": "1",
    "database.tablename.case.insensitive": "true",
    "database.oracle.version": "11",
    "database.server.name": "deb-linux",#its just a logical name 
    "database.hostname": "orclnode",
    "database.port": "1527",
    "database.user": "xstream",
    "database.password": "xstream",
    "database.dbname": "mydb",
    "database.pdb.name": "",
    "database.out.server.name": "dbzxout",
    "database.history.kafka.bootstrap.servers": "kafka1:9092,kafka2:9092,kafka3:9092",
    "database.history.kafka.topic": "debezium-inventory-topic",
    "snapshot.mode": "initial",
    "table.whitelist": "orcl\\.debezium\\.(.*)",
    "name": "test-debezium-1"
  },
  "tasks": [
    {
      "connector": "test-debezium-1",
      "task": 0
    }
  ],
  "type": "source"
}

I am stuck and have no clue how to resolve this issue.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Zamir Arif
  • 341
  • 2
  • 13
  • Please show your `connect-distributed.properties`. Where is your JAR file? – OneCricketeer Jan 15 '20 at 14:13
  • plugin.path=/app/confluent-5.3.1/share/java,/dev2/connectors,/opt/oracle/instantclient_12_2 - I have added the instant client as well just for the sake of testing. I know its not required there. Debezium connector is in /dev2/connector which is being picked up and control center also shows the debezium connector. – Zamir Arif Jan 15 '20 at 14:36
  • I am not familiar with Oracle. What is in the `instantclient_12_2` folder? JDBC files need to be copied into `kafka-connect-jdbc` folder, they are not "plugins" in terms of Kafka Connect, so are not scanned and added to the classpath – OneCricketeer Jan 15 '20 at 16:13
  • I am not talking about JDBC connector. Its working for me. This thread is regarding the debzium CDC connector which works with OCI driver and instantclient_12_2 is the OCI driver from Oracle – Zamir Arif Jan 15 '20 at 16:16
  • Okay, then why did you post the error of this? `java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@orclnode:1527/mydb`. That is clearly a JDBC error – OneCricketeer Jan 15 '20 at 16:19
  • Yeah you are right but If its a JDBC error then the URL will be a little different. This `jdbc:oracle:oci:@orclnode:1527/mydb` have oci but the jdbc will have thin something like this `jdbc:oracle:thin:@orclnode:1527:mydb`. For me the JDBC connectors are working. – Zamir Arif Jan 15 '20 at 16:29
  • [`thin` and `oci` are different protocols](https://stackoverflow.com/questions/21711085/what-is-the-difference-between-oci-and-thin-driver-connection-with-data-source-c/21711330). `jdbc:oracle` determines the driver JAR, which you are missing. – OneCricketeer Jan 15 '20 at 16:33
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/206016/discussion-between-zamir-arif-and-cricket-007). – Zamir Arif Jan 15 '20 at 16:46
  • As the Debezium docs say. *Copy the files _ojdbc8.jar and xstreams.jar from the Instant Client into Kafka’s libs directory*. In your case, this would need to be `/usr/share/java/kafka`, and repeat this on all debezium machines. Then you restart debezium – OneCricketeer Jan 15 '20 at 18:30
  • Thanks for the response. I made a mistake earlier. I was copying those jars to `/app/confluent-5.3.1/lib` which I moved to `/app/confluent-5.3.1/share/java/kafka` which is the correct directory as mentioned by you but I am still getting the same error. – Zamir Arif Jan 16 '20 at 16:08
  • And you restarted the Connect process? How about putting them in `share/java/kafka-connect-jdbc`? – OneCricketeer Jan 16 '20 at 16:21
  • 1
    Thanks for the response. Restarting the connector resolved that error but still I have the connectivity issue. When I deployed the connector all my JDBC connector failed because it was running on the same node. Then I removed the ojdbc6 jar from the jdbc connector path and amazingly my JDBC connctors are working with the OCI thinclient jars but Debezium is complaining about `java.lang.UnsatisfiedLinkError: no ocijdbc12 in java.library.path` but the library exist in the classpath and JDBC connector need that file as well and its working. – Zamir Arif Jan 16 '20 at 19:05
  • I think `java.library.path` can be set like `export KAFKA_OPTS="-Djava.library.path=/path/to/ocijdbc12"`, then start the connector script after that export – OneCricketeer Jan 16 '20 at 22:09

0 Answers0