Fatal error for hosting?

Sometimes I get this error temporarily but Elgg it works perfectly. I think it is a server problem. Hosting says it's not their problem, but only appears in many hours of activity.

How about that?

Error Fatal

 

MySQL server has gone away

QUERY: SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')

DatabaseException Object
(
[message:protected] => MySQL server has gone away

QUERY: SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')
[string:Exception:private] => exception 'DatabaseException' with message 'MySQL server has gone away

QUERY: SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')' in /home/u264239541/public_html/engine/lib/database.php:274
Stack trace:
#0 /home/u264239541/public_html/engine/lib/database.php(416): execute_query('SELECT count(DI...', Resource id #55)
#1 /home/u264239541/public_html/engine/lib/database.php(379): elgg_query_runner('SELECT count(DI...', '', true)
#2 /home/u264239541/public_html/engine/lib/entities.php(1082): get_data_row('SELECT count(DI...')
#3 /home/u264239541/public_html/engine/lib/metadata.php(456): elgg_get_entities(Array)
#4 /home/u264239541/public_html/engine/lib/relationships.php(307): elgg_get_entities_from_metadata(Array)
#5 /home/u264239541/public_html/mod/friend_request/start.php(69): elgg_get_entities_from_relationship(Array)
#6 [internal function]: friend_request_pagesetup('pagesetup', 'system', NULL)
#7 /home/u264239541/public_html/engine/lib/elgglib.php(784): call_user_func_array('friend_request_...', Array)
#8 /home/u264239541/public_html/engine/lib/views.php(418): elgg_trigger_event('pagesetup', 'system')
#9 /home/u264239541/public_html/engine/lib/admin.php(496): elgg_view('admin/plugins', Array)
#10 /home/u264239541/public_html/mod/izap-elgg-bridge/classes/IzapAdminController.php(41): admin_page_handler(Array)
#11 [internal function]: IzapAdminController->__call('actionPlugins', Array)
#12 [internal function]: IzapAdminController->actionPlugins(Array)
#13 /home/u264239541/public_html/mod/izap-elgg-bridge/classes/IzapAdminController.php(45): call_user_func(Array, Array)
#14 /home/u264239541/public_html/mod/izap-elgg-bridge/start.php(118): IzapAdminController->runAction()
#15 [internal function]: izap_pagehandler_bridge(Array, 'admin')
#16 /home/u264239541/public_html/engine/lib/pagehandler.php(53): call_user_func('izap_pagehandle...', Array, 'admin')
#17 /home/u264239541/public_html/engine/handlers/page_handler.php(46): page_handler('admin', 'plugins')
#18 {main}
[code:protected] => 0
[file:protected] => /home/u264239541/public_html/engine/lib/database.php
[line:protected] => 274
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /home/u264239541/public_html/engine/lib/database.php
[line] => 416
[function] => execute_query
[args] => Array
(
[0] => SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')
[1] => Resource id #55
)

)

[1] => Array
(
[file] => /home/u264239541/public_html/engine/lib/database.php
[line] => 379
[function] => elgg_query_runner
[args] => Array
(
[0] => SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')
[1] =>
[2] => 1
)

)

