Support » Fixing WordPress » Featured “Image” not saving after update

  • Resolved Maciej Kawiak

    (@getjobworking)


    Error log:

    [STDERR] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTOklm_postmeta(post_id,meta_key,meta_value`) VALUES (6786, ‘_edit_lock’, ‘1668347422:3’) made by require(‘wp-admin/edit-form-blocks.php’), wp_set_post_lock, update_post_meta, update_metadata, add_metadata
    2022-11-13 14:50:32.896969 [NOTICE] [348713] [T0] [91.xxx.156.xxx:59386-H3:217820-412#APVH_www.xxxxxx.pl:443] [STDERR] WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO klm_postmeta (post_id, meta_key, meta_value) VALUES (6786, ‘_edit_last’, ‘3’) made by edit_post, update_post_meta, update_metadata, add_metadata
    2022-11-13 14:50:32.913336 [NOTICE] [348713] [T0] [91.xxx.156.xxx:59386-H3:217820-412#APVH_www.xxxxxx.pl:443] [STDERR] WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO klm_postmeta (post_id, meta_key, meta_value) VALUES (6786, ‘slide_template’, ‘default’) made by edit_post, wp_update_post, wp_insert_post, do_action(‘save_post’), WP_Hook->do_action, WP_Hook->apply_filters, RevSliderAdmin::on_save_post, update_post_meta, update_metadata, add_metadata
    2022-11-13 14:50:32.913726 [NOTICE] [348713] [T0] [91.xxx.156.xxx:59386-H3:217820-412#APVH_www.xxxxxx.pl:443] [STDERR] WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO klm_postmeta (post_id, meta_key, meta_value) VALUES (6786, ‘rs_page_bg_color’, ‘#ffffff’) made by edit_post, wp_update_post, wp_insert_post, do_action(‘save_post’), WP_Hook->do_action, WP_Hook->apply_filters, RevSliderAdmin::on_save_post, update_post_meta, update_metadata, add_metadata
    2022-11-13 14:50:32.914385 [NOTICE] [348713] [T0] [91.xxx.156.xxx:59386-H3:217820-412#APVH_www.xxxxxx.pl:443] [STDERR] WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO klm_postmeta (post_id, meta_key, meta_value) VALUES (6786, ‘_edit_lock’, ‘1668347432:3’) made by edit_post, wp_set_post_lock, update_post_meta, update_metadata, add_metadata
    2022-11-13 14:50:33.296252 [NOTICE] [348713] [T0] [91.xxx.156.xxx:59386-H3:217820-416#APVH_www.xxxxxx.pl:443] [STDERR] WordPress database error Duplicate entry ‘0’ for key ‘PRIMARY’ for query INSERT INTO klm_postmeta (post_id, meta_key, meta_value) VALUES (6786, ‘_edit_lock’, ‘1668347433:3’) made by require(‘wp-admin/edit-form-blocks.php’), wp_set_post_lock, update_post_meta, update_metadata, add_metadata`

    Wordpress version 6.1

    I disabled all plugins and changed the template to default. I still cannot save the image along with the post. The image is added from the gallery.
    The query indicates to add a record and not update.

    The effect occurred after the last update.
    I have also swapped the theme, with a newer version, but the effect occurs on the admin side.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • This looks to me like a database structure is not properly defined. Try to solve it as described here for the database repair in WordPress: https://nestify.io/blog/wp_allow_repair-repair-optimize-wordpress-database/

    Before that it is best to create a backup.

    Thread Starter Maciej Kawiak

    (@getjobworking)

    Output:

    Table “xxx_users” does not require repair.
    Table “xxx_usermeta” does not require repair.
    Table “xxx_posts” does not require repair.
    Table “xxx_comments” does not require repair.
    Table “xxx_links” does not require repair.
    Table “xxx_options” does not require repair.
    Table “xxx_postmeta” does not require repair.
    Table “xxx_terms” does not require repair.
    Table “xxx_term_taxonomy” does not require repair.
    Table ‘xxx_term_relationships’ does not require repair.
    Table “xxx_termmeta” does not require repair.
    Table ‘xxx_commentmeta’ does not require repair.

    The repair has been completed. Please remove the following lines from your wp-config.php file to prevent unauthorised use of your site.

    define(‘WP_ALLOW_REPAIR’, true);

    I also used the mysql function: REPAIR TABLE xxx against the wp_postmeta table.

    Thread Starter Maciej Kawiak

    (@getjobworking)

    This has not changed anything. Does anyone have any ideas?

    If you already execute database statements yourself, you will probably also be able to take a look at the structure of the database tables? Compare the postmeta with the defaults here: https://codex.wordpress.org/Database_Description#Table:_wp_postmeta

    My guess is that auto_increment is missing.

    Thread Starter Maciej Kawiak

    (@getjobworking)

    @threadi – Auto increment was missing, so I added it. Everything works. Thank you. What could have been the cause of removing the AI?

    Unfortunately, you can’t judge that without knowing the hosting. In the future, make sure that you have the latest backups available so that you don’t have a longer downtime due to technical problems.

    Thread Starter Maciej Kawiak

    (@getjobworking)

    @threadi – Once again, thank you very much for your help.

    Glad if I could help. You are welcome to set the topic to solved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Featured “Image” not saving after update’ is closed to new replies.