Additional uncaught exception thrown while handling exception

Additional uncaught exception thrown while handling exception.

Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => theme_registry:runtime:zircon:cache ) in lock_may_be_available() (line 167 of /home/facebook/public_html/subdom/new/includes/lock.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] => 0 [: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:187:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => theme_registry:runtime:zircon:cache ) ";s:9:"%function";s:23:"lock_may_be_available()";s:5:"%file";s:62:"/home/facebook/public_html/subdom/new/includes/lock.inc";s:5:"%line";i:167;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://new.facebook.co.id/ [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 112.215.66.78 [:db_insert_placeholder_9] => 1409896476 ) in dblog_watchdog() (line 160 of /home/facebook/public_html/subdom/new/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] => qWU6qBUzSKpmTx_3sPmM3plMvVGzXNSpQqXicedMNZU [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /home/facebook/public_html/subdom/new/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] => 5035252575409501cda8598.96012360 ) in lock_release_all() (line 269 of /home/facebook/public_html/subdom/new/includes/lock.inc).


Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /home/facebook/public_html/subdom/new/includes/database/database.inc:2171 Stack trace: #0 /home/facebook/public_html/subdom/new/includes/database/database.inc(2171): PDOStatement->execute(Array) #1 /home/facebook/public_html/subdom/new/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array) #2 /home/facebook/public_html/subdom/new/includes/database/database.inc(2350): DatabaseConnection->query('SELECT expire, ...', Array, Array) #3 /home/facebook/public_html/subdom/new/includes/lock.inc(167): db_query('SELECT expire, ...', Array) #4 /home/facebook/public_html/subdom/new/includes/lock.inc(146): lock_may_be_available('schema:runtime:...') #5 /home/facebook/public_html/subdom/new/includes/bootstrap.inc(424): lock_acquire('schema:runtime:...') #6 /home/facebook/public_html/subdom/new/includes/bootstrap.inc(446): Drupal in /home/facebook/public_html/subdom/new/includes/database/database.inc on line 2171


Error macam apa ini? dari hasil searching di google, banyak yang menyimpulkan karena max_allowed_packet yang kecil (defaultnya 1MB alias 1024KB), disarankan untuk diganti menjadi 64MB (alias 65536KB). Yaitu dengan cara merubah di my.ini.

Namun karena lokasi server berada di share hosting dimana setting mysql diharamkan dilakukan oleh user, ini yang menjadi tantangan,

Error tersebut diatas, terjadi ketika memindahkan dari localhost ke live server, baik menggunakan module backup & migrate maupun memindahkan secara manual menggunakan phpMyAdmin.

Duh...

Langkah yang sudah ditempuh untuk mengatasi max_allowed_packet:

  1. menambahkan php_value max_allowed_packet 64 di .htaccess dan hasilnya
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webmaster@new.facebook.co.id and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  2. menjalankan script di phpMyAdmin dengan perintah SET GLOBAL max_allowed_packet=16777216;
    dan hasilnya malah
    #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation.
  3. menambahkan ini_set('max_allowed_packet',16777216); di setting.php.
    hasilnya error masih sama...
  4. solusi terakhir, ganti hosting, langsung lancar jaya :-)