Forum

2006 MySQL server h...
 
Notifications
Retirer tout

2006 MySQL server has gone away

8 Posts
2 Utilisateurs
0 Reactions
13.6 {numéro}K Vu
(@solidd)
Posts: 4
Active Member
Début du sujet
 
[#1678]

Hello Projeqtor forum,

I've got a problem when I try to connect on my website using projeqtor/projectorria.
When I check the projectorria logs, I find multiple "Exception-[HY000] SQLSTATE[HY000]: General error: 2006 MySQL server has gone away" errors.
The result of those errors is that I DON'T see the icons on the top of projectorria website. That's like I could just connect to the website, but not using it properly.

Here is a link where I pasted my last logs: http://pastebin.com/aAUZ8Dvw 🙂
And I added a screenshot of the website I've got when I'm connected.

My config is:

<?php
// =======================================================================================
// Automatically generated parameter file
// on 2014-03-11 11:36:58
// =======================================================================================
$paramDbType='mysql';
$paramDbHost='*****';
$paramDbPort='3306';
$paramDbUser='***';
$paramDbPassword='*****';
$paramDbName='projectorria';
$paramDbPrefix='';
$logFile='../files/logs/projectorria_${date}.log';
$logLevel='2';
//======= END

Could you please help me?


 
Posté : 11 Mar PM 14:033
(@babynus)
Posts: 14952
Membre Admin
 

It seems your mySql server is shut down.
Or possibly port has been closed.


 
Posté : 11 Mar PM 14:033
(@solidd)
Posts: 4
Active Member
Début du sujet
 

The serveur is actually UP and this port is open. I'm already using my mysql server with other databases and I don't have this "server gone" error. My server is running properly at the moment.

I've seen on the web for this 2006 mysql error a possible solution: grow "max_allowed_packet" valor.
I did it but it still doesn't work. 🙁


 
Posté : 11 Mar PM 14:033
(@babynus)
Posts: 14952
Membre Admin
 

Here are few tries to test in my.ini (Windows) or my.cnf (Linux) :

max_allowed_packet=256M 
innodb_buffer_pool_size=256M
max_connections=500
wait_timeout = 600

and restart MySQL


 
Posté : 11 Mar PM 15:033
(@solidd)
Posts: 4
Active Member
Début du sujet
 

Done.
Still doesn't work.

I have checked my mysql logs and I see when My Projectorria server is connecting on the DB.

 336 Connect   projectorriauser@******* as anonymous on projectorria
                  336 Query     desc audit
                  336 Query     select * from audit where audit.sessionId='s6j9f7ilqhatlb1dd3kvjah9e5'
                  336 Query     select * from audit where id=2
140311 14:26:36   336 Query     select * from audit where id=2
                  336 Query     update audit set lastAccess='2014-03-11 14:26:35' , duration='02:49:18'  where id=2
                  336 Query     desc mailable
                  336 Query     select * from mailable where mailable.name='Audit'
                  336 Query     select id as id, name as name from indicatorable where (idle=0 ) order by indicatorable.name
                  336 Query     desc parameter
                  336 Query     select * from parameter where parameter.idUser is null and parameter.idProject is null and parameter.parameterCode='dbVersion'
                  336 Query     select * from profile where id=1
                  336 Query     select * from parameter where  (idUser is null and idProject is null)


140311 14:27:43     2 Query     COMMIT
                  403 Connect   projectorriauser@******* as anonymous on projectorria
                  403 Query     desc audit
                  403 Query     select * from audit where audit.sessionId='s6j9f7ilqhatlb1dd3kvjah9e5'
                  403 Query     select * from audit where id=2
                  403 Query     select * from audit where id=2
                  403 Query     select id as id, name as name from indicatorable where (idle=0 ) order by indicatorable.name
                  403 Quit
                  404 Connect   projectorriauser@******* as anonymous on projectorria
                  404 Query     desc audit
                  404 Query     select * from audit where audit.sessionId='s6j9f7ilqhatlb1dd3kvjah9e5'
                  404 Query     select * from audit where id=2
                  404 Query     select * from audit where id=2
                  404 Query     select id as id, name as name from indicatorable where (idle=0 ) order by indicatorable.name
                  404 Quit
                  405 Connect   projectorriauser@******* as anonymous on projectorria
                  405 Query     desc audit
                  405 Query     select * from audit where audit.sessionId='s6j9f7ilqhatlb1dd3kvjah9e5'
                  405 Query     select * from audit where id=2
                  405 Query     select * from audit where id=2
                  405 Query     select id as id, name as name from indicatorable where (idle=0 ) order by indicatorable.name
                  405 Query     desc alert
                  405 Query     select * from alert where alert.idUser=1 and alert.readFlag=0 and alert.idle=0 order by id asc
                  405 Quit

******* = my server's hostname
projectorriauser has got ALL mysql rights. And i can connect with it from multiple machines + localhost


 
Posté : 11 Mar PM 16:033
(@babynus)
Posts: 14952
Membre Admin
 

These logs show that connection to MySql works. These are single request to track connection.
So your connection parameters are good. No issue ion this side.

There must be an issue in preserving connection : projeqtor uses same Connection during the whole script execution, whatever the number of requests.
So maybe you're facing some connection droping.

You can try to extend wait_timeout, as decribed in http://linux.overshoot.tv/wiki/mysql_server_has_gone_away

wait_timeout=432000

default value is 28800 and should be enough, but maybe you configured it too small.

You can also try and force reconnection.
First method is to change in my.cnf :

 mysqli.reconnect = On

Second method is to update code in /model/persistence/Sql.php, line 221 :

  private static function getConnection() {
    if (self::$connexion != NULL) {
    	if (!mysql_ping($this->conn)) $this->reconnect();
      return self::$connexion;
    }

 
Posté : 11 Mar PM 21:033
(@solidd)
Posts: 4
Active Member
Début du sujet
 

I've done the changes and restarted apache service + mysql service. Still doesn't work. I continue to investigate.

I discovered a behavior change of the website: on the login interface, when I enter admin/admin credentials, I see the loading wheel and it loads infinitely.
It doesn't show the empty interface of projectorria website anymore.

Which log files should I check to find more clues/news ?


 
Posté : 17 Mar PM 12:033
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

If you left defaut configuration, log file is in /files/log directory. One file per day.


 
Posté : 17 Mar PM 14:033
Share:
Retour en haut