You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "RichardXu186 (via GitHub)" <gi...@apache.org> on 2025/09/10 08:53:06 UTC

[I] [Bug] [Module Name] mysql-cdc source [seatunnel]

RichardXu186 opened a new issue, #9844:
URL: https://github.com/apache/seatunnel/issues/9844

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   source表有800多万条记录,在抽取到160多万时报错:Caused by: com.mysql.cj.exceptions.WrongArgumentException: Buffer length is less then expected payload length.
   source配置如下:
   source {
     MYSQL-CDC {
           base-url = "jdbc:mysql://10.xx.xx.119:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&maxAllowedPacket=1073741824"
           driver = "com.mysql.cj.jdbc.Driver"
           server-id= 20131
           username = "dbuser"
           password = "password"
           table-names =  ["dbname.dbtable"]
           startup.mode = "initial"
      }
   }
   
   
   ### SeaTunnel Version
   
   2.3.7
   
   ### SeaTunnel Config
   
   ```conf
   source {
     MYSQL-CDC {
           base-url = "jdbc:mysql://10.xx.xx.119:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&maxAllowedPacket=1073741824"
           driver = "com.mysql.cj.jdbc.Driver"
           server-id= 20131
           username = "dbuser"
           password = "password"
           table-names =  ["dbname.dbtable"]
           startup.mode = "initial"
      }
   }
   sink{
     jdbc {
           url = "jdbc:mysql://10.3x.1x.2x:13079/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&useSSL=false&maxAllowedPacket=67108864"
           driver = "com.mysql.cj.jdbc.Driver"
           user = "dbuserr"
           password = "Password"
           batch_size = 100
           batch_interval_ms = 500
           # Automatically generate sql statements based on database table names
           generate_sink_sql = true
           database = dbname
           table = tablename
           primary_keys = ["id"]
           schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
           data_save_mode = "APPEND_DATA"
   
        }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh -c ./config/ds/tablename.config -m local
   ```
   
   ### Error Exception
   
   ```log
   2025-09-10 16:46:58,671 ERROR [e.IncrementalSourceScanFetcher] [debezium-snapshot-reader-0] - Execute snapshot read task for snapshot split org.apache.seatunnel.connectors.cdc.b
   ase.source.split.SnapshotSplit@f43656d1 fail
   io.debezium.DebeziumException: java.lang.RuntimeException: Failed to build the split data read statement.
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.execute(MySqlSnapshotSplitReadTask.java:122) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotFetchTask.execute(MySqlSnapshotFetchTask.java:71) ~[?:?]
           at org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.lambda$submitTask$0(IncrementalSourceScanFetcher.java:95) ~[?:?]
           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
           at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
           at java.lang.Thread.run(Thread.java:834) [?:?]
   Caused by: java.lang.RuntimeException: Failed to build the split data read statement.
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlUtils.readTableSplitDataStatement(MySqlUtils.java:318) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.createDataEventsForTable(MySqlSnapshotSplitReadTask.java:207)
   ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.createDataEvents(MySqlSnapshotSplitReadTask.java:179) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.doExecute(MySqlSnapshotSplitReadTask.java:147) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.execute(MySqlSnapshotSplitReadTask.java:117) ~[?:?]
           ... 7 more
   Caused by: java.sql.SQLException: Buffer length is less then expected payload length.
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at com.mysql.cj.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:2045) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlUtils.initStatement(MySqlUtils.java:385) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.utils.MySqlUtils.readTableSplitDataStatement(MySqlUtils.java:295) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.createDataEventsForTable(MySqlSnapshotSplitReadTask.java:207)
   ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.createDataEvents(MySqlSnapshotSplitReadTask.java:179) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.doExecute(MySqlSnapshotSplitReadTask.java:147) ~[?:?]
           at org.apache.seatunnel.connectors.seatunnel.cdc.mysql.source.reader.fetch.scan.MySqlSnapshotSplitReadTask.execute(MySqlSnapshotSplitReadTask.java:117) ~[?:?]
           ... 7 more
   Caused by: com.mysql.cj.exceptions.WrongArgumentException: Buffer length is less then expected payload length.
           at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
           at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
           at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
           at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
           at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at com.mysql.cj.protocol.a.NativePacketPayload.readString(NativePacketPayload.java:632) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at com.mysql.cj.protocol.a.NativePacketPayload.readString(NativePacketPayload.java:606) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at com.mysql.cj.protocol.a.NativeServerSessionStateController$NativeServerSessionStateChanges.init(NativeServerSessionStateController.java:119) ~[mysql-connector-j-8.0.3
   3.jar:8.0.33]
           at com.mysql.cj.protocol.a.result.OkPacket.parse(OkPacket.java:66) ~[mysql-connector-j-8.0.33.jar:8.0.33]
           at com.mysql.cj.protocol.a.NativeProtocol.readServerStatusForResultSets(NativeProtocol.java:1691) ~[mysql-connector-j-8.0.33.jar:8.0.33]
   ```
   
   ### Zeta or Flink or Spark Version
   
   2.3.7版本默认的zeta版本
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Module Name] mysql-cdc source [seatunnel]

Posted by "RichardXu186 (via GitHub)" <gi...@apache.org>.
RichardXu186 commented on issue #9844:
URL: https://github.com/apache/seatunnel/issues/9844#issuecomment-3277120866

   重新运行,有时可以达到300万才报错,有时不到100万就报这个错误


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Module Name] mysql-cdc source [seatunnel]

Posted by "RichardXu186 (via GitHub)" <gi...@apache.org>.
RichardXu186 closed issue #9844: [Bug] [Module Name] mysql-cdc source
URL: https://github.com/apache/seatunnel/issues/9844


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Module Name] mysql-cdc source [seatunnel]

Posted by "RichardXu186 (via GitHub)" <gi...@apache.org>.
RichardXu186 commented on issue #9844:
URL: https://github.com/apache/seatunnel/issues/9844#issuecomment-3283347220

   这个是mysql jdbc驱动包的bug,使用高版本的驱动包问题已经解决,这个issue可以关闭了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org