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.

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

Postby ojsnewbie » Wed Jul 10, 2013 6:18 pm

I am getting the above error when attempting to get OJS running on our public facing website.

This error only occurs after arriving to the on any page within the OJS application and attempting to go to another part of the application (any other part of the website).
After looking online for a solution to the issue the closest I could find was a forum post from one of the developers indicating that it is a platform configuration issue (viewtopic.php?f=8&t=6969&start=15#p32181)

I have tried emptying the 'Session' table in the OJS DB in MySQL but this does not resolve the issue.
This is not an upgrade. This is a fresh install.
I have installed using the exact same steps on an Ubuntu LAMP install and it works without this error.
The Session variables shown in PHPinfo() line up with whats required (MD5 enabled and used)

I have searched this forum and tried everything I could sans editing the apache/PHP configuration which I do not have access to. I have asked our IT department who run the server about this issue but without more information they are unable to help.

Here is a stack trace from OJS (running with debug=On):

Code: Select all
(mysql): select version() 
(mysql): INSERT INTO sessions (session_id, ip_address, user_agent, created, last_used, remember, data) VALUES ('2201hqlbvqjg556dkqogpia1i3', '10.80.170.231', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36', 1373439781, 1373439781, 0, '') 
1062: Duplicate entry '2201hqlbvqjg556dkqogpia1i3' for key 'sessions_pkey'
                        ADOConnection._Execute(INSERT INTO sessions
            (session_id, ip_address, user_agent, created, last_used, remember, data)
            VALUES
            ('2201hqlbvqjg5...) % line  845, file: adodb.inc.php
                     ADOConnection.Execute(INSERT INTO sessions
            (session_id, ip_address, user_agent, created, last_used, remember, data)
            VALUES
            (?, ?, ?, ?, ?,..., Array[7]) % line  225, file: DAO.inc.php
                  DAO.update(INSERT INTO sessions
            (session_id, ip_address, user_agent, created, last_used, remember, data)
            VALUES
            (?, ?, ?, ?, ?,..., Array[7]) % line   85, file: SessionDAO.inc.php
               SessionDAO.insertSession(Object:Session) % line   80, file: SessionManager.inc.php
            SessionManager.SessionManager(Object:SessionDAO, Object:Request) % line  112, file: SessionManager.inc.php
DB Error: Duplicate entry '2201hqlbvqjg556dkqogpia1i3' for key 'sessions_pkey'


I am unsure what else I can try here to get this working on our webserver (the LAMP install is not an option for use). Any help would be appreciated
Thank you
ojsnewbie
 
Posts: 5
Joined: Wed Jul 10, 2013 6:04 pm

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

Postby asmecher » Wed Jul 10, 2013 9:04 pm

Hi ojsnewbie,

Check your server's phpinfo to see if you're running APC; if you are, consider applying the patch at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8151 or disabling it for OJS.

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

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

Postby ojsnewbie » Wed Jul 10, 2013 10:35 pm

Hi Alec,

Thanks for your reply. I have checked for the APC module in apache but could not find it. Just in case I missed it I tried out the patch but it didn't resolve the problem.
Might it be easier if I message the output of PHPinfo() to you? You may have luck in finding what may be the issue then.

Regards,
Adam
ojsnewbie
 
Posts: 5
Joined: Wed Jul 10, 2013 6:04 pm

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

Postby asmecher » Thu Jul 11, 2013 1:07 pm

Hi Adam,

Hmm, APC doesn't seem to be the problem. Have you checked your error log to see if there are any relevant entries there?

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

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

Postby ojsnewbie » Thu Jul 11, 2013 4:25 pm

Hi Alec,

I checked the web server logs but there are no errors there. The only output I get is from the stack trace as per the first post.

Regards,
Adam
ojsnewbie
 
Posts: 5
Joined: Wed Jul 10, 2013 6:04 pm

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

Postby ojsnewbie » Sun Jul 14, 2013 6:43 pm

Hi Alec,

I think the only thing I can do is to try copying the Apache/PHP configurations over to the LAMP server one by one and try isolate which thing exactly is causing this.
Any recommendations on which part of the configuration would be the best to start?

Regards,
Adam
ojsnewbie
 
Posts: 5
Joined: Wed Jul 10, 2013 6:04 pm

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

Postby ojsnewbie » Tue Jul 30, 2013 7:34 pm

For anyone out there who also has this issue, we were not able to solve it on this webserver and ended up setting it up on a server with a more vanilla install on Apache, PHP etc...

The closest we got to the source of the issue was this:
  • Go to OJS site
  • A session was created under the generic session name (in out case "PHPSESSID"), this seemed to occur upon hitting any part of OJS in a browser
  • The OJS application then seemed to go through the setting up of a session from scratch after the above is done, this includes creating another session with the session name being used in the config.inc.php
  • The OJS application gets confused between sessions (not sure on the specifics but an attempt to insert the session twice is done which causes the error

The server also uses Shibboleth so this may be a cause but we could not work out anything specific and disabling Shibboleth was not an option due to the server being used by groups other than us.
ojsnewbie
 
Posts: 5
Joined: Wed Jul 10, 2013 6:04 pm

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

Postby paris » Wed Aug 14, 2013 12:15 pm

Hi!

I'm getting these very same error, i.e. a very fresh install, and just after installation is complete, and click on any link and i get the error. I test ojs 2.4.1 and 2.4.2, on Apache 2.2.22, PHP 5.3.17 and MariaDB 5.5.29 all in a openSUSE 12.3 server. I'm willing to give you access to my server in order to debug helping.
paris
 
Posts: 1
Joined: Wed Aug 14, 2013 12:04 pm

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

Postby asmecher » Thu Aug 15, 2013 10:16 am

Hi paris,

Please PM me with details.

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

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

Postby erajabi » Thu Sep 05, 2013 8:25 am

Hi there,

I installed new version of OJS on opensuse 11, and I got the following error. Please help

DB Error: Duplicate entry '3655r4hmshquon3kau185nklvi677gipjlhijfdc' for key 'sessions_pkey'
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

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

Postby asmecher » Thu Sep 05, 2013 8:47 am

Hi erajabi,

There are lots of threads about this issue in the forum. Please review them, try some of the suggestions, and report back here with the results before we debug further.

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

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

Postby erajabi » Mon Sep 09, 2013 7:35 am

Hi Alec,

Thanks for your answer. I checked them and wrote my problem here. Please tell me, should the server administrator change something on the server and php setting or I can fix this issue in the database or application side?

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

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

Postby asmecher » Mon Sep 09, 2013 8:20 am

Hi erajabi,

What have you tried, and what were the results?

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

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

Postby erajabi » Mon Sep 09, 2013 2:18 pm

Hi Alec,

Let me explain what happens:
After setting up the installation page, the page says: the OJS has been set up successfully, then I want to log in, but the error comes up. I realized that after installation page, when I click each link (e.g., about, home, ...) this error is shown. I cleaned all the tables, recreated the database, the app but the same happens.
I disabled this line in configuration file (session_cookie_name = OJSSID) , but I couldn't log in. I know there is something related to session but I don't know where I should set.

Thanks in advance,
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

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

Postby asmecher » Mon Sep 09, 2013 4:08 pm

Hi erajabi,

Have you checked your PHP configuration e.g. as described here?

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

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests

cron