-1

I'm trying to run sonar-runner.bat, when it almost finished analyzing, it's written max_allowed_packet more than something something. So it fails.

Through deep search, everyone said that i should configer my.ini file inside MySQL folder. But, I don't have MySQL Installed.

Log: Error: unable to execute sonar error: caused by: unable to save file sources error: caused by:

Error updating database. cause: com.mysql.jdbc.packettoobigexception: packet for query is too large (3215747 >1048576). you can change this..bla..bla

the error may involve org.sonar.core.source.db.filesourcemapper.insert-inline

the error occurred while setting parameters

how can i change it? help!

Community
  • 1
  • 1
  • Please add the analysis logs, otherwise nobody will be able to help you. – Fabrice - SonarSource Team Jun 16 '15 at 08:38
  • I've inserted some log. sorry for the hard-to-understand question. Due to hard-to-access the computer. Due to company's issue. lol. all i can do is less than 3 minutes touch on the computer. –  Jun 16 '15 at 09:02
  • If you get this, it means that the SonarQube server is running on top of MySql and you face the same issue as http://stackoverflow.com/questions/14592351/packettoobigexception-when-running-a-sonar-analysis/14592422#14592422. So you should contact the administrator of SonarQube in your company. – Fabrice - SonarSource Team Jun 16 '15 at 11:32
  • I never installed MySQL. I dont know how the sonarqube runs on top of what. it just shows i max_allowed_packet is reached. –  Jun 17 '15 at 04:19

2 Answers2

3

As @Fabrice- SonarQube Team suggested that you are running SonarQube Server on top of Mysql. If you want to check you can check within Sonar.properties file.

for removing this issues you have to modify the my.cnf(Linux) or my.ini(for windows).

[mysqld]

max_allowed_packet=256M

if you want to set the same Globally.Log in to Mysql and run the following command.

SET GLOBAL max_allowed_packet=1073741824;

Once you do this settings, Please restart Mysql Server.

Abhijeet Kamble
  • 3,131
  • 2
  • 30
  • 36
  • I never installed MySQL. Where do I find my.ini? –  Jun 17 '15 at 04:18
  • please let me know which operating system you are using and also check the sonar location where you have installed it. Within your installed location you will see conf folder and with this sonar.properties file present. Please open this and check if database MYSQL is selected. – Abhijeet Kamble Jun 17 '15 at 09:25
0

I found the answer myself.

Looks like I don't realize how the database works in Sonarqube.

So by DEFAULT, sonarqube use H2. This is a good one, and I believe such my problem won't happened.

Turned out someone from my company actually used his own MYSQL server. So, I found the MySQL folder, change .ini/.cfg file, insert MAX_ALLOWED_PACKET value to bigger number.

VOILA!

Thanks for your help!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129