【发布时间】:2017-04-07 13:23:36
【问题描述】:
尊敬的 Sonarqube 社区,
自从更新到 Sonarqube 6.1 后,我们在 Sonarqube 中遇到了一个错误,即用于查询的数据包太大。 我们做什么:Jenkins 正在检查 PHP 源代码,然后 SonarQube Scanner 正在分析源代码并与 SonarQube 服务器通信。此过程失败,Jenkins 中的日志输出:
org.sonarqube.ws.client.HttpException: Error 500 on http://URL-TO-SONAR/sonar/api/ce/submit?projectKey=lhind.php.PRJName&projectName=PRJName : {"errors":[{"msg":"Fail to insert data of CE task AViRLtiaB_5m8twj_1J3"}]}
- Jenkins 版本:2.19.3
- SonarQube 版本:6.1
- SonarQube 扫描仪:2.8
- MySQL 版本:5.6.34
- 驱动程序:MySQL 连接器 Java
- 驱动版本:mysql-connector-java-5.1.39
- MySQL 变量“max_allowed_packet = 16M”(从 4M 增加)
- MySQL 变量“innodb_log_file_size = 128M”(从 48M 增加)
- Sonar JDBC 连接字符串:“
- sonar.jdbc.url=jdbc:mysql://DB-URL:3306/sonar?useUnicode=true&*characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&maxAllowedPacket=16777216"
我们已经增加了最大数据包大小和 innodb_log_file_size。使用 SonarQube 6.1 的相同数量的代码,我们没有这个问题。
有什么想法吗?
在 SonarQube 中,我们在 sonar.log 文件中发现了以下异常:
2016.11.23 12:35:16 ERROR web[][o.s.s.w.WebServiceEngine] Fail to process request http://SONAR-URL.de:8443/sonar/api/ce/submit?projectKey=lhind.php.PRJName&projectName=PRJName
java.lang.IllegalStateException: Fail to insert data of CE task AViRLtiaB_5m8twj_1J3
at org.sonar.db.ce.CeTaskInputDao.insert(CeTaskInputDao.java:56) ~[sonar-db-6.1.jar:na]
(deleted because too much text ...)
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
**Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (24313938 > 16777216). You can change this value on the server by setting the max_allowed_packet' variable.**
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3671) ~[mysql-connector-java-5.1.39.jar:5.1.39]
(deleted because too much text ...)
at org.sonar.db.ce.CeTaskInputDao.insert(CeTaskInputDao.java:53) ~[sonar-db-6.1.jar:na]
... 34 common frames omitted
【问题讨论】:
-
请将您的代码放入代码块中。无法阅读此内容。
标签: sonarqube