Title: WordPress database error Duplicate entry
Last modified: August 21, 2016

---

# WordPress database error Duplicate entry

 *  Resolved [Alternatewords](https://wordpress.org/support/users/alternatewords/)
 * (@alternatewords)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/)
 * I noticed when standard report 2 (Users: Directory) refreshes I see the following
   lines pop up in my error_log:
 *     ```
       WordPress database error Duplicate entry 'user-02-0' for key 'reportid' for query INSERT INTO wp_amr_reportcache ( reportid, line, csvcontent ) VALUES ('user-02','0','ID,avatar,display_name,user_url,user_registered') made by do_action_ref_array, call_user_func_array, amr_build_user_data_maybe_cache, adb_cache->cache_report_line
   
       WordPress database error Duplicate entry 'user-02-1' for key 'reportid' for query INSERT INTO wp_amr_reportcache ( reportid, line, csvcontent ) VALUES ('user-02','1','\"ID\",\"Avatar\",\"Display Name\",\"Url\",\"Registered days ago\"') made by do_action_ref_array, call_user_func_array, amr_build_user_data_maybe_cache, adb_cache->cache_report_line
   
       WordPress database error Duplicate entry 'user-02-2' for key 'reportid' for query INSERT INTO wp_amr_reportcache ( reportid, line, csvcontent ) VALUES ('user-02',2, ......') made by do_action_ref_array, call_user_func_array, amr_build_user_data_maybe_cache, adb_cache->cache_report_lines, adb_cache->cache_batch_lines
       ```
   
 * Would this be due to some users having the same display name?
 * [http://wordpress.org/plugins/amr-users/](http://wordpress.org/plugins/amr-users/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/#post-4274455)
 * hi – sounds like it is trying to recache but a delete of the cache has not happened.
   Maybe you had a database error?
    goto cache settings and clear all cache entries.
 * I also suggest llogging into your phpmyadmin and seeing if you have any ‘repair’
   flags on the cache tables etc.
 *  Thread Starter [Alternatewords](https://wordpress.org/support/users/alternatewords/)
 * (@alternatewords)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/#post-4274456)
 * I think this may have been due to having amr users installed in the past and 
   having done a manual cleanup after removal. I noticed when I installed it again
   a few days ago it found my old reports but threw some error messages as they 
   actually no longer existed in the db.
 * I’ve followed your recommendations and that seems to have solved the problem.
 * Thank you.
 *  Thread Starter [Alternatewords](https://wordpress.org/support/users/alternatewords/)
 * (@alternatewords)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/#post-4274499)
 * Spoken too soon it seems. When I deleted the cache and manually triggered a rebuild
   everything worked fine, no errors in error_log.
 * But, the automatic refreshes keep triggering the duplicate entry error. For now
   I’ve switched from ‘Do re-cache on user update’ to ‘Do NOT re-cache on user update’
   to see if that might be the problem (we have quite a lot of user signing up on
   our site).
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/#post-4274503)
 * Yeah – good idea – there is logic to NOT do recache immediately – first check
   if one already in progress etc . But better not to have load on system if you
   have a lot of signups.
 * Am working towards a non-cahce method – but that only works efficiently for ‘
   clean’ user meta fields (not S2, not cimy etc etc)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WordPress database error Duplicate entry’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amr-users_f6f6f4.svg)
 * [amr users](https://wordpress.org/plugins/amr-users/)
 * [Support Threads](https://wordpress.org/support/plugin/amr-users/)
 * [Active Topics](https://wordpress.org/support/plugin/amr-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amr-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amr-users/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [anmari](https://wordpress.org/support/users/anmari/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-2/#post-4274503)
 * Status: resolved