Title: Errors in Postmeta line in database
Last modified: September 5, 2023

---

# Errors in Postmeta line in database

 *  [andy1pitt](https://wordpress.org/support/users/andy1pitt/)
 * (@andy1pitt)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/errors-in-postmeta-line-in-database/)
 * I cannot update or change my event plugin because from looking at the debug log,
   I think there is a database error. Site functions normally except for this issue.
 * Here is the lines from my debug log
 * [05-Sep-2023 19:09:17 UTC] WordPress database error Duplicate entry ‘0’ for key‘
   PRIMARY’ for query INSERT INTO `wp_0d4by0kan6_postmeta` (`post_id`, `meta_key`,`
   meta_value`) VALUES (242, ‘_tribe_modified_fields’, ‘a:1:{s:10:\”_edit_last\”;
   i:1693940957;}’) made by edit_post, update_post_meta, update_metadata, apply_filters(‘
   update_post_metadata’), WP_Hook->apply_filters, Tribe__Tracker->filter_watch_updated_meta,
   update_post_meta, update_metadata, add_metadata
   [05-Sep-2023 19:09:17 UTC] WordPress
   database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO `wp_0d4by0kan6_postmeta`(`
   post_id`, `meta_key`, `meta_value`) VALUES (242, ‘_edit_last’, ‘1’) made by edit_post,
   update_post_meta, update_metadata, add_metadata
 * I get a bunch of these that look similar.
 * Thanks in advance for your help.

Viewing 1 replies (of 1 total)

 *  [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * (@alanfuller)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/errors-in-postmeta-line-in-database/#post-17028572)
 * OK sound like AUTO INCREMENT has been lost. I have seen this before but not sure
   exactly what caused it, maybe a bad migration or backup restore. The bad news
   is when I saw it, it was on several tables not just POST META.
   Take a look and
   see on your DB
 * ![](https://i0.wp.com/i.ibb.co/x2VXnkm/2023-09-05-21-45.png?ssl=1)

Viewing 1 replies (of 1 total)

The topic ‘Errors in Postmeta line in database’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Alan Fuller](https://wordpress.org/support/users/alanfuller/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/errors-in-postmeta-line-in-database/#post-17028572)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
