otter mysql json类型带转义符同步失败 \r\n \t

vfwfrxfs  于 2022-10-25  发布在  Mysql
关注(0)|答案(3)|浏览(280)

pid:7 nid:1 exception:setl:com.alibaba.otter.node.etl.load.exception.LoadException: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into qifa . goods ( spu , type_id , class_id , cat_id , brand_id , supplier_id , qf_info , cc_info , property_ids , created_at , updated_at , status , goods_id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update spu =values( spu ) , type_id =values( type_id ) , class_id =values( class_id ) , cat_id =values( cat_id ) , brand_id =values( brand_id ) , supplier_id =values( supplier_id ) , qf_info =values( qf_info ) , cc_info =values( cc_info ) , property_ids =values( property_ids ) , created_at =values( created_at ) , updated_at =values( updated_at ) , status =values( status ) , goods_id =values( goods_id )]; Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:625)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:617)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:545)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:462)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load()
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198)
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2124)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2058)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5158)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2043)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)

... 21 more
  • PairId: 7 , TableId: 1 , EventType : I , Time : 1582198586000
  • Consistency : , Mode :

---Pks
EventColumn[index=0,columnType=4,columnName=goods_id,columnValue=341282,isNull=false,isKey=true,isUpdate=true]
---oldPks

---Columns
EventColumn[index=1,columnType=12,columnName=spu,columnValue=RR252_9240112-BLUE,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=2,columnType=4,columnName=type_id,columnValue=4,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=3,columnType=4,columnName=class_id,columnValue=4,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=4,columnType=4,columnName=cat_id,columnValue=379,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=5,columnType=4,columnName=brand_id,columnValue=985,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=6,columnType=4,columnName=supplier_id,columnValue=816,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=7,columnType=12,columnName=qf_info,columnValue={"fur": "", "sex": "554", "style": "", "collar": "566", "season": "2117", "category": "2465", "kids_age": "", "more_info": "Свитшот (джемпер) для девочки двухцветный. Воротник-труба. Рукав -реглан длинный. Перед декорирован аппликацией из двусторонних паеток ", "warehouse": "", "clasp_type": "", "goods_name": "Детский свитшот", "waist_type": "", "goods_alias": "", "pocket_type": "", "main_filling": "", "other_function": "", "material_lining": "1327", "decorative_items": "", "main_material_plus": "592", "manufacturer_county": "327", "other_plus_material": "", "material_plus_accessies1": "", "material_plus_accessies2": "", "proportion_material_plus": "", "material_lining_accessies": "", "proportion_material_lining": "", "proportion_material_plus_accessies1": "", "proportion_material_plus_accessies2": "", "proportion_material_lining_accessies": ""},isNull=false,isKey=false,isUpdate=true]
EventColumn[index=8,columnType=12,columnName=cc_info,columnValue={"cc_catalog": "126", "cc_filling": "537", "cc_process": "135", "mk_filling": "", "cc_eac_info": "-", "cc_goods_name": "634", "cc_material_plus": "138", "mk_material_plus": "", "cc_inner_pack_type": "169", "cc_material_lining": "215", "cc_outer_pack_type": "168", "mk_material_lining": ""},isNull=false,isKey=false,isUpdate=true]
EventColumn[index=9,columnType=12,columnName=property_ids,columnValue=327,2465,554,592,2117,566,1327,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=10,columnType=93,columnName=created_at,columnValue=2020-02-20 14:36:26,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=11,columnType=93,columnName=updated_at,columnValue=2020-02-20 14:36:26,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=12,columnType=4,columnName=status,columnValue=0,isNull=false,isKey=false,isUpdate=true]
---Sql
insert into qifa . goods ( spu , type_id , class_id , cat_id , brand_id , supplier_id , qf_info , cc_info , property_ids , created_at , updated_at , status , goods_id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update spu =values( spu ) , type_id =values( type_id ) , class_id =values( class_id ) , cat_id =values( cat_id ) , brand_id =values( brand_id ) , supplier_id =values( supplier_id ) , qf_info =values( qf_info ) , cc_info =values( cc_info ) , property_ids =values( property_ids ) , created_at =values( created_at ) , updated_at =values( updated_at ) , status =values( status ) , goods_id =values( goods_id )

Caused by: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into qifa . goods ( spu , type_id , class_id , cat_id , brand_id , supplier_id , qf_info , cc_info , property_ids , created_at , updated_at , status , goods_id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update spu =values( spu ) , type_id =values( type_id ) , class_id =values( class_id ) , cat_id =values( cat_id ) , brand_id =values( brand_id ) , supplier_id =values( supplier_id ) , qf_info =values( qf_info ) , cc_info =values( cc_info ) , property_ids =values( property_ids ) , created_at =values( created_at ) , updated_at =values( updated_at ) , status =values( status ) , goods_id =values( goods_id )]; Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:625)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:617)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:545)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:462)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load()
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198)
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2124)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2058)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5158)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2043)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)

