• Resolved jatacid

    (@jatacid)


    I have this kind of error on nearly all of my websites.

    [30-Apr-2016 10:55:36 UTC] WordPress database error Duplicate entry ‘2016-05-01’ for key ‘unique_date’ for query INSERT INTO bwp_statistics_visit (last_visit, last_counter, visit) VALUES ( ”, ‘2016-05-01’, 0) made by do_action_ref_array, call_user_func_array, wp_statistics_add_visit_event

    Any ideas?

    https://www.ads-software.com/plugins/wp-statistics/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Greg Ross

    (@gregross)

    It’s caused by a race condition in the code, it’s safe to ignore (it shouldn’t be labled as an error really, but we can’t control that).

    It happens when a new day starts and two visitors hit the site at nearly the same time for the first visit of the day. Both try and create a new row in the table to track the days visits, but only one of them success and the other throws this warning.

    Thread Starter jatacid

    (@jatacid)

    Ah interesting!

    I wonder if you could do a catch into a cache file and then put it into memory after the time has passed?

    Plugin Contributor Greg Ross

    (@gregross)

    No, because we may be running on multiple nodes in a server farm and not have access to shared storage.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lots of database entry errors’ is closed to new replies.