[2] => Array
(
[file] => /home/u264239541/public_html/engine/lib/entities.php
[line] => 1082
[function] => get_data_row
[args] => Array
(
[0] => SELECT count(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE (r.relationship = 'friendrequest' AND r.guid_two = '33') AND ((e.type = 'user')) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes')
)

)

[3] => Array
(
[file] => /home/u264239541/public_html/engine/lib/metadata.php
[line] => 456
[function] => elgg_get_entities
[args] => Array
(
[0] => Array
(
[metadata_names] =>
[metadata_values] =>
[metadata_name_value_pairs] =>
[metadata_name_value_pairs_operator] => AND
[metadata_case_sensitive] => 1
[order_by_metadata] => Array
(
)

[metadata_owner_guids] =>
[relationship] => friendrequest
[relationship_guid] => 33
[inverse_relationship] => 1
[type] => user
[count] => 1
[wheres] => Array
(
[0] => (r.relationship = 'friendrequest' AND r.guid_two = '33')
)

[joins] => Array
(
[0] => JOIN elgg_entity_relationships r on r.guid_one = e.guid
)

[selects] => Array
(
[0] => r.id
)

)

)

)

[4] => Array
(
[file] => /home/u264239541/public_html/engine/lib/relationships.php
[line] => 307
[function] => elgg_get_entities_from_metadata
[args] => Array
(
[0] => Array
(
[relationship] => friendrequest
[relationship_guid] => 33
[inverse_relationship] => 1
[type] => user
[count] => 1
[wheres] => Array
(
[0] => (r.relationship = 'friendrequest' AND r.guid_two = '33')
)

[joins] => Array
(
[0] => JOIN elgg_entity_relationships r on r.guid_one = e.guid
)

[selects] => Array
(
[0] => r.id
)

)

)

)

[5] => Array
(
[file] => /home/u264239541/public_html/mod/friend_request/start.php
[line] => 69
[function] => elgg_get_entities_from_relationship
[args] => Array
(
[0] => Array
(
[type] => user
[count] => 1
[relationship] => friendrequest
[relationship_guid] => 33
[inverse_relationship] => 1
)

)

)

[6] => Array
(
[function] => friend_request_pagesetup
[args] => Array
(
[0] => pagesetup
[1] => system
[2] =>
)

)

[7] => Array
(
[file] => /home/u264239541/public_html/engine/lib/elgglib.php
[line] => 784
[function] => call_user_func_array
[args] => Array
(
[0] => friend_request_pagesetup
[1] => Array
(
[0] => pagesetup
[1] => system
[2] =>
)

)

)

[8] => Array
(
[file] => /home/u264239541/public_html/engine/lib/views.php
[line] => 418
[function] => elgg_trigger_event
[args] => Array
(
[0] => pagesetup
[1] => system
)

)

[9] => Array
(
[file] => /home/u264239541/public_html/engine/lib/admin.php
[line] => 496
[function] => elgg_view
[args] => Array
(
[0] => admin/plugins
[1] => Array
(
[page] => Array
(
[0] => plugins
)

)

)

)

[10] => Array
(
[file] => /home/u264239541/public_html/mod/izap-elgg-bridge/classes/IzapAdminController.php
[line] => 41
[function] => admin_page_handler
[args] => Array
(
[0] => Array
(
[0] => plugins
)

)

)

[11] => Array
(
[function] => __call
[class] => IzapAdminController
[type] => ->
[args] => Array
(
[0] => actionPlugins
[1] => Array
(
[0] => Array
(
[0] => plugins
)

)

)

)

[12] => Array
(
[function] => actionPlugins
[class] => IzapAdminController
[type] => ->
[args] => Array
(
[0] => Array
(
[0] => plugins
)

)

)

[13] => Array
(
[file] => /home/u264239541/public_html/mod/izap-elgg-bridge/classes/IzapAdminController.php
[line] => 45
[function] => call_user_func
[args] => Array
(
[0] => Array
(
[0] => IzapAdminController Object
(
[_page:protected] => Array
(
[0] => plugins
)

[_view:protected] => admin/plugins
[controller] => IzapAdminController
[action] => actionPlugins
[url_vars] => Array
(
[0] => plugins
)

[page_shell] => admin
[page_layout] => admin
[page_elements] => Array
(
[sidebar] =>
[title] => Plugins
[content] =>
)

[widgets] =>
[buttons] =>
)

[1] => actionPlugins
)

[1] => Array
(
[0] => plugins
)

)

)

[14] => Array
(
[file] => /home/u264239541/public_html/mod/izap-elgg-bridge/start.php
[line] => 118
[function] => runAction
[class] => IzapAdminController
[type] => ->
[args] => Array
(
)

)

[15] => Array
(
[function] => izap_pagehandler_bridge
[args] => Array
(
[0] => Array
(
[0] => plugins
)

[1] => admin
)

)

[16] => Array
(
[file] => /home/u264239541/public_html/engine/lib/pagehandler.php
[line] => 53
[function] => call_user_func
[args] => Array
(
[0] => izap_pagehandler_bridge
[1] => Array
(
[0] => plugins
)

[2] => admin
)

)

[17] => Array
(
[file] => /home/u264239541/public_html/engine/handlers/page_handler.php
[line] => 46
[function] => page_handler
[args] => Array
(
[0] => admin
[1] => plugins
)

)

)

