After installing the LU 7.x.-2.x-dev I'm getting this error:

Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: here comes a large amount of text… the beginning:
INSERT INTO {batch} (bid, timestamp, token, batch) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 32 [:db_insert_placeholder_1] => 1395887956 [:db_insert_placeholder_2] => bsjukogPPsnqF6fWkz2-rfahWrmAQwBquw8qe-OoF9s [:db_insert_placeholder_3] => a:13:{s:4:"sets";a:4:{i:0;a:15:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"start";i:0;s:7:"elapsed";i:0;s:5:"title";s:21:"Updating translations";s:16:"progress_message";s:0:"";s:13:"error_message";s:33:"Error importing translation files";s:8:"finished";s:32:"l10n_update_batch_fetch_finished";s:4:"file";s:57:"sites/all/modules/contr/l10n_update/l10n_update.batch.inc";s:12:"init_message";s:23:"Inicjowanie.<

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] => 5a6XZrnv2llzp2tPd_jtIVZfI4buKKXBb4Hq0X8kktA [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /home/xyz/domains/abc.com/public_html/includes/session.inc).

Uncaught exception thrown in shutdown function.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 165846628153338f57325063.34020586 ) in lock_release_all() (line 269 of /home/xyz/domains/abc.com/public_html/includes/lock.inc).

It happens everytime while enabling any module and LU itself. After refreshing (F5), the site works with enabled modules. After disabling the LU module everything works without errors.
I have another site that uses the same LU dev version and there are no errors.

I do know the trick with max_allowed_packet, I have set this value to max_allowed_packet = 1024M, but the error still persists.

CommentFileSizeAuthor
#11 Screenshot at Aug 20 19-59-17.png238.6 KBvindesh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sutharsan’s picture

Status: Active » Postponed (maintainer needs more info)

Need more information to determine the cause of the problem.

  • How many modules are enabled at the time you enable Localization Update?
  • When you have enabled Localization Update and enable a new module, how much time is there between hitting submit on the module page and the error occurs? and how much time does enabling a module take when Localization Update is disabled?
  • What is the wait_timeout setting of your Mysql Server
Sutharsan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No response received. closing the issue. Feel free to re-open if you can provide details to reproduce the situation.

s427’s picture

FYI I seem to have the same problem. I didn't think it could come from the LU module, but after finding this page I tried disabling it and it seems that the problem has indeed gone away.

I'm working on a local installation (Win8.1, XAMPP) and I make quite a lot of testing with a lot of enabled modules, so it's possible the problem comes from a combination of modules. (Or from the simple fact that there are a lot of them?)

The error message is HUGE (1,8MB of text!!!) and follows the same structure as the one posted by LaTradia (3 "general errors"), although the tables involved are not exactly the same. It occurs every time I try to enable a module, but fortunately it doesn't prevent the module from being enabled, nor does it affect the module afterwards (as far as I can tell). I saved it in a text file, so I can send it if you think it can help. I'm copying a sample below.

Here's a list of all modules I have enabled at the moment (excluding core modules):

  • admin_menu
  • admin_menu_toolbar
  • admin_views
  • coffee
  • module_filter
  • ctools
  • smiley
  • smiley_wysiwyg
  • context
  • context_ui
  • email
  • entityreference
  • field_group
  • link
  • exif
  • pathologic
  • linkit_picker
  • smtp
  • file_entity
  • jplayer
  • media
  • media_internet
  • media_wysiwyg
  • media_dailymotion
  • media_vimeo
  • media_youtube
  • plupload
  • node_gallery
  • node_gallery_api
  • oauth_common
  • advanced_help
  • backup_migrate
  • colorbox
  • comment_sort_created
  • crumbs
  • diff
  • entity
  • entity_token
  • flippy
  • footnotes
  • footnotes_views
  • htmltag
  • libraries
  • linkit
  • mollom
  • pathauto
  • redirect
  • path_redirect_import
  • scanner
  • special_menu_items
  • token
  • transliteration
  • twitter
  • twitter_post
  • xautoload
  • globalredirect
  • honeypot
  • footnotes_wysiwyg
  • wysiwyg
  • views
  • views_bulk_operations
  • views_ui