... 21 more
  • PairId: 7 , TableId: 1 , EventType : I , Time : 1582198586000
  • Consistency : , Mode :

---Pks
EventColumn[index=0,columnType=4,columnName=goods_id,columnValue=341282,isNull=false,isKey=true,isUpdate=true]
---oldPks

---Columns
EventColumn[index=1,columnType=12,columnName=spu,columnValue=RR252_9240112-BLUE,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=2,columnType=4,columnName=type_id,columnValue=4,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=3,columnType=4,columnName=class_id,columnValue=4,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=4,columnType=4,columnName=cat_id,columnValue=379,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=5,columnType=4,columnName=brand_id,columnValue=985,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=6,columnType=4,columnName=supplier_id,columnValue=816,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=7,columnType=12,columnName=qf_info,columnValue={"fur": "", "sex": "554", "style": "", "collar": "566", "season": "2117", "category": "2465", "kids_age": "", "more_info": "Свитшот (джемпер) для девочки двухцветный. Воротник-труба. Рукав -реглан длинный. Перед декорирован аппликацией из двусторонних паеток ", "warehouse": "", "clasp_type": "", "goods_name": "Детский свитшот", "waist_type": "", "goods_alias": "", "pocket_type": "", "main_filling": "", "other_function": "", "material_lining": "1327", "decorative_items": "", "main_material_plus": "592", "manufacturer_county": "327", "other_plus_material": "", "material_plus_accessies1": "", "material_plus_accessies2": "", "proportion_material_plus": "", "material_lining_accessies": "", "proportion_material_lining": "", "proportion_material_plus_accessies1": "", "proportion_material_plus_accessies2": "", "proportion_material_lining_accessies": ""},isNull=false,isKey=false,isUpdate=true]
EventColumn[index=8,columnType=12,columnName=cc_info,columnValue={"cc_catalog": "126", "cc_filling": "537", "cc_process": "135", "mk_filling": "", "cc_eac_info": "-", "cc_goods_name": "634", "cc_material_plus": "138", "mk_material_plus": "", "cc_inner_pack_type": "169", "cc_material_lining": "215", "cc_outer_pack_type": "168", "mk_material_lining": ""},isNull=false,isKey=false,isUpdate=true]
EventColumn[index=9,columnType=12,columnName=property_ids,columnValue=327,2465,554,592,2117,566,1327,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=10,columnType=93,columnName=created_at,columnValue=2020-02-20 14:36:26,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=11,columnType=93,columnName=updated_at,columnValue=2020-02-20 14:36:26,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=12,columnType=4,columnName=status,columnValue=0,isNull=false,isKey=false,isUpdate=true]
---Sql
insert into qifa . goods ( spu , type_id , class_id , cat_id , brand_id , supplier_id , qf_info , cc_info , property_ids , created_at , updated_at , status , goods_id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update spu =values( spu ) , type_id =values( type_id ) , class_id =values( class_id ) , cat_id =values( cat_id ) , brand_id =values( brand_id ) , supplier_id =values( supplier_id ) , qf_info =values( qf_info ) , cc_info =values( cc_info ) , property_ids =values( property_ids ) , created_at =values( created_at ) , updated_at =values( updated_at ) , status =values( status ) , goods_id =values( goods_id )

at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader.load(DataBatchLoader.java:107)
at com.alibaba.otter.node.etl.load.loader.OtterLoaderFactory.load(OtterLoaderFactory.java:50)
at com.alibaba.otter.node.etl.load.LoadTask$1.run(LoadTask.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Caused by: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into qifa . goods ( spu , type_id , class_id , cat_id , brand_id , supplier_id , qf_info , cc_info , property_ids , created_at , updated_at , status , goods_id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update spu =values( spu ) , type_id =values( type_id ) , class_id =values( class_id ) , cat_id =values( cat_id ) , brand_id =values( brand_id ) , supplier_id =values( supplier_id ) , qf_info =values( qf_info ) , cc_info =values( cc_info ) , property_ids =values( property_ids ) , created_at =values( created_at ) , updated_at =values( updated_at ) , status =values( status ) , goods_id =values( goods_id )]; Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:625)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:617)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:545)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:462)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:275)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:161)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618)
at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load()
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198)
at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 371 in value for column 'goods.qf_info'.
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.Conn

