Open alexnikitchuk opened 1 year ago
I have encountered problem recently.
Caused by: java.lang.RuntimeException: org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
at io.airbyte.integrations.debezium.internals.DebeziumRecordPublisher.close(DebeziumRecordPublisher.java:106)
at io.airbyte.commons.concurrency.VoidCallable.call(VoidCallable.java:15)
at io.airbyte.integrations.debezium.internals.DebeziumShutdownProcedure.initiateShutdownProcedure(DebeziumShutdownProcedure.java:93)
... 34 more
Caused by: 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:72)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:392)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:923)
at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.debezium.DebeziumException: Error processing binlog event
... 7 more
Caused by: io.debezium.DebeziumException: Encountered change event for table db.tb_keyword whose schema isn't known to this connector
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.informAboutUnknownTableIfRequired(MySqlStreamingChangeEventSource.java:697)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.informAboutUnknownTableIfRequired(MySqlStreamingChangeEventSource.java:738)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleUpdateTableMetadata(MySqlStreamingChangeEventSource.java:653)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:893)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:372)
... 6 more
,retryable=<null>,timestamp=1691589283467,additionalProperties={}], io.airbyte.config.FailureReason@5082207[failureOrigin=source,failureType=<null>,internalMessage=Source didn't exit properly - check the logs!,externalMessage=Something went wrong within the source connector,metadata=io.airbyte.config.Metadata@1cfba6bc[additionalProperties={attemptNumber=2, jobId=14084, connector_command=read}],stacktrace=io.airbyte.workers.internal.exception.SourceException: Source didn't exit properly - check the logs!
at io.airbyte.workers.general.DefaultReplicationWorker.lambda$readFromSrcAndWriteToDstRunnable$5(DefaultReplicationWorker.java:303)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: io.airbyte.workers.exception.WorkerException: Source process exit with code 1. This warning is normal if the job was cancelled.
at io.airbyte.workers.internal.DefaultAirbyteSource.close(DefaultAirbyteSource.java:145)
at io.airbyte.workers.general.DefaultReplicationWorker.lambda$readFromSrcAndWriteToDstRunnable$5(DefaultReplicationWorker.java:301)
... 4 more
@ifun248 @alexnikitchuk could you share the steps to reproduce this or what exactly were you doing while you got this error?
When we add a new table to the existing connection after a while it fails with Debezium exception
This error appears when we add a new table to the existing connection.
@alexnikitchuk does this happen every time you add a new table to an existing connection or was it a one time thing? Was the table newly created or an existing table?
@alexnikitchuk does this happen every time you add a new table to an existing connection or was it a one time thing? Was the table newly created or an existing table?
Every time. The error occurs not immediately but after some time. Not sure what triggers it. It is an existing table
I see! And when you add the table, does the Airbyte user that you use to sync have access to these tables from the start or do you first grant access to the table, refresh the Airbtye UI and then select the new table? Basically walk me through the entire process of adding a new table to an already running sync. I am trying to repro this
gotcha, so we limit the tables Airbyte user has access to to workaround another issue https://github.com/airbytehq/airbyte/issues/24650 And when we need to sync another table we grant select on it to the user, click refresh on connection page on UI and select the new table
Thank you @alexnikitchuk . I have been able to reproduce this error. The steps I followed :
The error comes while trying to parse the binlog for the newly added table.
@alexnikitchuk does this happen every time you add a new table to an existing connection or was it a one time thing? Was the table newly created or an existing table?
@subodh1810 For me, this happens sometimes when add a new table to an existing connection, which may come from Debezium. Ref: https://stackoverflow.com/questions/75518352/debezium-mysql-connector-error-encountered-change-event-for-table-whose-schema
@alexnikitchuk the workaround you needed for https://github.com/airbytehq/airbyte/issues/24650 should no longer be needed, since we are compressing schema history. With that change, can you remove the limitation of tables the Airbyte user has access to mentioned above.
Hello,
I just wanted to comment that we have seen this error as well but with a slightly different setup. We have a user with SELECT grants to the entire database we are syncing. We sometimes create a new table but don't populate it immediately with data. Several days later when we insert the first rows, we get the same error (note I replaced the database and table with X:
"trace": "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:72)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:392)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$27(MySqlStreamingChangeEventSource.java:923)
at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1246)
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1072)
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:631)
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:932)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: io.debezium.DebeziumException: Error processing binlog event
... 7 more
Caused by: io.debezium.DebeziumException: Encountered change event for table XXX.XXXX whose schema isn't known to this connector
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.informAboutUnknownTableIfRequired(MySqlStreamingChangeEventSource.java:697)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.informAboutUnknownTableIfRequired(MySqlStreamingChangeEventSource.java:738)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleUpdateTableMetadata(MySqlStreamingChangeEventSource.java:653)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:893)
at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:372)
... 6 more
"
Update 2
Can't get it to work reliably. Even after multiple refresh, clear data, setups. Fails with this or that table whose schema isn't known to this connector
Update 1
It showed failed sync. I clicked on sync again. Entire data showed in redshift, error is gone.
Original All latest install. Getting this error for syncing mariadb using mysql connector. [ sometime it syncs, sometime if fails ]
2024-11-22 14:06:00 source > ERROR blc-10.0.0.12:3306 i.d.c.b.BinlogStreamingChangeEventSource(informAboutUnknownTableIfRequired):979 Encountered change event 'Event{header=EventHeaderV4{timestamp=1732279334000, eventType=TABLE_MAP, serverId=1, headerLength=19, dataLength=50, nextPosition=0, flags=0}, data=TableMapEventData{tableId=154, database='xxx', table='users', columnTypes=15, 1, 15, 15, 8, 15, -4, 15, 17, 17, 15, columnMetadata=144, 0, 1024, 1024, 0, 640, 2, 144, 0, 0, 512, columnNullability={6, 7, 9}, eventMetadata=null}}' at offset {file=mysql-bin.000160, pos=0, server_id=1} for table xxx.users whose schema isn't known to this connector. One possible cause is an incomplete database schema history topic. Take a new snapshot in this case.
Use the mysqlbinlog tool to view the problematic event: mysqlbinlog --start-position=-69 --stop-position=0 --verbose mysql-bin.000160
2024-11-22 14:06:00 source > ERROR blc-10.0.0.12:3306 i.d.c.b.BinlogStreamingChangeEventSource(logStreamingSourceState):1145 Error during binlog processing. Last offset stored = {file=mysql-bin.000160, pos=0, server_id=1, event=1}, binlog reader near position = mysql-bin.000160/3974
2024-11-22 14:06:00 source > ERROR blc-10.0.0.12:3306 i.d.p.ErrorHandler(setProducerThrowable):52 Producer failure io.debezium.DebeziumException: Error processing binlog event
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.handleEvent(BinlogStreamingChangeEventSource.java:579) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.lambda$execute$17(BinlogStreamingChangeEventSource.java:209) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1268) ~[mysql-binlog-connector-java-0.29.2.jar:0.29.2]
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1094) ~[mysql-binlog-connector-java-0.29.2.jar:0.29.2]
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:653) ~[mysql-binlog-connector-java-0.29.2.jar:0.29.2]
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:954) ~[mysql-binlog-connector-java-0.29.2.jar:0.29.2]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: io.debezium.DebeziumException: Encountered change event for table xxx.users whose schema isn't known to this connector
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.informAboutUnknownTableIfRequired(BinlogStreamingChangeEventSource.java:984) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.informAboutUnknownTableIfRequired(BinlogStreamingChangeEventSource.java:1036) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.handleUpdateTableMetadata(BinlogStreamingChangeEventSource.java:785) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.lambda$execute$4(BinlogStreamingChangeEventSource.java:178) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
at io.debezium.connector.binlog.BinlogStreamingChangeEventSource.handleEvent(BinlogStreamingChangeEventSource.java:559) ~[debezium-connector-binlog-2.7.1.Final.jar:2.7.1.Final]
... 6 more
Connector Name
source-mysql
Connector Version
2.0.19
What step the error happened?
During the sync
Revelant information
When we add a new table to the existing connection after a while it fails with Debezium exception
It seems like the connector does not propagate schema for the new table into the state: there is no ddl key for the new table. The workaround is resetting the whole connection whenever you add a new table.
Relevant log output
Contribute