sonar:api/ce/submit接口上传失败

https://blog.csdn.net/weixin_34185320/article/details/87115268

https://ask.helplib.com/others/post_12706136

https://stackoverflow.com/questions/37997306/error-500-during-sonar-runner-execution-on-jenkins

报错截图:

报错原因查看:

  sonarqube的web.log文件报错如下:

Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6324977 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3681)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2512)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
    at org.sonar.db.ce.CeTaskInputDao.insert(CeTaskInputDao.java:53)
    ... 48 common frames omitted

 

 

1、修改mysql配置

  在my.ini(或者my.conf)文件中添加如下三行配置

[mysqld]
max_allowed_packet=512M
innodb_log_file_size=256M

2、修改sonar.properties配置

  增加&max_allowed_packet=512M配置,与mysql

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&max_allowed_packet=512M

3、重启mysql和sonar

转载于:https://www.cnblogs.com/gcgc/p/11053034.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值