h5qlskok

h5qlskok1#

遇到同样的错误:
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text: "Invalid escape character in string." at position 97 in value for column 't_b_billsubitem.ext'.
具体信息:
`- PairId: 1 , TableId: 2 , EventType : U , Time : 1583292543000

  • Consistency : , Mode :

---Pks
EventColumn[index=0,columnType=12,columnName=id,columnValue=31ed2bca-31cc-11ea-a08e-0800278efc65,isNull=false,isKey=true,isUpdate=true]
---oldPks

---Columns
EventColumn[index=1,columnType=12,columnName=billMainId,columnValue=ddbe22f2-31c9-11ea-a08e-0800278efc65,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=2,columnType=4,columnName=sequenceNo,columnValue=10,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=3,columnType=93,columnName=businessTime,columnValue=2019-12-24 00:00:00,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=4,columnType=12,columnName=financialObjId,columnValue=402804a66a8bd087016a919cbd17002d,isNull=false,isKey=false,isUpdate=true]
*

  • 部 分 省 略

EventColumn[index=20,columnType=12,columnName=remark,columnValue=*****。 ,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=21,columnType=12,columnName=ext,columnValue={"ExtKeybeizhu81": "无", "accountSubjectId": "594", "ext_filed_serve_object": "湖南有线集团 ", "9238f9ce-81de-11e9-924f-f01fafd1696e": ""},isNull=false,isKey=false,isUpdate=true]
EventColumn[index=22,columnType=-7,columnName=deleteFlag,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=23,columnType=-4,columnName=balance,columnValue=,isNull=true,isKey=false,isUpdate=true]
---Sql
insert into fmis_back . t_b_billsubitem ( billMainId , sequenceNo , businessTime , financialObjId , businessDeptId , costSubjectId , itemQty , itemPrice , itemAmount , adjustMoney , actualMoney , adjustNote , linkByBillRelSubItemFlag , canChargeMoney , lockedMoney , chargedMoney , closeFlag , closeUserId , closeTime , remark , ext , deleteFlag , balance , id ) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update billMainId =values( billMainId ) , sequenceNo =values( sequenceNo ) , businessTime =values( businessTime ) , financialObjId =values( financialObjId ) , businessDeptId =values( businessDeptId ) , costSubjectId =values( costSubjectId ) , itemQty =values( itemQty ) , itemPrice =values( itemPrice ) , itemAmount =values( itemAmount ) , adjustMoney =values( adjustMoney ) , actualMoney =values( actualMoney ) , adjustNote =values( adjustNote ) , linkByBillRelSubItemFlag =values( linkByBillRelSubItemFlag ) , canChargeMoney =values( canChargeMoney ) , lockedMoney =values( lockedMoney ) , chargedMoney =values( chargedMoney ) , closeFlag =values( closeFlag ) , closeUserId =values( closeUserId ) , closeTime =values( closeTime ) , remark =values( remark ) , ext =values( ext ) , deleteFlag =values( deleteFlag ) , balance =values( balance ) , id =values( id )

`

