Packet Size Too Large - Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Packet Size Too Large - Windows

Kyle Smith
Hi Everyone,

Here is my Execution Failure log for a scan I am trying to run.


INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:17.458s
Final Memory: 14M/422M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to read and import the source file : 'C:/Users/kyle/D
ocuments/FolderWithSomeCode/NAME/folder/my_database_stuff.sql' with the charset : 'UTF-8'. ERROR: Caused by: ### Error updating database. Cause: com.mysql.jdbc.PacketTooBigException: Packe
t for query is too large (6387851 > 4194304). You can change this value on the s erver by setting the max_allowed_packet' variable.
### The error may involve org.sonar.core.source.db.SnapshotSourceMapper.insert-I nline
### The error occurred while setting parameters
### SQL: insert into snapshot_sources (snapshot_id, data) values (?, ?)
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (
6387851 > 4194304). You can change this value on the server by setting the max_a llowed_packet' variable.
ERROR: Caused by: Packet for query is too large (6387851 > 4194304). You can cha
nge this value on the server by setting the max_allowed_packet' variable.
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t he -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.


I tried to modify the value for the 'max_allowed_packet' variable to 1GB, which is according to the MySQL documentation the largest size of a packet for my version of MySQL. I looked around the Windows system I installed MySQL on and did not find a my.cnf file. I checked the mysql --help command which lists the default locations for the my.cnf file and did not find it anywhere on my file system. I also searched for this from the C drive in Explorer and did not find it. Since I did not find this key file anywhere I created the file myself and put it in one of the default locations, C:\my.cnf, listed in mysql --help .



The my.cnf file I created looks like this:

[mysqld]
max_allowed_packet=1G



My Problem

So, 1) I created the my.cnf file and 2) changed the value of 'max_allowed_packet' to the largest size. I 3) restarted my MySQL server and 4) re-scanned the source-code and then 5) received the same error.


Does anyone know what I am missing?



Respectfully,



Kyle Smith

Reply | Threaded
Open this post in threaded view
|

Re: Packet Size Too Large - Windows

Patroklos Papapetrou
Hi Kyle

Although the problem is not related to SonarQube, here's my suggestion
In windows mysql installation there is no my.cnf file , but you should look for a my.ini file.
Actually the mysql installation comes with a default config file named my-default.ini that you can copy to my.ini and make any changes you need

Regards

Patroklos Papapetrou

SoftwareGarden.io

Linkedin | Twitter | Author Speaker | Blog | Google+ | GitHub |



On Sat, Dec 20, 2014 at 12:04 AM, Kyle Smith <[hidden email]> wrote:
Hi Everyone,

Here is my *Execution Failure* log for a scan I am trying to run.

*INFO:
------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO:
------------------------------------------------------------------------
Total time: 1:17.458s
Final Memory: 14M/422M
INFO:
------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to read and import the source file :
'C:/Users/kyle/D
ocuments/FolderWithSomeCode/NAME/folder/my_database_stuff.sql' with the
charset : 'UTF-8'.ERROR: Caused by:### Error updating database.  Cause:
com.mysql.jdbc.PacketTooBigException: Packe
t for query is too large (6387851 > 4194304). You can change this value on
the server by setting the max_allowed_packet' variable.
### The error may involve
org.sonar.core.source.db.SnapshotSourceMapper.insert-Inline
### The error occurred while setting parameters
### SQL: insert into snapshot_sources (snapshot_id, data) values (?, ?)
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too
large (
6387851 > 4194304). You can change this value on the server by setting the
max_allowed_packet' variable.
ERROR: Caused by: Packet for query is too large (6387851 > 4194304). You can
cha
nge this value on the server by setting the max_allowed_packet' variable.
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner
with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug
logging.*

I tried to modify the value for the 'max_allowed_packet' variable to 1GB,
which is according to the MySQL  documentation
<http://dev.mysql.com/doc/refman/5.6/en/packet-too-large.html>   the largest
size of a packet for my version of MySQL. I looked around the Windows system
I installed MySQL on and did not find a *my.cnf* file. I checked the /mysql
--help / command which lists the default locations for the *my.cnf* file and
did not find it anywhere on my file system. I also searched for this from
the C drive in Explorer and did not find it. Since I did not find this key
file anywhere I created the file myself and put it in one of the default
locations, /C:\my.cnf/, listed in  /mysql --help /.


The *my.cnf* file I created looks like this:
[mysqld]
max_allowed_packet=1G


My Problem
So, 1) I created the *my.cnf* file and 2) changed the value of
'max_allowed_packet' to the largest size. I  3) restarted my MySQL server
and 4) re-scanned the source-code and then 5) received the same error.

Does anyone know what I am missing?


Respectfully,


Kyle Smith




--
View this message in context: http://sonarqube.15.x6.nabble.com/Packet-Size-Too-Large-Windows-tp5031229.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email