Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ERROR: value too long for type character varying(200) Call getNextException to see other errors in the batch. #12352

Closed
3 tasks done
friendlytkyj opened this issue Jun 21, 2024 · 7 comments · Fixed by #12363
Assignees
Labels
backend OAP backend related. bug Something isn't working and you are sure it's a bug!
Milestone

Comments

@friendlytkyj
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

OAP server (apache/skywalking)

What happened

java.sql.BatchUpdateException: Batch entry 2 INSERT INTO events_20240621(id,table_name,uuid,service,service_instance,endpoint,name,type,message,parameters,start_time,end_time,layer,time_bucket) VALUES (('83e1d795-db7c-4f6c-8bf8-28faa50d5ec2'),('events'),('83e1d795-db7c-4f6c-8bf8-28faa50d5ec2'),('test::m-operation-center|uat|'),(''),('cn.classtree.component.ai.api.service.AiService.text2text(String,Text2TextType)'),('Alarm'),('Error'),('Response time of endpoint relation cn.classtree.component.ai.api.service.AiService.text2text(String,Text2TextType) in test::m-operation-center|uat| to RocketMQ/TEXT_TO_TEXTINTERNAL/Consumer in test::m-operation-center|uat| is more than 1000ms in 2 minutes of last 10 minutes'),(NULL),('1718937382705'::int8),('1718937982705'::int8),('2'::int4),('202406211036'::int8)) was aborted: ERROR: value too long for type character varying(200) Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleCompletion(BatchResultHandler.java:186) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:571) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:893) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:916) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1684) ~[postgresql-42.4.4.jar:42.4.4]
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:128) ~[HikariCP-3.1.0.jar:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java) ~[HikariCP-3.1.0.jar:?]
at org.apache.skywalking.oap.server.storage.plugin.jdbc.BatchSQLExecutor.executeBatch(BatchSQLExecutor.java:85) ~[storage-jdbc-hikaricp-plugin-10.0.1.jar:10.0.1]
at org.apache.skywalking.oap.server.storage.plugin.jdbc.BatchSQLExecutor.invoke(BatchSQLExecutor.java:74) ~[storage-jdbc-hikaricp-plugin-10.0.1.jar:10.0.1]
at org.apache.skywalking.oap.server.storage.plugin.jdbc.common.dao.JDBCBatchDAO.lambda$flush$1(JDBCBatchDAO.java:78) ~[storage-jdbc-hikaricp-plugin-10.0.1.jar:10.0.1]
at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
at org.apache.skywalking.oap.server.storage.plugin.jdbc.common.dao.JDBCBatchDAO.flush(JDBCBatchDAO.java:75) ~[storage-jdbc-hikaricp-plugin-10.0.1.jar:10.0.1]
at org.apache.skywalking.oap.server.core.storage.PersistenceTimer.lambda$extractDataAndSave$3(PersistenceTimer.java:135) ~[server-core-10.0.1.jar:10.0.1]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(200)
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366) ~[postgresql-42.4.4.jar:42.4.4]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:560) ~[postgresql-42.4.4.jar:42.4.4]
... 15 more

What you expected to happen

the column 'message' of table event_xxxx only varchar200

How to reproduce

when message insert into table event as below
Response time of endpoint relation POST:/databoard/sets/v2/save_config in test::x-big-data|uat| to cn.mashang.terminal.modules.vscreen.IVScreenOpenService.freshBigData(Long,String) in test::m-terminal-center|uat| is more than 1000ms in 2 minutes of last 10 minutes

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@friendlytkyj friendlytkyj added the bug Something isn't working and you are sure it's a bug! label Jun 21, 2024
@wu-sheng
Copy link
Member

As you have the data, could you verify which column length is not enough? And what are your data?

@wu-sheng wu-sheng added the backend OAP backend related. label Jun 21, 2024
@wu-sheng wu-sheng added this to the 10.1.0 milestone Jun 21, 2024
@friendlytkyj
Copy link
Contributor Author

As you have the data, could you verify which column length is not enough? And what are your data?

org.apache.skywalking.oap.server.core.analysis.metrics.Event.message
modify as below
@column(name = MESSAGE, length = 2000)

@friendlytkyj
Copy link
Contributor Author

$ git push
ERROR: Permission to apache/skywalking.git denied to friendlytkyj.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

how to push code ?
I am the first to fix issue

@wu-sheng
Copy link
Member

You need to propose change by fork, change and through pull request.

We don't accept direct change from anyone, including maintainers.

Furthermore, I need your explanation about the data and why they are so long.

@friendlytkyj
Copy link
Contributor Author

You need to propose change by fork, change and through pull request.

We don't accept direct change from anyone, including maintainers.

Furthermore, I need your explanation about the data and why they are so long.

it's auto collect by agent-java, when dubbo invoke more 1 second, the length of the message content is more than 200, so error is happend, the agent collect message content as below:

Response time of endpoint relation POST:/databoard/sets/v2/save_config in test::x-big-data|uat| to cn.mashang.terminal.modules.vscreen.IVScreenOpenService.freshBigData(Long,String) in test::m-terminal-center|uat| is more than 1000ms in 2 minutes of last 10 minutes

friendlytkyj pushed a commit to friendlytkyj/skywalking that referenced this issue Jun 21, 2024
@friendlytkyj
Copy link
Contributor Author

friendlytkyj commented Jun 21, 2024

when i debug the source code, the @column field length is default 200, need change to 1000 or 2000.
if skywalking can read jvm args 、 system property or environment virable to set column length when startup , it's perfect!

friendlytkyj pushed a commit to friendlytkyj/skywalking that referenced this issue Jun 21, 2024
@wu-sheng
Copy link
Member

Your pull request is closed, as you didn't send it to the master branch.

@wu-sheng wu-sheng linked a pull request Jun 22, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend OAP backend related. bug Something isn't working and you are sure it's a bug!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants