I am getting this error when enabling the entity api module. I tried increasing the packet limit and it's not working for me. It think there is a module conflict but I am not sure which one. I do not have i18n enabled. As soon as I enable, it crashes like this. Everything is up to date on this dev site. Any ideas?

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:seven:cache ) in lock_may_be_available() (line 167 of /Applications/MAMP/htdocs/main/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] => 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:186:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => theme_registry:runtime:seven:cache ) ";s:9:"%function";s:23:"lock_may_be_available()";s:5:"%file";s:48:"/Applications/MAMP/htdocs/main/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://localhost:8888/main/admin/modules [:db_insert_placeholder_7] => http://localhost:8888/main/admin/modules [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1363097121 ) in dblog_watchdog() (line 154 of /Applications/MAMP/htdocs/main/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] => 859451141513f361fbe0845.57153913 ) in lock_release_all() (line 269 of /Applications/MAMP/htdocs/main/includes/lock.inc).

Thank you

Comments

rileyhuff’s picture

Status: Active » Closed (works as designed)

Other database problem unrelated to Entity API caused this problem to show up when the module was enabled. Problem was fixed and module was successfully enabled.

lupus78’s picture

I've ran into similar issue, and disabling Entity Token module solves the problem.

@riley-huff: you say you have solved it in the database, and the issue is not releated with Entity API module. Can you explain what you did?

lupus78’s picture

Component: Entity CRUD controller » Entity tokens
Status: Closed (works as designed) » Active
David Hernández’s picture

This issue can be fixed on the database configuration. In mysql the parameter is max_allowed_packet.

I had to change it to be max_allowed_packet=256MB.

This configuration is in the mysql.conf / my.cnf file (/etc/mysql/my.cnf in debian systems).

I still don't like the solution, not sure if this should be fixed in the code, maybe splitting the cache inserts to be smaller.

ladybug_3777’s picture

Thank you! This helped me fix my issue with my pathauto patterns page when I have Entity Token enabled.

I had some trouble finding my config file on Windows 7, so in case anyone else needs help finding theirs, this is what I did:

Win+R(shortcut for 'run'), type services.msc, Enter
This will open the services window.
Look for an entry like 'MySQL, right click on it, select properties
Look for the "Path to executable" text.

Mine was this:
C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="C:\Program Files (x86)\MySQL\MySQL Server 5.5\my.ini" MySQL

I opened up my my.ini file and I did not have a variable for the max_allowed_packet in there, so I simply added it after my "max_connections=100" section.

I saved the file then I went back to the services window, right clicked on MYSQL and selected the "Restart" option so my changes would take effect.

andraeray’s picture

#4 is still very helpful. Fixed my problem today.