Zen Cart Logo
Forums / Installing on a Mac Server / Duplicate entry error on sessions table with new install on Mountain Lion Server

Duplicate entry error on sessions table with new install on Mountain Lion Server

Views: 19,807

Results 1 to 5 of 5
27 Jan 2013, 3:26 AM
#1
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Duplicate entry error on sessions table with new install on Mountain Lion Server

Hey gang,

I've been working with a test Mountain Lion Server building a new zencart site. Everything is ready to go, so I starting setting up my MacPro with another ML Server 10.8.2 to run the live site.

Multiple issues today:

  1. After installing mySQL 5.5.29 community edition (test server used 5.5.14), I opened myphpadmin and setup my database for installing ZenCart.
    Upon Zencart installation, the database wouldn't install at all over localhost or the external ip address (even though myphpadmin IS accessing with localhost!!). Multi-checked everything and all was perfect in the mySQL setup, user and password.

Finally, the ONLY way the database would install is over a host of: 127.0.0.1.

Then continued the install until everything was completed.

The customer side of ZenCart came up perfectly. :-)

BUT

  1. Now, I cannot log into the admin with the user I created after the admin folder name was changed and ZC folder deleted. Tried and tried to no avail today. I reinstalled many times from scratch even deleting the mysql database and reinstalling all the apps.

WARNING: An Error occurred, please refresh the page and try again.

Here is the log file I received when I tried to log into the admin:

[27-Jan-2013 03:05:24 UTC] PHP Fatal error: 1062:Duplicate entry 'clmt7v4rkh46cufufqm5jq4kca7vm77c0p0k4t2v4ctgpill8e8eut6jug1jlrgr' for key 'PRIMARY' :: insert into sessions
values ('clmt7v4rkh46cufufqm5jq4kca7vm77c0p0k4t2v4ctgpill8e8eut6jug1jlrgr9ldhmcraptlmdo12jput8i4i18t3pnhr2h1nic1', '1359256824', 'c2VjdXJpdHlUb2tlbnxzOjMyOiIzYmRmYzE5ZDIzOTc2MjQyYWJiYTA4NTY4M2M2ZWQ0NiI7bGFuZ3VhZ2V8czo3OiJlbmdsaXNoIjtsYW5ndWFnZXNfaWR8czoxOiIxIjtsYW5ndWFnZXNfY29kZXxzOjI6ImVuIjtzZWxlY3RlZF9ib3h8czoxMzoiY29uZmlndXJhdGlvbiI7aHRtbF9lZGl0b3JfcHJlZmVyZW5jZV9zdGF0dXN8czo0OiJOT05FIjs=') in /Users/Shared/websites/zen-cart-v1.5.1/includes/classes/db/mysql/query_factory.php on line 120

Guys.... I lost on this. I have 2 other computers running ZenCart, but this OSX server will not install correctly. Those other 2 work perfectly under localhost, which makes this even more strange.
Any ideas?

I can't figure out if the OSX install is 'wonky' or if it's the newer version of mySQL or something else.

thanks everyone,

Jeff Michaels,
musicalcreations.com

27 Jan 2013, 3:38 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Duplicate entry error on sessions table with new install on Mountain Lion Server

What's the PHP version?
What are the following values set to in your php.ini?
session.hash_bits_per_character
session.hash_function

Zen Cart v1.5.1 and older were built based on the common configuration of:
session.hash_function = 1

Change yours back to 1 if you can.

If that's been set to something different (and newer PHP versions are starting to change that), then you may have problems. Reverting it back to 1 may provide relief for now. While you should have no problem reverting it when you're the server administrator, if you can't then you may need to change the code.

27 Jan 2013, 4:18 AM
#3
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Duplicate entry error on sessions table with new install on Mountain Lion Server

PHP - 5.3.15

; session.hash_bits_per_character
; Default Value: 4
; Development Value: 5
; Production Value: 5

; http://php.net/session.hash-function
session.hash_function = sha512

27 Jan 2013, 4:37 AM
#4
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Duplicate entry error on sessions table with new install on Mountain Lion Server

I got it

; http://php.net/session.hash-function
session.hash_function = sha512

I compared the other test server and it was

; http://php.net/session.hash-function
session.hash_function = 1

I changed it to 1 and immediately, the admin worked after I restarted the web server. But I still have no idea why I cannot use localhost in the setup. hmmm
Any ideas?

26 Mar 2013, 7:37 AM
#5
twleblanc avatar

twleblanc

New Zenner

Join Date:
Mar 2013
Location:
California, United States
Posts:
1
Plugin Contributions:
0

Re: Duplicate entry error on sessions table with new install on Mountain Lion Server

The error I was getting was:
[24-Mar-2013 08:42:55 UTC] PHP Fatal error: 1406: Data too long for column 'sesskey' at row 1 :: insert into sessions
values ('nj2j28msme7fprpl1qhkoq1qrrr5ks2qs1o2av2p64ea2f7amvk86s9gnoc8a6kd3mloff53pri3vc8kf2jtlts4ophcaidhovbo240', '1364116015', 'c2V snip CI7') in /Library/Server/Web/Data/Sites/www.craftyharp.local/includes/classes/db/mysql/query_factory.php on line 120

Editing the php.ini file and setting the session.hash_function = 1 fixed the problem for me as well!