ORA-21560: argument last_position is null, invalid, or out of range

332 views
Skip to first unread message

Sagar Kapare

unread,
Aug 3, 2021, 1:36:37 PM8/3/21
to debezium
Hi All,

I am trying to connect to the Oracle Database with version 12.1 and using debezium version 1.5.2.Final. 

I am getting following exception in the logs

2021-08-02 13:35:09,909 - ERROR [debezium-oracleconnector-dummy-change-event-source-coordinator:i.d.p.ErrorHandler@31] - Producer failure

oracle.streams.StreamsException: ORA-21560: argument last_position is null, invalid, or out of range

        at oracle.streams.XStreamOut.XStreamOutAttachNative(Native Method) ~[xstreams.jar:na]

        at oracle.streams.XStreamOut.attachInternal(XStreamOut.java:373) ~[xstreams.jar:na]

        at oracle.streams.XStreamOut.attach(XStreamOut.java:343) ~[xstreams.jar:na]

        at io.debezium.connector.oracle.xstream.XstreamStreamingChangeEventSource.execute(XstreamStreamingChangeEventSource.java:85) ~[debezium-connector-oracle-1.5.2.Final.jar:1.5.2.Final]

        at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:152) [debezium-core-1.5.2.Final.jar:1.5.2.Final]

        at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:119) [debezium-core-1.5.2.Final.jar:1.5.2.Final]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_292]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_292]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_292]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_292]

        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_292]

2021-08-02 13:35:09,910 - INFO  [debezium-oracleconnector-dummy-change-event-source-coordinator:i.d.p.ChangeEventSourceCoordinator@153] - Finished streaming

2021-08-02 13:35:09,910 - INFO  [debezium-oracleconnector-dummy-change-event-source-coordinator:i.d.p.m.StreamingChangeEventSourceMetrics@60] - Connected metrics set to 'false'

2021-08-02 13:35:21,360 - INFO  [pool-8-thread-1:i.d.c.c.BaseSourceTask@182] - 4096 records sent during previous 00:00:13.788, last recorded offset: {snapshot=true, scn=17560314071108, snapshot_completed=false}

2021-08-02 13:35:22,491 - INFO  [pool-8-thread-1:i.d.c.c.BaseSourceTask@238] - Stopping down connector

2021-08-02 13:35:22,499 - INFO  [pool-11-thread-1:i.d.j.JdbcConnection@946] - Connection gracefully closed

2021-08-02 13:35:23,503 - WARN  [worker-DeltaWorker-0:i.c.d.a.DeltaWorker@276] - Encountered an error. Events will be replayed from the last successful commit.

org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.

        at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:42) ~[na:na]

        at io.debezium.connector.oracle.xstream.XstreamStreamingChangeEventSource.execute(XstreamStreamingChangeEventSource.java:112) ~[na:na]

        at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:152) ~[na:na]

        at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:119) ~[na:na]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_292]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_292]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_292]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_292]

        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_292]

Caused by: oracle.streams.StreamsException: ORA-21560: argument last_position is null, invalid, or out of range

 

        at oracle.streams.XStreamOut.XStreamOutAttachNative(Native Method) ~[na:na]

        at oracle.streams.XStreamOut.attachInternal(XStreamOut.java:373) ~[na:na]

        at oracle.streams.XStreamOut.attach(XStreamOut.java:343) ~[na:na]

        at io.debezium.connector.oracle.xstream.XstreamStreamingChangeEventSource.execute(XstreamStreamingChangeEventSource.java:85) ~[na:na]

Looks like exception is coming from here - 

Added few debug logs before the call to make sure SCN is not set as null. Also verified that FIRST_SCN in the capture process is smaller than the SCN we are passing to the attach method here.

Has anyone seen this before? Any idea how to get past this issue?

Thanks and Regards,
Sagar 

Sagar Kapare

unread,
Aug 3, 2021, 2:20:19 PM8/3/21
to debe...@googlegroups.com
As an additional note: We are using debezium in embedded mode. Following are the properties with which we start debezium engine

2021-08-03 08:33:10,136 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    connector.class = io.debezium.connector.oracle.OracleConnector

2021-08-03 08:33:10,136 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.user = xstrmadmin

2021-08-03 08:33:10,136 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.dbname = dmdb

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    lcr_position =

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    offset.storage = io.cdap.delta.oracle.OracleConstantOffsetBackingStore

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.connection.adapter = xstream

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.server.name = dummy

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.port = 33000

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    offset.flush.interval.ms = 1000

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.serverTimezone = UTC

2021-08-03 08:33:10,137 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.hostname = dbhost

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.password = ********

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    name = delta

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.out.server.name = xout

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    table.include.list = dm.TESTTABLE1

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    snapshot.mode = initial

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    snapshot =

2021-08-03 08:33:10,138 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    database.history = io.cdap.delta.plugin.common.DBSchemaHistory

2021-08-03 08:33:10,139 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    snapshot_completed =

2021-08-03 08:33:10,139 - INFO  [pool-28-thread-1:i.d.c.c.BaseSourceTask@126] -    scn =

2021-08-03 08:33:10,182 - INFO  [pool-28-thread-1:i.d.c.o.OracleConnection@71] - Database Version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production


Thanks and Regards,

Sagar


--
You received this message because you are subscribed to a topic in the Google Groups "debezium" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/debezium/BrdLXcGZuWk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/c53fcb9f-0d48-4fe1-8e56-da904790402fn%40googlegroups.com.

Sagar Kapare

unread,
Aug 4, 2021, 3:56:28 PM8/4/21
to debe...@googlegroups.com
Hi All,

Adding notes for completeness. We were able to figure out the issue. 

Based on the doc here

Starting with Oracle Database 12c Release 2 (12.2.0.1), the LCRID is versioned. When you create or add an outbound server, you can choose the LCRID version it uses. To specify version 2, the database compatibility level must be at 12.2.0 or higher.

LCR version 2 is used for oracle 12.2.0.1 onwards. Since we are using 12.1, passing connector config (internal.database.oracle.version=11), forced it to use LCR version 1 and the attach call succeeded. 

Thanks and Regards,
Sagar

Chris Cranford

unread,
Aug 4, 2021, 5:13:53 PM8/4/21
to debe...@googlegroups.com, Sagar Kapare
Hi Sagar -

Would you mind opening a Jira issue and including your findings there.  Ideally this should have been handled transitively by the connector without needing to specify "internal.database.oracle.version=11".  A pull request would also be welcomed if you wanted to contribute, the change would be in XStreamStreamingChangeEventSource#resolvePosVersion where POS_VERSION_V1 would be returned for Oracle 11 and Oracle 12.1 only.

CC
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/CANRorfdHaB4vwOmmFCw93N%2B6QsYYZV2hgXovSOV8p0Bqnd9eXQ%40mail.gmail.com.

Sagar Kapare

unread,
Aug 4, 2021, 8:07:46 PM8/4/21
to Chris Cranford, debe...@googlegroups.com
Sure, I will do that. Thanks Chris!
Reply all
Reply to author
Forward
0 new messages