Error: Duplicate entry '1-' for key 'whosonline'

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
dips045
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jan 16, 2014 8:37 pm

Error: Duplicate entry '1-' for key 'whosonline'

Post by dips045 » Thu Jan 16, 2014 8:41 pm

HI everyone

I just tried to log into joomla admin to find an error

Duplicate entry '1-' for key 'whosonline' SQL=INSERT INTO

Non of the pages are working.

The website hasn't been moved or anything, everything was working fine when I logged in last.

What has caused this error? How can I fix it?

Hope someone can help me.

Many thanks

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Thu Jan 16, 2014 11:36 pm

Backup your database then try doing a repair and optimize on your database and see if that helps. If you do not know how ask your Host to do it.

dips045
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jan 16, 2014 8:37 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dips045 » Fri Jan 17, 2014 7:56 am

Many thanks. I will do. What causes this error? Or does it just happen?

dips045
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jan 16, 2014 8:37 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dips045 » Fri Jan 17, 2014 11:16 am

Many thanks for your help repair and optimize did the trick!

Thanks again

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Fri Jan 17, 2014 6:38 pm

Don't know what caused it, sometimes files can become corrupt on a server too. Probably bad sectors on the drive. Glad you were able to fix it. :)

User avatar
TheWebGuy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Wed Oct 03, 2007 10:39 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by TheWebGuy » Thu Feb 06, 2014 12:46 am

I would like to know the cause of this error as it appears I have the same issue:

Duplicate entry '1-' for key 'whosonline' SQL=INSERT INTO `web_session` (`session_id`, `client_id`, `time`) VALUES ('230ed55f2a435a2329813d323e2c4985', 0, '1391633281')

This issue only arises when I have a certain surge in traffic due to advertising (like over 500 visitors at one time).

I know I can go into the database through phpadmin and do table web_session repair to put my site back up. But that is not the solution to the actual cause of the issue. It is only a band-aid.

Does anyone know what actually causes this to happen and how to fix it so it never happens?

I have spent the last week researching this issue and all I've seen is "How to repair"
I need to know how to stop this from happening.

Please, I would appreciate any advice on this issue, anyone?
I know it's better to teach a man to fish...but if that man is starving, he'll die before he catches a fish. So do him a favor, feed him first...then teach him to fish.

agmnet
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Dec 18, 2009 8:11 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by agmnet » Sat Mar 22, 2014 12:13 pm

I have the same problem, sometimes in 'whosonline' and sometimes 'sessions' tables.
Every time i need to empty the tables and repair database!
any help with this issue!

hubukai
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Oct 19, 2008 3:48 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by hubukai » Wed Sep 03, 2014 7:08 pm

We are having a similar issue on one of our sites. Exact same thing. Has anyone ever come up with a WHY it happens and a permanent fix?

wilibar
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Mar 20, 2007 11:30 pm
Location: USA, Miami, FL

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by wilibar » Mon Sep 22, 2014 4:38 pm

I just had the same issue with my site. The backup and repair fixed this issue but this can cause my site to go down anytime. I've had no luck yet with finding the cause of this issue.

Jonek
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Nov 20, 2014 3:52 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Jonek » Thu Nov 20, 2014 3:57 pm

Hello, Ive got the same problem:
Duplicate entry '1-' for key 'whosonline' SQL=INSERT INTO `api8o_session` (`session_id`, `client_id`, `time`) VALUES ('7m3500eqb1897ngoh7c7689ic4', 0, '1416498649')
Google said that I should clear, repair and optimise the table "session", but it does not work for me.

How do I update joomla when administrator panel does not work? <the same problem>
Is there any other solution?
Jonek

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Per Yngve Berg » Thu Nov 20, 2014 5:05 pm

The database must be repaired in a database administration tool like phpmyadmin.

Note: Joomla 1.5 went EOL several years ago and there are no more updates for it.

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Thu Nov 20, 2014 6:40 pm

To clear the table run this in a query window

truncate table api8o_session

This will remove any data from the table, then try a repair and optimize on it.

Jonek
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Nov 20, 2014 3:52 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Jonek » Thu Nov 20, 2014 7:51 pm

