Hi there. I got asked to help with our Drupal website and I am not very savvy with Drupal. We've run into an error after a coworker uploaded an Excel sheet, and now several pages on the website are giving this error. The page with the sheet is disabled, however, it is still showing up. The error originally had text about the comment module, which I attempted to edit, and now it has text about the User module, which I have not edited. Here is the full error message, with the website URL removed. (Also, if you would not mind simplifying solutions for someone very very new with Drupal, I would appreciate it).

Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT uid, name, picture, data FROM {users} WHERE uid IN (:uids_0, :uids_1, :uids_2, :uids_3, :uids_4, :uids_5, :uids_6, :uids_7, :uids_8, :uids_9, :uids_10, :uids_11, :uids_12, :uids_13, :uids_14, :uids_15, :uids_16, :uids_17, :uids_18, :uids_19, :uids_20, :uids_21, :uids_22, :uids_23, :uids_24, :uids_25, :uids_26, :uids_27, :uids_28, :uids_29, :uids_30, :uids_31, :uids_32, :uids_33, :uids_34, :uids_35, :uids_36, :uids_37, :uids_38, :uids_39, :uids_40, :uids_41, :uids_42, :uids_43, :uids_44, :uids_45, :uids_46, :uids_47, :uids_48, :uids_49); Array ( [:uids_0] => 1 [:uids_1] => 1 [:uids_2] => 1 [:uids_3] => 1 [:uids_4] => 1 [:uids_5] => 1 [:uids_6] => 35 [:uids_7] => 33 [:uids_8] => 34 [:uids_9] => 34 [:uids_10] => 34 [:uids_11] => 34 [:uids_12] => 34 [:uids_13] => 34 [:uids_14] => 34 [:uids_15] => 34 [:uids_16] => 34 [:uids_17] => 34 [:uids_18] => 34 [:uids_19] => 34 [:uids_20] => 34 [:uids_21] => 34 [:uids_22] => 34 [:uids_23] => 34 [:uids_24] => 34 [:uids_25] => 34 [:uids_26] => 34 [:uids_27] => 34 [:uids_28] => 34 [:uids_29] => 34 [:uids_30] => 34 [:uids_31] => 34 [:uids_32] => 34 [:uids_33] => 34 [:uids_34] => 34 [:uids_35] => 34 [:uids_36] => 34 [:uids_37] => 34 [:uids_38] => 34 [:uids_39] => 34 [:uids_40] => 34 [:uids_41] => 34 [:uids_42] => 34 [:uids_43] => 34 [:uids_44] => 34 [:uids_45] => 34 [:uids_46] => 34 [:uids_47] => 34 [:uids_48] => 34 [:uids_49] => 34 ) in user_node_load() (line 3678 of REMOVED URL/httpdocs/modules/user/user.module).
Additional

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:1809:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT uid, name, picture, data FROM {users} WHERE uid IN (:uids_0, :uids_1, :uids_2, :uids_3, :uids_4, :uids_5, :uids_6, :uids_7, :uids_8, :uids_9, :uids_10, :uids_11, :uids_12, :uids_13, :uids_14, :uids_15, :uids_16, :uids_17, :uids_18, :uids_19, :uids_20, :uids_21, :uids_22, :uids_23, :uids_24, :uids_25, :uids_26, :uids_27, :uids_28, :uids_29, :uids_30, :uids_31, :uids_32, :uids_33, :uids_34, :uids_35, :uids_36, :uids_37, :uids_38, :uids_39, :uids_40, :uids_41, :uids_42, :uids_43, :uids_44, :uids_45, :uids_46, :uids_47, :uids_48, :uids_49); Array ( [:uids_0] => 1 [:uids_1] => 1 [:uids_2] => 1 [:uids_3] => 1 [:uids_4] => 1 [:uids_5] => 1 [:uids_6] => 35 [:uids_7] => 33 [:uids_8] => 34 [:uids_9] => 34 [:uids_10] => 34 [:uids_11] => 34 [:uids_12] => 34 [:uids_13] => 34 [:uids_14] => 34 [:uids_15] => 34 [:uids_16] => 34 [:uids_17] => 34 [:uids_18] => 34 [:uids_19] => 34 [:uids_20] => 34 [:uids_21] => 34 [:uids_22] => 34 [:uids_23] => 34 [:uids_24] => 34 [:uids_25] => 34 [:uids_26] => 34 [:uids_27] => 34 [:uids_28] => 34 [:uids_29] => 34 [:uids_30] => 34 [:uids_31] => 34 [:uids_32] => 34 [:uids_33] => 34 [:uids_34] => 34 [:uids_35] => 34 [:uids_36] => 34 [:uids_37] => 34 [:uids_38] => 34 [:uids_39] => 34 [:uids_40] => 34 [:uids_41] => 34 [:uids_42] => 34 [:uids_43] => 34 [:uids_44] => 34 [:uids_45] => 34 [:uids_46] => 34 [:uids_47] => 34 [:uids_48] => 34 [:uids_49] => 34 ) ";s:9:"%function";s:16:"user_node_load()";s:5:"%file";s:75:"/REMOVED URL/httpdocs/modules/user/user.module";s:5:"%line";i:3678;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => REMOVED URL/admin/content [:db_insert_placeholder_7] => REMOVED URL/admin/config [:db_insert_placeholder_8] => 66.213.106.194 [:db_insert_placeholder_9] => 1485880698 ) in dblog_watchdog() (line 160 of /var/REMOVED URL/httpdocs/modules/dblog/dblog.module).
Uncaught exception thrown in session handler.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_condition_placeholder_0] => BBHybaYtFO-TYTQazpcOlp45F21kCNPoDGLz0W12nz0 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /var/www/REMOVED URL/httpdocs/includes/session.inc).

