Postgres Source Connector String index out of range: 7991

  • Is this your first time deploying Airbyte?: No
  • OS Version / Instance: Oracle Linux 8 Ec2 Instance
  • Memory / Disk: 32GB / 200GB
  • Deployment: Docker
  • Airbyte Version: 0.40.29
  • Source name/version: Postgres 1.0.36
  • Destination name/version: S3 0.3.18
  • Step: The issue is happening during sync
  • Description:
    Occasionally a specific connection will fail on all 3 attempts with the following error message;
2023-02-27 16:09:11 source > Searching for WAL resume position
2023-02-27 16:09:11 source > First LSN 'LSN{A96/F4050B40}' received
2023-02-27 16:09:11 source > Received COMMIT LSN 'LSN{A96/F4056390}' larger than than last stored commit LSN 'LSN{A96/F401C4C8}'
2023-02-27 16:09:11 source > Will restart from LSN 'LSN{A96/F4050B40}' that is start of the first unprocessed transaction
2023-02-27 16:09:11 source > WAL resume position 'LSN{A96/F4050B40}' discovered
2023-02-27 16:09:11 source > Connection gracefully closed
2023-02-27 16:09:11 source > Connection gracefully closed
2023-02-27 16:09:11 source > Initializing PgOutput logical decoder publication
2023-02-27 16:09:11 source > Requested thread factory for connector PostgresConnector, id = netherbrookprimarydudley_3322147 named = keep-alive
2023-02-27 16:09:11 source > Creating thread debezium-postgresconnector-netherbrookprimarydudley_3322147-keep-alive
2023-02-27 16:09:11 source > Processing messages
2023-02-27 16:09:11 source > Message with LSN 'LSN{A96/F4050B40}' arrived, switching off the filtering
2023-02-27 16:09:11 source > Cannot parse column default value '('now'::text)::date' to type 'date'. Expression evaluation is not supported.
2023-02-27 16:09:11 source > Cannot parse column default value '('now'::text)::date' to type 'date'. Expression evaluation is not supported.
2023-02-27 16:09:11 source > Producer failure
Stack Trace: org.apache.kafka.connect.errors.ConnectException: Error while processing event at offset {transaction_id=null, lsn_proc=11643524416312, lsn_commit=11643522260944, lsn=11643524416312, txId=38886366, ts_usec=1677510464664685}
        at io.debezium.pipeline.EventDispatcher.dispatchDataChangeEvent(EventDispatcher.java:246)
        at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.lambda$processMessages$0(PostgresStreamingChangeEventSource.java:275)
        at io.debezium.connector.postgresql.connection.pgoutput.PgOutputMessageDecoder.decodeUpdate(PgOutputMessageDecoder.java:465)
        at io.debezium.connector.postgresql.connection.pgoutput.PgOutputMessageDecoder.processNotEmptyMessage(PgOutputMessageDecoder.java:194)
        at io.debezium.connector.postgresql.connection.AbstractMessageDecoder.processMessage(AbstractMessageDecoder.java:33)
        at io.debezium.connector.postgresql.connection.PostgresReplicationConnection$1.deserializeMessages(PostgresReplicationConnection.java:510)
        at io.debezium.connector.postgresql.connection.PostgresReplicationConnection$1.readPending(PostgresReplicationConnection.java:502)
        at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.processMessages(PostgresStreamingChangeEventSource.java:215)
        at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:177)
        at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:41)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:174)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:141)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 7991
        at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)
        at java.base/java.lang.String.charAt(String.java:1515)
        at io.debezium.util.Strings.hexStringToByteArray(Strings.java:1051)
        at io.debezium.connector.postgresql.connection.pgoutput.PgOutputColumnValue.asByteArray(PgOutputColumnValue.java:77)
        at io.debezium.connector.postgresql.connection.ReplicationMessageColumnValueResolver.resolveValue(ReplicationMessageColumnValueResolver.java:124)
        at io.debezium.connector.postgresql.connection.pgoutput.PgOutputReplicationMessage.getValue(PgOutputReplicationMessage.java:97)
        at io.debezium.connector.postgresql.connection.pgoutput.PgOutputMessageDecoder$1.getValue(PgOutputMessageDecoder.java:733)
        at io.debezium.connector.postgresql.PostgresChangeRecordEmitter.columnValues(PostgresChangeRecordEmitter.java:184)
        at io.debezium.connector.postgresql.PostgresChangeRecordEmitter.getNewColumnValues(PostgresChangeRecordEmitter.java:129)
        at io.debezium.relational.RelationalChangeRecordEmitter.emitUpdateRecord(RelationalChangeRecordEmitter.java:97)
        at io.debezium.relational.RelationalChangeRecordEmitter.emitChangeRecords(RelationalChangeRecordEmitter.java:53)
        at io.debezium.connector.postgresql.PostgresChangeRecordEmitter.emitChangeRecords(PostgresChangeRecordEmitter.java:96)
        at io.debezium.pipeline.EventDispatcher.dispatchDataChangeEvent(EventDispatcher.java:209)
        ... 17 more

2023-02-27 16:09:11 source > Connection gracefully closed
2023-02-27 16:09:11 source > Connection gracefully closed
2023-02-27 16:09:11 source > Finished streaming
2023-02-27 16:09:11 source > Connected metrics set to 'false'
2023-02-27 16:09:12 source > Stopping the task and engine
2023-02-27 16:09:12 source > Stopping down connector
2023-02-27 16:09:12 source > Stopped FileOffsetBackingStore
2023-02-27 16:09:12 source > Debezium engine shutdown.

I can resolve this issue by recreating the replication slot, however this requires manual intervention and another initial sync to be performed.

Hello there! You are receiving this message because none of your fellow community members has stepped in to respond to your topic post. (If you are a community member and you are reading this response, feel free to jump in if you have the answer!) As a result, the Community Assistance Team has been made aware of this topic and will be investigating and responding as quickly as possible.
Some important considerations that will help your to get your issue solved faster:

  • It is best to use our topic creation template; if you haven’t yet, we recommend posting a followup with the requested information. With that information the team will be able to more quickly search for similar issues with connectors and the platform and troubleshoot more quickly your specific question or problem.
  • Make sure to upload the complete log file; a common investigation roadblock is that sometimes the error for the issue happens well before the problem is surfaced to the user, and so having the tail of the log is less useful than having the whole log to scan through.
  • Be as descriptive and specific as possible; when investigating it is extremely valuable to know what steps were taken to encounter the issue, what version of connector / platform / Java / Python / docker / k8s was used, etc. The more context supplied, the quicker the investigation can start on your topic and the faster we can drive towards an answer.
  • We in the Community Assistance Team are glad you’ve made yourself part of our community, and we’ll do our best to answer your questions and resolve the problems as quickly as possible. Expect to hear from a specific team member as soon as possible.

Thank you for your time and attention.
Best,
The Community Assistance Team