And here's a sample of the 3-parts error message. The first part is the longest (like I said, about 1,8MB of text) so I don't include all of it, but the 2 other parts are shorter and included entirely:

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {batch} (bid, timestamp, token, batch) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 148 [:db_insert_placeholder_1] => 1418463509 [:db_insert_placeholder_2] => Y1wIAJTdRBXqXtin9RtOJAaCKnBZx6X8lmv168FS2Bo [:db_insert_placeholder_3] => a:13:{s:4:"sets";a:5:{i:0;a:15:{s:7:"sandbox";a:0:{}s:7:"results";a:0:{}s:7:"success";b:0;s:5:"start";i:0;s:7:"elapsed";i:0;s:5:"title";s:21:"Updating translation.";s:12:"init_message";s:43:"Downloading and importing files.<br/> ";s:13:"error_message";s:38:"Error importing interface translations";s:4:"file";s:51:"sites/all/modules/l10n_update/l10n_update.batch.inc";s:8:"finished";s:27:"_l10n_update_batch_finished";s:16:"progress_message";s:29:"Completed @current of @total.";s:3:"css";a:0:{}s:5:"total";i:3;s:5:"count";i:3;s:5:"queue";a:2:{s:4:"name";s:18:"drupal_batch:148:0";s:5:"class";s:10:"BatchQueue";}}i:1;a:1:{s:11:"form_submit";s:25:"context_admin_form_submit";}i:2;a:1:{s:11:"form_submit";s:44:"module_filter_system_modules_submit_redirect";}i:3;a:1:{s:11:"form_submit";s:42:"module_filter_system_modules_submit_recent";}i:4;a:1:{s:11:"form_submit";s:25:"update_cache_clear_submit";}}
[...]
0:{}s:14:"#title_display";s:6:"before";s:3:"#id";s:11:"edit-submit";}}s:11:"progressive";b:1;s:11:"current_set";i:0;s:3:"url";s:5:"batch";s:11:"url_options";a:0:{}s:10:"source_url";s:26:"admin/modules/list/confirm";s:8:"redirect";N;s:5:"theme";s:5:"seven";s:17:"redirect_callback";s:11:"drupal_goto";s:2:"id";s:3:"148";s:13:"error_message";s:86:"Please continue to <a href="/blog/dp7/batch?id=148&op=finished">the error page</a>";} ) in dblog_watchdog() (line 160 of C:\xampp\htdocs\site_name\modules\dblog\dblog.module).
Additional

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT lid, location FROM {locales_source} WHERE source = :source AND context = :context AND textgroup = 'default'; Array ( [:source] => An AJAX HTTP error occurred. [:context] => ) in _locale_parse_js_file() (line 1563 of C:\xampp\htdocs\site_name\includes\locale.inc).
Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1165786142548c09185b7a76.53495999 ) in lock_release_all() (line 269 of C:\xampp\htdocs\site_name\includes\lock.inc).
s427’s picture

Almost forgot to answer Sutharsan's questions. ^^

The wait_timeout setting (according to phpMyAdmin) is 28,800.
Time before the error occurs (with LU enabled): around 12 seconds
Time to enable a module (with LU disabled): around 15 seconds

Also interesting: if I change the max_allowed_packet setting in my.ini (from 1M to 16M), the problem goes away (for now, anyway).

Sutharsan’s picture

You may have a general performance problem, 15 seconds to enable a module is very long. For comparison, on my laptop it takes a site with 52 modules 5 seconds to enable a module.

buddy.mayank’s picture

I am new to Drupal, from past 2 month I have tried learning concept of drupal and was really happy to use this powerful CMS.

But yesterday when visited Configuration > Search and Metadata > URL aliases > Pattern (i.e http://localhost/admin/config/search/path/patterns), I got following error page

Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {variable} variable WHERE ( (name = :db_condition_placeholder_0) ); Array ( [:db_condition_placeholder_0] => drupal_css_cache_files ) in variable_set() (line 991 of /home/www/icts-website/includes/bootstrap.inc).
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:235:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS expression FROM {variable} variable WHERE ( (name = :db_condition_placeholder_0) ); Array ( [:db_condition_placeholder_0] => drupal_css_cache_files ) ";s:9:"%function";s:14:"variable_set()";s:5:"%file";s:45:"/home/www/icts-website/includes/bootstrap.inc";s:5:"%line";i:991;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://localhost/admin/config/search/path/patterns [:db_insert_placeholder_7] => http://localhost/ [:db_insert_placeholder_8] => 10.0.8.14 [:db_insert_placeholder_9] => 1444714070 ) in dblog_watchdog() (line 160 of /home/www/icts-website/modules/dblog/dblog.module).
Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 399784779561c9655b48719.42544548 ) in lock_release_all() (line 269 of /home/www/icts-website/includes/lock.inc).

I tried googling for solution and I found that increasing max_allowed_packet to 32M in my.cnf will help resolve the error. But unfortunately the error still persist even after increasing max_allowed_packet to 32M

I will really appreciate your help with the above issue.

Thank and Regards,
Mayank

grougy’s picture

I had the same problem and increasing the max_allowed_packet to 32M in mysqld section of my.ini conf file has solved the error issue when enabling LU.

janspeer’s picture

Error 2006: MySQL server has gone away

after installing

anonimous_publishing
i10n_update
advanced_forum
search_by_page

in enabled all 4 at the same time
now have the error : Error 2006: MySQL server has gone away
--> and now when disabling/enabling one of the above i also had 'table already exist'

on testsite : enabled them one by one : and did not have the error

ckvadher’s picture

Same error

Francewhoa’s picture

vindesh’s picture

[Thu Aug 20 19:43:07.223888 2020] [php7:notice] [pid 1494] [client 127.0.0.1:52330] Drupal\\Core\\Database\\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {cache_bootstrap} (cid, expire, created, tags, checksum, data, serialized) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3......

I had the similar problem and increasing the max_allowed_packet to 128M/512M in mysqld section of my.cnf conf file has solved the error

Set in my.cnf configuration file
In /etc/my.cnf, change variables like:

$ sudo nano /etc/my.cnf
-----------------------------
[mysqld]
max_allowed_packet=512M

-----------------------------
If you do not find my.cnf file on your machine than you can create my.cnf conf file and write above code.
mysql Ver 14.14 Distrib 5.7.28, for macos10.14 (x86_64) using EditLine wrapper
macOS Catalina
Version: 10.15.3

OR
From command line login to mysql
$ mysql -u root -p
Enter password:
mysql> SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;
its done.

It is working for me.

Check the updated variable value on your phpmyadmin variable list.

thomaswalther’s picture

#11 worked for me:

SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;

Samerali88’s picture

#11 Thanks it's worked

SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;

thalles’s picture

If you use lando:
.lando.yml

  database:
    type: mysql:5.7
    portforward: true
    configuration:
      properties:
        max_allowed_packet: 77