Comments

jaypan’s picture

Unfortunately that's a generic error that can be caused by any of a number of things. Often, it's a memory issue - you don't have enough to process the page. Sometimes though it can be a code loop, and sometimes it can be a problem with the database itself. It's not something that we can really debug remotely though.

Take a backup of your database, and start disabling modules and see if you can find a module that is causing the issue - this can help you pinpoint the problem. Afterwards you can re-install your database backup to bring you back to where you are at now.

Contact me to contract me for D7 -> D10/11 migrations.

tonga73’s picture

well, I'm new at drupal and had some serious work to make it run, but now it's done I want to share a solution to this particular error that I didn't saw around looking on forums and here. thanks for the help I could find here btw :D

the SOLUTION: In my case I tried everything and it didn't worked, until I realized that Drupal told me to change the privileges of /default, so I did. But the problem was that I selected "none". Changed the thing to "read" permissions and it was all. Solved. I also changed the all project permissions to "read only", and it's working for now.

Hope it helps you :D, there's a lot of solutions for this. Keep trying.

mmjvb’s picture

Most common result points to not properly configured MySQL server:max_allowed_packet.
When appropriate suggest to see the innodb settings as well.
On a XAMPP installation there are several .ini examples in mysql folder for different installation sizes.

jaypan’s picture

Most common result points to not properly configured MySQL server:max_allowed_packet.

That's the most common result, but personally I've had this problem multiple times, and it's never actually been that.

Contact me to contract me for D7 -> D10/11 migrations.

mmjvb’s picture

Doubt very much you would encounter the easily solved issues. As you can see from the search results there are quite a lot of people acknowledging that cause. Even to my surprise, for years!

Running a site requires a properly configured infrastructure. It is surprising to see how many people take apache and mysql for granted!

sprite’s picture

It can take a lot of fiddling with both php.ini and my.ini to get everything tuned for a particular Linux installation, available memory, CPUs, number of vhosts, and more to optimize performance, and void the dreaded 2006 error.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...