[previous:Exception:private] =>
)

  • Shared hosting has a limited number of connections to MySQL, so that might be your issue. Chances are, which is very high, your hosting package has limited features.

    Some other common reasons for the MySQL server has gone away error are:

    • You (or the db administrator) has killed the running thread with a KILL statement or a mysqladmin kill command.

    • You tried to run a query after closing the connection to the server. This indicates a logic error in the application that should be corrected.

    • A client application running on a different host does not have the necessary privileges to connect to the MySQL server from that host.

    • You got a timeout from the TCP/IP connection on the client side. This may happen if you have been using the commands: mysql_options(..., MYSQL_OPT_READ_TIMEOUT,...) or mysql_options(..., MYSQL_OPT_WRITE_TIMEOUT,...). In this case increasing the timeout may help solve the problem.

    • You have encountered a timeout on the server side and the automatic reconnection in the client is disabled (thereconnect flag in the MYSQL structure is equal to 0).

    • You are using a Windows client and the server had dropped the connection (probably because wait_timeoutexpired) before the command was issued.

      The problem on Windows is that in some cases MySQL does not get an error from the OS when writing to the TCP/IP connection to the server, but instead gets the error when trying to read the answer from the connection.

      Prior to MySQL 5.0.19, even if the reconnect flag in the MYSQL structure is equal to 1, MySQL does not automatically reconnect and re-issue the query as it doesn't know if the server did get the original query or not.

      The solution to this is to either do a mysql_ping() on the connection if there has been a long time since the last query (this is what Connector/ODBC does) or set wait_timeout on the mysqld server so high that it in practice never times out.

    • 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”.

      An INSERT or REPLACE statement that inserts a great many rows can also cause these sorts of errors. Either one of these statements sends a single request to the server irrespective of the number of rows to be inserted; thus, you can often avoid the error by reducing the number of rows sent per INSERT or REPLACE.

    • You also get a lost connection if you are sending a packet 16MB or larger if your client is older than 4.0.8 and your server is 4.0.8 and above, or the other way around.

    • It is also possible to see this error if host name lookups fail (for example, if the DNS server on which your server or network relies goes down). This is because MySQL is dependent on the host system for name resolution, but has no way of knowing whether it is working—from MySQL's point of view the problem is indistinguishable from any other network timeout.

      You may also see the MySQL server has gone away error if MySQL is started with the --skip-networkingoption.

      Another networking issue that can cause this error occurs if the MySQL port (default 3306) is blocked by your firewall, thus preventing any connections at all to the MySQL server.

    • You can also encounter this error with applications that fork child processes, all of which try to use the same connection to the MySQL server. This can be avoided by using a separate connection for each child process.

    • You have encountered a bug where the server died while executing the query.

  • @manacim The server is a hosting Premium but is economical and more restrictions, in the future I think will leave change to finish the project, because this is not the only problem that is giving me.

     

    Thanks!!

  • I too pass me that and the problem was a plugin, viewing and analyzing the code I can see that the plugin that caused the error was friendrequest, the solution is to go to mod files and delete the folder of the plugin manually empty the cache.

  • This could be due either to a server overload (shutting down server) or a plugin.

    Who is your host?

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • @rjcalifornia is hostinger.es gives to many problems

  • I also hostinger.es use, have to wait until the same server solves the problem.

  • Alright, so that was probably the server.

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking