Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#324 closed bug (fixed)

guestsonline table makes SQL errors on mainpage

Reported by: lemon-head Owned by: jeanyves
Priority: major Milestone: 0.1.4
Component: BW General Keywords: whoisonline
Cc: jeanyves

Description

This error is not easy to reproduce! Still it's a good idea to take it as a hint, and will help to keep the code clean.

It happened to me on production.

1000 MySQL error! /home/bwrox/www.bewelcome.org/lib/db/db_statement_mysql.lib.php 285 Statement: INSERT INTO guestsonline (IpGuest, appearance, lastactivity) VALUES(1413445460, '84.63.119.84', 'www.bewelcome.org /index.php') 1062 Duplicate entry '1413445460' for key 1 /home/bwrox/www.bewelcome.org/lib/db/db_mysql.lib.php 299 PDBStatement_mysql query INSERT INTO guestsonline (IpGuest, appearance, lastactivity) VALUES(1413445460, '84.63.119.84', 'www.bewelcome.org /index.php') /home/bwrox/www.bewelcome.org/modules/user/lib/user.lib.php 361 PDB_mysql query INSERT INTO guestsonline (IpGuest, appearance, lastactivity) VALUES(1413445460, '84.63.119.84', 'www.bewelcome.org /index.php') /home/bwrox/www.bewelcome.org/build/rox/rox.ctrl.php 60 MOD_user updateDatabaseOnlineCounter /home/bwrox/www.bewelcome.org/htdocs/index.php 114 RoxController __construct

Change History (7)

comment:1 Changed 9 years ago by lemon-head

(using Opera).

page refresh solved the problem (for me).

comment:2 Changed 9 years ago by lemon-head

  • Summary changed from strange sql error on mainpage to strange sql error on mainpage (guestsonline table)

comment:3 Changed 9 years ago by lemon-head

  • Cc jeanyves added
  • Priority changed from minor to major

This is a nasty bug that is popping up more often.

comment:4 Changed 9 years ago by lemon-head

  • Summary changed from strange sql error on mainpage (guestsonline table) to guestsonline table makes SQL errors on mainpage

comment:5 Changed 9 years ago by jeanyves

  • follow_up changed from none to test on alpha
  • freq_reported set to 1
  • Keywords whoisonline added
  • Owner set to jeanyves
  • show_on_bw set to 0
  • Status changed from new to assigned

Two changes :

To fix it I replaced the INSERT by a REPLACE, this avoid primary keys conflicts

and I Improve the primary key in order to allow to make a bit of distinction with several users who will use the same ip but a different navigator, it now does'nt only consider the IP.
I put it in alpha, but I think it is allready ready for production

comment:6 Changed 9 years ago by jeanyves

  • follow_up changed from test on alpha to release
  • Resolution set to fixed
  • Status changed from assigned to closed

10 days and I have not seen it again. I close the ticket. user.lib.php is in production

comment:7 Changed 9 years ago by micha

  • follow_up changed from release to none
Note: See TracTickets for help on using tickets.