on a brand new kickstarter v2 installation, when going to Content>Settings-Content Types>Add content type
I get this error

Additional uncaught exception thrown while handling exception.

Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_flat_rate_service}; Array ( ) in commerce_flat_rate_commerce_shipping_service_info() (line 120 of /******************************/sites/all/modules/commerce_flat_rate/commerce_flat_rate.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:119:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_flat_rate_service}; Array ( ) ";s:9:"%function";s:51:"commerce_flat_rate_commerce_shipping_service_info()";s:5:"%file";s:106:"/******************************/sites/all/modules/commerce_flat_rate/commerce_flat_rate.module";s:5:"%line";i:120;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://*************/admin/commerce/config/types/content/add [:db_insert_placeholder_7] => http://*************/ [:db_insert_placeholder_8] => 138.210.92.46 [:db_insert_placeholder_9] => 1347907872 ) in dblog_watchdog() (line 154 of /******************************/modules/dblog/dblog.module).

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 209 of /******************************/includes/session.inc).

Files: 
CommentFileSizeAuthor
#5 product-display.png229.38 KBnenaD

Comments

spanac’s picture

You have a problem with your local MySQL configuration.

To resolve that problem you need to increase max_allowed_packet variable in MySQL. Add following line in my.ini
max_allowed_packet=100M

Reference:
MySQL server has gone away
Tips and Tricks: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

bojanz’s picture

Category:bug» support
Status:Active» Fixed

Thanks, spanac.

d0a0b’s picture

That was it, thanks!

steve65140’s picture

Many thanks spanac.
For Mac OS X users the file name is my.cnf
For users of MAMP PRO edit the my.cnf template file as MAMP PRO recreates the my.cnf file every time it starts.

nenaD’s picture

StatusFileSize
new229.38 KB

For Mac OS X users using PHP, MySQL on top of Apache, not MAMP, which is the file to alter and where it resides, please?

@bojanz My commerce kickstart2 installation attempts were initially failing during demo shop importing of content, due to memory-limit problem. I managed to localize invisible folder and fix this, following troubleshooting page instructions, increasing the limit at usr/local/php5/lib/ php.ini-recommended file, duplicating and renaming it to php.ini .

How do I fix this product-display issue in above described development configuration, please?

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bojanz’s picture

Title:admin/commerce/config/types/content/add» Document "MySQL server has gone away" error (usual to MAMP)
Version:7.x-2.0-rc1» 7.x-2.x-dev
Assigned:Unassigned» joshmiller
Category:support» task
Status:Closed (fixed)» Active

We should document this.

There's more usable info (instructions) in here: http://drupal.org/node/1794050

jebernier’s picture

"For users of MAMP PRO edit the my.cnf template file"

any idea where this file is? I can't seem to find it.

Thanks-in-Advance,

John

odyseg’s picture

just as I thought.. thanks!

klausi’s picture

Status:Active» Fixed

We already have that doc page: http://drupal.org/node/259580

Please add any MAMP specific stuff there.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kbrinner’s picture

For MAMP Pro users, stop your server, then go to File -> Edit Template -> my.cnf, and edit max_allowed_packet = 100M
Save (command S) and then start your server again.

valeriap’s picture

Thanks a lot. I see this is an old post, but I want to thank you anyway because I was getting crazy.
I was going to blame the Drupal requirements documentation, but Indeed the recommendation is also in the Drupal database requirements page: http://drupal.org/requirements/database.
Thanks!

tasetta’s picture

Hi, using MAMP here, stuck with MySQL server has gone away error, and I cannot figure out where to find my.cnf.
File -> Edit Template -> is where? should I find it inside the ecommerce kickstart installation files or within the MAMP files?

tasetta’s picture

Hi, using MAMP here, stuck with MySQL server has gone away error, and I cannot figure out where to find my.cnf.
File -> Edit Template -> is where? should I find it inside the ecommerce kickstart installation files or within the MAMP files?

DamienMcKenna’s picture

@tasetta: Don't be afraid to use Google for these generic MySQL questions ;-) This page on StackOverflow has some good info on the steps you need to take to set up a my.cnf file on the non-Pro version of MAMP: http://stackoverflow.com/questions/678645/does-mysql-included-with-mamp-...

knalstaaf’s picture

@tasseta:

  1. Copy one of the sample files, my-small.cnf or my-medium.cnf (usually located in MAMP/Library/support-files) and save it to MAMP/conf/my.cnf
  2. Then increase the max_allowed_packet variable in MySQL by adding the following line to my.cnf:
    max_allowed_packet = 100M (around line 30 of that file this should already be provided, be it with a lower value)
  3. Then restart the MySQL Server to pickup the configuration.

Source 1
Source 2

dpimatrix’s picture

I had to increase mine to 200M for it to work.

fyberoptik’s picture

Big thanks! @knalstaaf

#17 works for me!