Closed yazong closed 4 years ago
English only, please.
English only, please.
2020-07-02 15:09:49,144 - org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO - 75 [pool-4-thread-1] ERROR [] - Data truncation: Data too long for column 'entity_id' at row 1 com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'entity_id' at row 1 at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:97) ~[mysql-connector-java-6.0.6.jar:6.0.6] at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1299) ~[mysql-connector-java-6.0.6.jar:6.0.6] at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:701) ~[mysql-connector-java-6.0.6.jar:6.0.6] at com.mysql.cj.jdbc.PreparedStatement.execute(PreparedStatement.java:1153) ~[mysql-connector-java-6.0.6.jar:6.0.6] at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-3.1.0.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-3.1.0.jar:?] at org.apache.skywalking.oap.server.storage.plugin.jdbc.SQLExecutor.invoke(SQLExecutor.java:53) ~[storage-jdbc-hikaricp-plugin-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO.synchronous(H2BatchDAO.java:72) ~[storage-jdbc-hikaricp-plugin-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.core.storage.PersistenceTimer.extractDataAndSave(PersistenceTimer.java:122) ~[server-core-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.core.storage.PersistenceTimer.lambda$start$0(PersistenceTimer.java:78) ~[server-core-8.0.1.jar:8.0.1] at org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33) [apm-util-8.0.1.jar:8.0.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_172] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_172] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_172] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
how do you solve this problem,please?
I think this is code level bug.
EndpointRelationServerSideMetrics#entityId
ServiceInstanceRelationClientSideMetrics#entityId
ServiceInstanceRelationServerSideMetrics#entityId
ServiceRelationClientSideMetrics#entityId
ServiceRelationServerSideMetrics#entityId
Should add length statement in the Column annotation, should be @Column(columnName = ENTITY_ID, length = 512)
Could you like to test locally? And send a pull request if the test passes?
I have the same problem @wu-sheng
2020-07-06 10:44:43,117 - org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO - 75 [pool-4-thread-1] ERROR [] - Data truncation: Data too long for column 'entity_id' at row 1 com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'entity_id' at row 1 at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:637) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:418) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370) ~[mysql-connector-java-8.0.20.jar:8.0.20] at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-3.1.0.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-3.1.0.jar:?] at org.apache.skywalking.oap.server.storage.plugin.jdbc.SQLExecutor.invoke(SQLExecutor.java:53) ~[storage-jdbc-hikaricp-plugin-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO.synchronous(H2BatchDAO.java:72) ~[storage-jdbc-hikaricp-plugin-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.core.storage.PersistenceTimer.extractDataAndSave(PersistenceTimer.java:122) ~[server-core-8.0.1.jar:8.0.1] at org.apache.skywalking.oap.server.core.storage.PersistenceTimer.lambda$start$0(PersistenceTimer.java:78) ~[server-core-8.0.1.jar:8.0.1] at org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33) [apm-util-8.0.1.jar:8.0.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_212] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_212] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_212] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
I think it's a problem with the skywalking plugin
eg:2020-07-06 10:47:55,164 - org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO - 75 [pool-4-thread-1] ERROR [] - Data truncation: Data too long for column 'entity_id' at row 1
@zhousheng2 I have provided the solution above, both of you are welcome to have a try and send the pull request.
@wu-sheng Thank you very much. At present, we also use version 8.0.1
@zhousheng2 I am not using H2/MySQL/TiDB, so have to ask you to change source codes, and test locally.
thanks. my source code compile failed,i will continue to try and test.
@yazong Why compiling fail? Have you read the document about compiling?
a small problem.i can solve.i'm doing other work.
@zhousheng2 this issue has been resolved. https://github.com/apache/skywalking/issues/5013
@wu-sheng
1) i found that the length value of these files was also set at 200. i did not see any related problems. so i was not sure,so i did not change it.
PercentileFunction HistogramFunction AvgHistogramFunction AvgFunction
2)
@ScopeDefaultColumn.VirtualColumnDefinition(fieldName = "entityId", columnName = "entity_id", isID = true, type = String.class) public class ServiceInstanceRelation extends Source {
@Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface VirtualColumnDefinition { String fieldName();
String columnName();
Class type();
boolean isID() default false;
/**
* Define column length, only effective when the type is String.
*/
int length() default 512;
}
why do the same fields have different lengths?
Your formats are not well. It is very hard to read. For function(s), I think it still missed the length
for the entityId
field.
For length, VirtualColumnDefinition
is for OAL generated entity, so it is 512 by default. DefinedByField
is everywhere, we don't need them always 512, many fields don't need so long.
Your formats are not well. It is very hard to read. For function(s), I think it still missed the
length
for theentityId
field.For length,
VirtualColumnDefinition
is for OAL generated entity, so it is 512 by default.DefinedByField
is everywhere, we don't need them always 512, many fields don't need so long.
thanks. i understand that i need to read the source code to understand it better.
PercentileFunction
HistogramFunction
AvgHistogramFunction
AvgFunction
EntityId in these should add 512 length annotation. If you have time, please send a pull request to fix it.
PercentileFunction HistogramFunction AvgHistogramFunction AvgFunction
EntityId in these should add 512 length annotation. If you have time, please send a pull request to fix it.
**Please answer these questions before submitting your issue.
Question
Bug
Which version of SkyWalking, OS and JRE?
Which company or project?
What happen? If possible, provide a way for reproducing the error. e.g. demo application, component version.
(一)测试环境测试机centos7-64安装skywalking8.0.1。jdk1.8-64bit。 CentOS Linux release 7.5.1804 (Core) 3.10.0-862.el7.x86_64
(二)本机PC-windows10-64bit基于jdk1.8-64bit使用IDEA2018.1-64bit版本启动Springcloud网关,配置如下: