Problem/Motivation
Some Entities for some reason cause PDO Exceptions, this looks to be related to the user_module function user_roles and the session_api
For me this happens with node and comment entities. However, there have been several issues posted for the same issue with other entity types being fixed by some work arounds like enabling/disabling/feature rebuilding/standing on head.
I currently do not have a workaround.
Full Error
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT r.rid AS rid, r.name AS name FROM {role} r ORDER BY weight ASC, name ASC; Array ( ) in user_roles() (line 2923 of /modules/user/user.module).
Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT ff.* FROM {filter_format} ff WHERE (status = :db_condition_placeholder_0) ORDER BY weight ASC; Array ( [:db_condition_placeholder_0] => 1 ) in filter_formats() (line 426 of /modules/filter/filter.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] => -F2LoaJZu994OC_EaM2-zo18NfBquFs9Lr29R2biF14 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 209 of /includes/session.inc).
Proposed resolution
Still debugging
Remaining tasks
Debug