We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

MySQL server error | Forum

Purusothaman Ramanujam
Hi,

I get the below error when I try to upload a file from server to Amazon S3 using an Oxwall plugin. The file gets uploaded successfully. But I get the error after that.

Message:     SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
File:     /home/account/public_html/oxwall/ow_core/database.php
Line:     305
Trace:    

#0 /home/account/public_html/oxwall/ow_core/database.php(305): PDOStatement->execute()
#1 /home/account/public_html/oxwall/ow_core/database.php(349): OW_Database->execute('SELECT * FROM o...', NULL)
#2 /home/account/public_html/oxwall/ow_core/base_dao.php(77): OW_Database->queryForObjectList('SELECT * FROM o...', 'BOL_User')
#3 /home/account/public_html/oxwall/ow_system_plugins/base/bol/user_service.php(641): OW_BaseDao->findByIdList(Array)
#4 /home/account/public_html/oxwall/ow_system_plugins/base/bol/question_service.php(1135): BOL_UserService->findUserListByIdList(Array)
#5 /home/account/public_html/oxwall/ow_system_plugins/base/bol/user_service.php(175): BOL_QuestionService->getQuestionData(Array, Array)
#6 /home/account/public_html/oxwall/ow_plugins/ajaxim/components/toolbar.php(54): BOL_UserService->getDisplayName(1)
#7 /home/account/public_html/oxwall/ow_plugins/ajaxim/init.php(67): AJAXIM_CMP_Toolbar->render()
#8 [internal function]: ajaxim_plugin_init(Object(OW_Event))
#9 /home/account/public_html/oxwall/ow_core/event_manager.php(169): call_user_func('ajaxim_plugin_i...', Object(OW_Event))
#10 /home/account/public_html/oxwall/ow_core/application.php(326): OW_EventManager->trigger(Object(OW_Event))
#11 /home/account/public_html/oxwall/index.php(76): OW_Application->finalize()
#12 {main}

Type:     PDOException
Michael I.
Michael I. May 18 '12
It seems that your MySQL server went down for some reason. Do you still have this issue?
Purusothaman Ramanujam
yes. Whenever I try sending the files to amazon S3 I get this issue.

The file is transferred to S3 without any issues. After that I get this issue.
Mark
Mark May 18 '12
is there a timeout set anywhere in mysql?


it looks as if the mysql server is either going down or timing out, this may be insightful > http://dev.mysql.com/doc/refman/5.0/en/gone-away.html


how big are the files that you are sending over?


You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld receives a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by setting the server's max_allowed_packet variable, which has a default value of 1MB. You may also need to increase the maximum packet size on the client end. More information on setting the packet size is given inSection C.5.2.10, “Packet too large”.


and for the record my default value for the above is about 8M

The Forum post is edited by Mark May 18 '12
Purusothaman Ramanujam
Mark,


Thanks for your response.


My file transmission is nowhere related to mysql. It's a simple Amazon S3 file transfer via my own oxwall plugin. The size of the file is around 13MB. The actual file transmission happens correctly. But after that I get this error.


Do you think its related to mysql although I am not involving mysql server for the file transmission?

The Forum post is edited by Purusothaman Ramanujam May 19 '12
Mark
Mark May 19 '12
did you read this bit


You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld receives a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by setting the server's max_allowed_packet variable, which has a default value of 1MB. You may also need to increase the maximum packet size on the client end. More information on setting the packet size is given inSection C.5.2.10, “Packet too large”.


also what is the default value in your my.cnf (usually located at /etc/my.cnf)

Purusothaman Ramanujam
Ok. I got your point. I don't have access to  /etc/my.cnf.


As per your advice I set mysql_query('SET SESSION max_allowed_packet=16*1024*1024') in my upload script.


But that did not help.

The Forum post is edited by Purusothaman Ramanujam May 19 '12
Mark
Mark May 19 '12
if you dont have access to the mysql config file im not sure if this can be changed, you could try this if you have root and ssh access > http://azrad.tumblr.com/post/10159183523/mysql-error-1153-got-a-packer-bigger-than
Purusothaman Ramanujam
Thanks for the link. Let me try it.
Purusothaman Ramanujam
On my share hosting, I am not allowed to change it. I am trying to integrate S3 backup in my plugin.

Upload is done successfully but getting this error.

When I try to run the Amazon S3 backup throught cron, I get different set of reason but same error.

Message:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

File:
/home/ladiedmx/public_html/oxwall/ow_core/database.php

Line:
556

Trace:
#0 /home/ladiedmx/public_html/oxwall/ow_core/database.php(556): PDO->query('REPLACE INTO `o...')
#1 /home/ladiedmx/public_html/oxwall/ow_system_plugins/base/bol/cron_job_dao.php(84): OW_Database->batchInsertOrUpdateObjectList('ow_base_cron_jo...', Array)
#2 /home/ladiedmx/public_html/oxwall/ow_system_plugins/base/bol/cron_service.php(71): BOL_CronJobDao->batchSave(Array)
#3 /home/ladiedmx/public_html/oxwall/ow_cron/run.php(86): BOL_CronService->batchSave(Array)
The Forum post is edited by Purusothaman Ramanujam May 21 '12
Mark
Mark May 22 '12
im not sure, hopefully an oxwall tech can help further?


also you could try the mysql support forums

Purusothaman Ramanujam
Thanks Mark. I believe its very specific to Oxwall. Lets wait for a Oxwall Team member to have a look on this.
Mark
Mark May 28 '12
I was just going through my php.ini file and found the following setting


; Maximum time (in seconds) for connect timeout. -1 means no limitmysql.connect_timeout = 10


not sure if that would help?

Purusothaman Ramanujam
Thanks Mark. Today I did not get time to work on this as I had work related to EC2 issue.

Will try on this and let you know if it worked.
Michael I.
Michael I. Jun 3 '12
Pay attention to the time of connect with MySQL server.