Hello, thanks for your replies.

I used phpmyadmin to delete data from table(earlier).
I just cleared that table once again, just like dpacadmin suggested, but again - no difference.
Im totally new in joomla and databases and the site is down for 3 days, so ill be grateful if you could help me.

Some more information:
1. In my phpmyadmin I see red error on the bottom the screen, it says:
"Połączenie dla użytkownika kontrolnego zdefiniowanego w pliku konfiguracyjnym nie powiodło się."
which, I think, in English means:
"Connection for control user defined in configuration file didnt succeed.
2. The site worked well for a looong time, then it went down cos of some filesystem problems and got recovered from backup (10 days earlier). The site worked fine for a few hours, and then went down with message I posted earlier.

If u need any other info, tell me, Im kinda desperate now.
Thanks
Jonek

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Per Yngve Berg » Thu Nov 20, 2014 8:05 pm

In Phpmyadmin, select the table api8o_session and do the "Repair" Command.

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Thu Nov 20, 2014 8:10 pm

You have not provided a url to the problem site.
In the error message you posted I see this is being added to the table;
"whosonline"
this is not part of the default Joomla 1.5 session table. I would guess you have a plugin or extension adding this to the table. It would seem whatever is adding it is the cause of the crash. If you can determine what is adding it you can disable it in the "_plugins" table by setting published to "0"(zero). If it is a component you will need to set enabled to 0 for that component in the "_components" table.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Per Yngve Berg » Thu Nov 20, 2014 8:20 pm

"whosonline" is a index key on the core #_session table. Only the Primary Key should be Unique.
The indexes "whosonline", "userid" and "time" shall not be unique.

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Thu Nov 20, 2014 9:05 pm

Hi Per Yngve Berg,
I'm not good enough with SQL to know how keys work, so you are saying something is trying to save a cookie with the whoisonline data to the session table? Do you know if this is a Joomla 1.5 function or part of a plugin or added extension? Will disabling it stop the error?

Jonek
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Nov 20, 2014 3:52 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Jonek » Thu Nov 20, 2014 9:56 pm

I disabled the extension <didnt help>
Ive found this entry in api8o_extensions:
http://imgur.com/d7LMXl1
manifest_cache: <dont know if it will help>
{"legacy":false,"name":"mod_whosonline","type":"module","creationDate":"July 2004","author":"Joomla! Project","copyright":"Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.","authorEmail":"[email protected]","authorUrl":"www.joomla.org","version":"2.5.0","description":"MOD_WHOSONLINE_XML_DESCRIPTION","group":""}

User avatar
dpacadmin
Joomla! Champion
Joomla! Champion
Posts: 6029
Joined: Sat Aug 16, 2008 1:46 pm
Location: the Bat Cave
Contact:

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by dpacadmin » Fri Nov 21, 2014 12:25 am

If you have a Joomla 1.5 install it could be that the database got mixed up with another Joomla 2.5 or 3 site. Since Joomla 1.5 doesn't have an extensions table but 2.5 and 3 do you should try posting in the 2.5 or 3 forum. They may have already found a fix for your error.

Jonek
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Nov 20, 2014 3:52 pm

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Jonek » Fri Nov 21, 2014 10:29 am

Ye, Im sorry, but im not sure which joomla version I do have ^^" how can I check it if the site is down? Ive got access to VPS server root if neccessary.
<the site worked well for... 3 or 4 years on this configuration>
No other ideas guys?:)

#EDIT:
Ive found readme file on my server which starts from:
1- What is this?
* This is a Joomla! installation/upgrade package to version 2.5.x
So im omw to Joomla 2.5 forum. Thanks guys for your help!

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Error: Duplicate entry '1-' for key 'whosonline'

Post by Per Yngve Berg » Fri Nov 21, 2014 5:01 pm

You cannot upgrade from 1.5 to 2.5 with an upgrade package. Data have to be migrated from the 1.5 install to the 2.5 install using the extension SPUpgrade, Jupgrade or J2XML.


Locked

Return to “General Questions/New to Joomla! 1.5”