开发者社区> 问答> 正文

canal 1.1.5 adapter出现空指针报错

环境信息

canal 1.1.5 mysql 8.0.23

问题描述

通过canal deployer 读取MySQL binlog 使用canal adapter 同步到elasticsearch(7.12)中 之前一直好好的,今天突然adapter出现故障.

实际执行情况

重启adapter服务之后恢复正常。::

报错如下:

2021-12-31 20:23:55.573 [pool-2-thread-1] ERROR c.a.o.canal.client.adapter.es.core.service.ESSyncService - sync error, es index: tbl_member_promo_transaction, DML : Dml{destination='mysql-2-es', database='ym', table='tbl_member_promo_transaction', type='INSERT', es=1640957035000, ts=1640957035572, sql='', data=[{id=68020387923807053, bill_no=7593482959694152325, uid=158155819286111441, platform_id=362857114342923387, username=thienanpr, cash_type=173, amount=60.0, before_amount=138.0200, after_amount=78.0200, created_at=1640957035391, remark=4260000_34194}], old=null}2021-12-31 20:23:55.574 [pool-2-thread-1] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - java.lang.NullPointerExceptionjava.lang.RuntimeException: java.lang.NullPointerException at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:116) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:64) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:115) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:94) ~[na:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.batchSync(AdapterProcessor.java:139) ~[client-adapter.launcher-1.1.5.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$1(AdapterProcessor.java:97) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[na:1.8.0_241] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$2(AdapterProcessor.java:94) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_241] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_241] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_241] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_241] Caused by: java.lang.NullPointerException: null 2021-12-31 20:23:55.574 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - Outer adapter sync failed! Error sync but ACK!

原提问者GitHub用户mianhuatangtwo

展开
收起
后端老大 2023-04-26 16:51:25 327 0
1 条回答
写回答
取消 提交回答
  • 两个解决方案:

    1、 用repair issue #3401 #3923 里面的代码打个包 替换你自己的版本

    2、 可以给你的每个adapter都配置上key,application.yml和具体的adapter-config.yml 对应上

    原回答者GitHub用户agapple

    2023-04-26 19:29:47
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载