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 » Tue Sep 10, 2013 5:14 am

Dear Alec,

I don't have access to the php.ini as I am not the administrator. I am running the OJS on the server.
I had a try to change the session_id field to autoincremental in the database and the error was disappeared.
Do you think this approach works? Does it affect to other parts of the application.

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

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

Postby asmecher » Tue Sep 10, 2013 8:01 am

Hi erajabi,

No, setting the session_id to auto_increment won't work; it's not supposed to be numeric.

Even if you can't change the php.ini configuration, you can read it; see e.g. the phpinfo() function.

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

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

Postby erajabi » Sat Sep 28, 2013 6:46 am

Hi Alec,
This is my configuration. I still have the problem:
DB Error: Duplicate entry 'ep923rgp5u9ccuhnuehs13fbp3u8bcndsblb2mpb' for key 'sessions_pkey'

--------------------------------
session.use_cookies=1
session.use_only_cookies=1
session.name=OJSSID
session.auto_start=0
session.cookie_lifetime=0
session.cookie_path=/fitispos_ij/OJS/ojs-2.4.2/
session.cookie_domain=
session.cookie_httponly=
rsession.cookie_httponly=php
session.gc_probability=1
session.gc_divisor=1000
session.gc_maxlifetime=3600
session.bug_compat_42=Off
session.bug_compat_warn=Off
session.referer_check=
session.entropy_length=32
session.entropy_file=/dev/urandom
session.cache_limiter=none
session.cache_expire=180
session.use_trans_sid=0
session.hash_function=sha256
session.hash_bits_per_character=5
------------------------------------------
Regards,
erajabi
 
Posts: 20
Joined: Thu Sep 05, 2013 8:18 am

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

Postby erajabi » Sat Sep 28, 2013 10:59 am

Hi Alec,

I forgot to mention the server configuration. This may help:
------------------------------------------
this is the server configuration:
System version Linux 2.6.37.6-0.7-desktop
PHP version PHP 5.3.17
Mysql version 5.1.53-log
Apache version Apache/2.2.17 (Linux/SUSE)
------------------------------------

Thanks,
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 30, 2013 3:27 pm

Hi erajabi,

Does your server use APC? If so, see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8151.

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

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

Postby erajabi » Thu Oct 03, 2013 1:31 am

Hi Alec,

If so, what should I do? Should I apply a patch to the OJS?
Should I request them to disable it?...

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 03, 2013 8:36 am

Hi Enayat,

Yes, if so, you can apply https://github.com/pkp/pkp-lib/commit/8fda4d6c6facaac21afac4bd3e76ef2a4a8b7f2b.diff from the lib/pkp subdirectory.

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

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

Postby erajabi » Mon Oct 14, 2013 4:30 am

Hi Alec,

It didn't worked. The site administrator didn't reply me regarding the using APC and I don't know how to apply the patch. I just add the lines to the right place in session_manager.php. The problem still exists. I used another browser, but it gives me the same error. I changed the session_id field to INT (but not incremental as you mentioned), but the problem changes. First I can not login, but in the second or third time it logs in. It is weird.
I guess it may be due to some restrictions, isn't it? as I don't get such error when I install the ojs on my local machine.
Hope I could explain the situation well.

Kind 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 » Tue Oct 15, 2013 9:42 am

Hi Enayat,

Please revert any changes you made to the sessions table -- this is not numeric data and going to an INT is not going to work.

If you haven't yet, try disabling the session_check_ip setting in config.inc.php.

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

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

Postby erajabi » Wed Oct 16, 2013 7:15 am

Hi Alec,

I think it has already disabled. --> session_check_ip = Off
Isn't it?

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 » Wed Oct 16, 2013 9:39 am

Hi Enayat,

If that's in your config.inc.php, then yes, it's disabled.

Can you describe what you did to apply the APC patch? And any other modifications you've made? Please be specific.

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

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

Postby erajabi » Thu Oct 17, 2013 4:46 am

Hi Alec,

I try to be specific according on my knowledge. This is all I have done:
- First I should mention that I don't have the problem on my localhost, so definitely it is referred to server's configuration.
- I copied the OJS 2.4.2 on server.
- I made the mentioned folders (chache,...) rewritable from the ftp panel.
- I viewed the installation page and I configured the settings as I have done on my local system. Tried to keep default as it has been mentioned in the installation.
- When I wanted to login the the duplicate error came out.
- With init_set command, I made all the corrections that you told (e.g., auto_start, ...). I copied the setting in the forum.
- When I didn't get any response, I changed the session_id in the session table to INT. Now it works but with some problems. Whenever I try login with a new browser (without cache) the problem "DB Error: Duplicate entry 0 for key 'sessions_pkey'" comes, and if I refresh it goes the related page. This happens for each user login.
- I also added the line in the patch to session_manager.php, but it didn't work too.

Hope I clarified the situation.
Thanks in advance for your help,
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 17, 2013 10:18 am

Hi Enayat,

As I already said, you'll need to revert the changes you made to the sessions table.

There's no session_manager.php file in the distribution.

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

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

Postby erajabi » Mon Oct 21, 2013 4:17 am

Hi Alec,

It is very weird to me that you tell me to revert the sessions table to the previous one while you don't give me any solution. If I change the session_id to VARCHAR, I can not login! and there will be Duplicate entry 'XXXX' error!
Besides, the mentioned file exists at : ojs-2.4.2/lib/pkp/classes/session/SessionManager.inc.php in the distribution.

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 » Mon Oct 21, 2013 9:01 am

Hi Enayat,

"session_manager.php" is not the same thing as "SessionManager.inc.php".

Changing session_id to INT, disabling session_cookie_name in your configuration file, etc., are sure to break the system in unpredictable ways. It will be impossible for me to debug remotely with random changes like these in place. I would suggest starting with a fresh installation (unpacked fresh from the .tar.gz and then used to create a new database), disabling session_check_ip in config.inc.php, applying the patch for APC, and then working logically on debugging from there if those haven't solved the problem.

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

PreviousNext

Return to OJS Technical Support

Who is online

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