- 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.
environment
- canal version
- 1.1.5
- mysql version
- 5.7.41
- es version
- 7.8.0
Issue Description
日志报错:Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters.]
Steps to reproduce
Expected behaviour
Actual behaviour
canal-adapter 镜像重启后能暂时同步,过段时间不能同步了,日志报错:Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters.]
If there is an exception, please attach the exception trace:
Caused by: java.lang.RuntimeException: ES sync commit error ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters.]]
at com.alibaba.otter.canal.client.adapter.es7x.support.ESConnection$ES7xBulkResponse.processFailBulkResponse(ESConnection.java:474) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es7x.support.ES7xTemplate.commit(ES7xTemplate.java:175) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es7x.support.ES7xTemplate.commitBulk(ES7xTemplate.java:343) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es7x.support.ES7xTemplate.update(ES7xTemplate.java:107) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.singleTableSimpleFiledUpdate(ESSyncService.java:827) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.update(ESSyncService.java:212) ~[na:na]
at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:101) ~[na:na]
Just put your stack trace here!
1条答案
按热度按时间tag5nh1u1#
因为sql里面有join操作。并且修改了on条件的主表的字段。我也遇到了,开trace日志可以看到给es提交update的时候,提交了_id字段。es是不允许修改_id字段的,就会报错