json 中 确实存在 \t 字符,(主从库中本就有这条数据,主库中修改此数据造成失败,但此处 显示sql 为 instert ?)

  1. 在实际日志中并未找到 相关insert的迹象,历史存在数据为何提示 insert
  2. 修改主表数据去掉\t 异常任然存在? binglog日志没有找到相关操作我该如何跳过这个 错误让同步继续进行下去?
  3. 菜鸟问一句, 挂起是啥状态? 解卦 貌似无用? 推送 作用是啥?
  4. 不是说row 不存在 主外键数据不一致的问题(无法删除)? 抛出异常后从库中数据仍然被删除掉了?
    第4条日志如下:
    `:-----------------
  • PairId: 1 , TableId: 2 , EventType : D , Time : 1583398935000
  • Consistency : , Mode :

---Pks
EventColumn[index=0,columnType=12,columnName=ID_,columnValue=54e5a100-5dff-11ea-8c78-0800278efc65,isNull=false,isKey=true,isUpdate=true]
---oldPks

---Columns
EventColumn[index=1,columnType=4,columnName=REV_,columnValue=3,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=2,columnType=12,columnName=PROC_INST_ID_,columnValue=54e52bb1-5dff-11ea-8c78-0800278efc65,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=3,columnType=12,columnName=BUSINESS_KEY_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=4,columnType=12,columnName=PARENT_ID_,columnValue=54e52bb1-5dff-11ea-8c78-0800278efc65,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=5,columnType=12,columnName=PROC_DEF_ID_,columnValue=b2c100e8-5c30-11ea-82f8-0800278efc65,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=6,columnType=12,columnName=SUPER_EXEC_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=7,columnType=12,columnName=ROOT_PROC_INST_ID_,columnValue=54e52bb1-5dff-11ea-8c78-0800278efc65,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=8,columnType=12,columnName=ACT_ID_,columnValue=zlmn62ceb573d2fd9705a4ff11ec6e63,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=9,columnType=-6,columnName=IS_ACTIVE_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=10,columnType=-6,columnName=IS_CONCURRENT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=11,columnType=-6,columnName=IS_SCOPE_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=12,columnType=-6,columnName=IS_EVENT_SCOPE_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=13,columnType=-6,columnName=IS_MI_ROOT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=14,columnType=4,columnName=SUSPENSION_STATE_,columnValue=1,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=15,columnType=4,columnName=CACHED_ENT_STATE_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=16,columnType=12,columnName=TENANT_ID_,columnValue=,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=17,columnType=12,columnName=NAME_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=18,columnType=93,columnName=START_TIME_,columnValue=2020-03-04 18:03:01.060,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=19,columnType=12,columnName=START_USER_ID_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=20,columnType=93,columnName=LOCK_TIME_,columnValue=,isNull=true,isKey=false,isUpdate=true]
EventColumn[index=21,columnType=-6,columnName=IS_COUNT_ENABLED_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=22,columnType=4,columnName=EVT_SUBSCR_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=23,columnType=4,columnName=TASK_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=24,columnType=4,columnName=JOB_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=25,columnType=4,columnName=TIMER_JOB_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=26,columnType=4,columnName=SUSP_JOB_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=27,columnType=4,columnName=DEADLETTER_JOB_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=28,columnType=4,columnName=VAR_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
EventColumn[index=29,columnType=4,columnName=ID_LINK_COUNT_,columnValue=0,isNull=false,isKey=false,isUpdate=true]
---Sql
delete from fmis_back . act_ru_execution where ID_ = ? :-----------------

  • PairId: 1 , TableId: 2 , EventType : D , Time : 1583398935000
  • Consistency : , Mode :

---Pks
EventColumn[index=0,columnType=12,columnName=ID_,columnValue=54e5a100-5dff-11ea-8c78-0800278efc65,isNull=false,isKey=true,isUpdate=true]
---oldPks

---Columns

**

*列省略

**

---Sql
delete from 从库 . act_ru_execution where ID_ = ?
Caused by: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [delete from fmis_back . act_ru_execution where ID_ = ? ]; Cannot delete or update a parent row: a foreign key constraint fails ( fmis_back . act_ru_task , CONSTRAINT ACT_FK_TASK_EXE FOREIGN KEY ( EXECUTION_ID_ ) REFERENCES act_ru_execution ( ID_ )); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails ( fmis_back . act_ru_task , CONSTRAINT ACT_FK_TASK_EXE FOREIGN KEY ( EXECUTION_ID_ ) REFERENCES act_ru_execution ( ID_ ))
`
这条数据仍然在从库中删除了

gdrx4gfi

gdrx4gfi3#

我们现在特殊处理json字段

@Override
    public boolean process(EventData eventData) {
        for (EventColumn eventColumn : eventData.getColumns()) {
            if (JSON_FIELD_SET.contains(eventColumn.getColumnName())) {
                String jsonValue = eventColumn.getColumnValue();
                if (StringUtils.isBlank(jsonValue)) {
                    continue;
                }
                eventColumn.setColumnValue(JSON.toJSONString(JSONObject.parse(jsonValue)));
            }
        }
        return true;
    }

相关问题