OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Postby erajabi » Thu Oct 24, 2013 2:51 am

Hi Alec,

So please tell me: Should the server administrator change something from the server side? for instance in the php.ini or something like that?
I want to inform them if something should be changed from their side?

Regards,
Enayat
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

Re: DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Postby asmecher » Thu Oct 24, 2013 9:08 am

Hi Enayat,

It's not clear to me yet what, if anything, needs to be changed by the administrator. If you start with my instructions at http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=10232&start=15#p42044, I can walk you through some further debugging.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7705
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Postby erajabi » Thu Oct 31, 2013 4:35 am

Hi Alec,

Ok, I did as you mentioned. New install of application and new DB have been done! ( the patch has been also applied)
I didn't touch anything in the database, the error comes up when I log in:
DB Error: Duplicate entry 'qqk5es9r49vpg1fao9oek0b5jpus46h657pqjpge' for key 'sessions_pkey'

What is next step?

Regards,
Enayat
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

Re: DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Postby erajabi » Thu Oct 31, 2013 7:36 am

Hi Alec,

I have good news. Yesterday I received the php.ini from our server administrator and I created a mirror of application on another server. When facing the error, I tried to tested the forum solutions on the php.ini one by one and realized that the problem is solved if I change session.hash_function = sha256 to session.hash_function = 1 (as my ojs encryption is sha1, it should be changed to 0 if the encryption is md5).

I think the error would be removed if this variable is changed on the real server.

Thanks for your help and support,
Enayat
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

Re: DB Error: Duplicate entry 'XXXX' for key 'sessions_pkey'

Postby asmecher » Thu Oct 31, 2013 10:27 am

Hi Enayat,

The standard session hash functions generate session IDs with lengths described at http://stackoverflow.com/questions/12240922/what-is-the-length-of-a-php-session-id-string (typically 27, 32, and 40 characters). If you're using one of the hash extensions in your php.ini, it's possible that a longer ID is being generated, potentially resulting in collisions. If that's the case, you can extend the length of the session_id column of the "sessions" table to suit.

Thanks for staying with this.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7705
Joined: Wed Aug 10, 2005 12:56 pm

Previous

Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron