Skip to content

Canal instance SSL连接启动后,拉取 tableMeta SQL报错 #5528

@RandalTeng

Description

@RandalTeng
  • I have searched the issues of this repository and believe that this is not a duplicate.
    • 看起来有重复,但是好像触发原因又不太一样,排查了下,没看出问题在哪
  • I have checked the FAQ of this repository and believe that this is not a duplicate.
    • 看了下wiki FAQ没有相应的问题

environment

  • canal version 1.1.8
  • mysql version 5.6.40

Issue Description

因为manager是自己实现的,相关配置和instance配置,是模板生成的,配置ssl之后,开启同步任务一直提示 show create table SQL错误

部署方式是docker部署,用的官方 1.1.8 镜像

If there is an exception, please attach the exception trace:

2025-10-27 07:22:56.719 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - auth switch response packet is sent out.
2025-10-27 07:22:56.720 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection in sslMode VERIFY_CA, Ssl_version:TLSv1.2, Ssl_cipher:ECDHE-RSA-AES256-GCM-SHA384
2025-10-27 07:22:56.722 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] WARN  c.a.otter.canal.parse.inbound.mysql.MysqlConnection - load MySQL @@version_comment : MySQL Community Server (GPL)
2025-10-27 07:22:56.723 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] INFO  c.a.otter.canal.parse.inbound.mysql.MysqlConnection - COM_BINLOG_DUMP with position:BinlogDumpCommandPacket[binlogPosition=4,slaveServerId=1342178028,binlogFileName=mysql-bin.000052,command=18]
2025-10-27 07:22:56.724 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] INFO  com.taobao.tddl.dbsync.binlog.LogEvent - common_header_len= 19, number_of_event_types= 35
2025-10-27 07:22:57.508 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] WARN  c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - prepare to find start position mysql-bin.000052:49284643:1761549603000
2025-10-27 07:22:57.534 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address vb-mysql/10.0.2.186:3306 has an error, retrying. caused by
com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: ErrorPacket [errorNumber=1064, fieldCount=-1, message=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show create table {table scheme};show create table {table scheme}' at line 1, sqlState=42000, sqlStateMarker=#]
 with command: show create table {table scheme};show create table {table scheme};show create table {table scheme};show create table {table scheme};
Caused by: java.io.IOException: ErrorPacket [errorNumber=1064, fieldCount=-1, message=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show create table {table scheme};show create table{table scheme}' at line 1, sqlState=42000, sqlStateMarker=#]
 with command: show create table{table scheme};show create table {table scheme};show create table {table scheme};show create table {table scheme};
        at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.queryMulti(MysqlQueryExecutor.java:109)
        at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.queryMulti(MysqlConnection.java:126)
        at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.dumpTableMeta(DatabaseTableMeta.java:239)
        at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.rollback(DatabaseTableMeta.java:174)
        at com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser.processTableMeta(AbstractMysqlEventParser.java:144)
        at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:192)
        at java.lang.Thread.run(Thread.java:750)
2025-10-27 07:22:57.534 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:dps-instance-42[com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: ErrorPacket [errorNumber=1064, fieldCount=-1, message=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show create table {table scheme};show create table {table scheme}' at line 1, sqlState=42000, sqlStateMarker=#]
 with command: show create table {table scheme};show create table {table scheme};show create table {table scheme};show create table {table scheme};
Caused by: java.io.IOException: ErrorPacket [errorNumber=1064, fieldCount=-1, message=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show create table {table scheme};show create table {table scheme}' at line 1, sqlState=42000, sqlStateMarker=#]
 with command: show create table {table scheme};show create table {table scheme};show create table {table scheme};show create table {table scheme};
        at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.queryMulti(MysqlQueryExecutor.java:109)
        at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.queryMulti(MysqlConnection.java:126)
        at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.dumpTableMeta(DatabaseTableMeta.java:239)
        at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.rollback(DatabaseTableMeta.java:174)
        at com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser.processTableMeta(AbstractMysqlEventParser.java:144)
        at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:192)
        at java.lang.Thread.run(Thread.java:750)
]
2025-10-27 07:22:57.534 [destination = dps-instance-42 , address = vb-mysql/10.0.2.186:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConnection to vb-mysql/10.0.2.186:3306...

相关的instance配置:

#################################################
## mysql serverId , v1.0.26+ will autoGen
# canal.instance.mysql.slaveId=0

# enable gtid use true/false
canal.instance.gtidon=false

# position info
canal.instance.master.address=${address!""}
canal.instance.master.journal.name=${journalName!""}
canal.instance.master.position=${position!""}
canal.instance.master.timestamp=
canal.instance.master.gtid=

# rds oss binlog
canal.instance.rds.accesskey=
canal.instance.rds.secretkey=
canal.instance.rds.instanceId=

# multi stream for polardbx
canal.instance.multi.stream.on=false

# ssl
canal.instance.master.sslMode=${sslMode!"DISABLED"}
canal.instance.master.tlsVersions=
canal.instance.master.trustCertificateKeyStoreType=JKS
canal.instance.master.trustCertificateKeyStoreUrl=file:${sslCAFile!""}
canal.instance.master.trustCertificateKeyStorePassword=${sslCAPwd!""}
canal.instance.master.clientCertificateKeyStoreType=
canal.instance.master.clientCertificateKeyStoreUrl=
canal.instance.master.clientCertificateKeyStorePassword=

# table meta tsdb info
canal.instance.tsdb.enable=false
#canal.instance.tsdb.url=jdbc:mysql://127.0.0.1:3306/canal_tsdb
#canal.instance.tsdb.dbUsername=canal
#canal.instance.tsdb.dbPassword=canal

#canal.instance.standby.address =
#canal.instance.standby.journal.name =
#canal.instance.standby.position =
#canal.instance.standby.timestamp =
#canal.instance.standby.gtid=

# username/password
canal.instance.dbUsername=${dbUsername!""}
canal.instance.dbPassword=${dbPassword!""}
canal.instance.connectionCharset = UTF-8
# enable druid Decrypt database password
canal.instance.enableDruid=false
#canal.instance.pwdPublicKey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALK4BUxdDltRRE5/zXpVEVPUgunvscYFtEip3pmLlhrWpacX7y7GCMo2/JM6LeHmiiNdH1FWgGCpUfircSwlWKUCAwEAAQ==

# table regex
canal.instance.filter.regex=.*\\..*
# table black regex
canal.instance.filter.black.regex=.\.BASE.
# table field filter(format: schema1.tableName1:field1/field2,schema2.tableName2:field1/field2)
#canal.instance.filter.field=test1.t_product:id/subject/keywords,test2.t_company:id/name/contact/ch
# table field black filter(format: schema1.tableName1:field1/field2,schema2.tableName2:field1/field2)
#canal.instance.filter.black.field=test1.t_product:subject/product_image,test2.t_company:id/name/contact/ch

# mq config
canal.mq.topic=example
# dynamic topic route by schema or table regex
#canal.mq.dynamicTopic=mytest1.user,topic2:mytest2\\..*,.*\\..*
canal.mq.partition=0
# hash partition config
#canal.mq.enableDynamicQueuePartition=false
#canal.mq.partitionsNum=3
#canal.mq.dynamicTopicPartitionNum=test.*:4,mycanal:6
#canal.mq.partitionHash=test.table:id^name,.*\\..*
#################################################

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions