Support » Fixing WordPress » Lot of databsse errors reported in the logs

  • Resolved rudrastays

    (@rudrastays)


    Hi,
    I am having a strange issue with my self hosted wordpress blog. In my server error logs I see a lot of entries reporting some kind of database error. As my database trouble shooting skiils are almost close to zero. I am asking this here. I am quoting the error logs below. If someone can help me sort this out, it will be of great help.

    2016/02/04 11:12:43 [error] 1520#1520: *298 FastCGI sent in stderr: "PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (4) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), call_user_func_array, WP_Customize_Manager->wp_loaded, do_action('customize_register'), call_user_func_array, WP_Customize_Nav_Menus->customize_register, wp_get_nav_menus, get_terms, update_termmeta_cache, update_meta_cache
    PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (3,5,42) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), call_user_func_array, WP_Customize_Manager->wp_loaded, do_action('customize_register'), call_user_func_array, WP_Customize_Nav_Menus->customize_register, wp_get_nav_menu_items, get_terms, update_termmeta_cache, update_meta_cache" while reading response header from upstream, client: 117.203.148.192, server: www.rudraraj.net, request: "POST / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.rudraraj.net", referrer: "http://www.rudraraj.net/wp-admin/customize.php?return=%2Fwp-admin%2Foptions-general.php%3Fpage%3Dhyper-cache%252Foptions.php"
    2016/02/04 11:12:51 [error] 1520#1520: *304 FastCGI sent in stderr: "PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (3,5,42) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iconic-one/index.php'), get_header, locate_template, load_template, require_once('/themes/iconic-one/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, update_termmeta_cache, update_meta_cache" while reading response header from upstream, client: 157.55.39.25, server: www.rudraraj.net, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.rudraraj.net"
    2016/02/04 11:34:31 [error] 1520#1520: *425 FastCGI sent in stderr: "PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (3,5,42) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iconic-one/category.php'), get_header, locate_template, load_template, require_once('/themes/iconic-one/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, update_termmeta_cache, update_meta_cache" while reading response header from upstream, client: 117.203.148.192, server: www.rudraraj.net, request: "GET /category/centos/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.rudraraj.net", referrer: "http://www.rudraraj.net/category/debian/"
    2016/02/04 11:37:26 [error] 1520#1520: *438 FastCGI sent in stderr: "PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (3,5,42) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iconic-one/index.php'), get_header, locate_template, load_template, require_once('/themes/iconic-one/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, update_termmeta_cache, update_meta_cache" while reading response header from upstream, client: 191.232.136.79, server: www.rudraraj.net, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.rudraraj.net"
    2016/02/04 11:37:34 [error] 1520#1520: *443 FastCGI sent in stderr: "PHP message: WordPress database error Table 'wordpress.wp_termmeta' doesn't exist for query SELECT term_id, meta_key, meta_value FROM wp_termmeta WHERE term_id IN (3,5,42) ORDER BY meta_id ASC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/iconic-one/tag.php'), get_header, locate_template, load_template, require_once('/themes/iconic-one/header.php'), wp_nav_menu, wp_get_nav_menu_items, get_terms, update_termmeta_cache, update_meta_cache" while reading response header from upstream, client: 66.249.64.118, server: www.rudraraj.net, request: "GET /tag/add-swap-in-freebsd-10-1/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.rudraraj.net"

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am running on the latest wordpress release and all the plugins are up to date. I tried changing the theme, but it does not seem to be helping.

    Well did manage to fix this issue by creating wordpress.wp_termmeta table.
    Found this support link https://wordpress.org/support/topic/error-500-after-upgrade-termmeta-table-doesnt-exist?replies=10.

    I am pasting the code snippet below that i used to fix this issue

    CREATE TABLE IF NOT EXISTS wp_termmeta ( meta_id bigint(20) unsigned NOT NULL, term_id bigint(20) unsigned NOT NULL DEFAULT '0', meta_key varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, meta_value longtext COLLATE utf8mb4_unicode_ci ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    ALTER TABLE wp_termmeta ADD PRIMARY KEY (meta_id), ADD KEY term_id (term_id);
    ALTER TABLE wp_termmeta MODIFY meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT;
    flush privileges;
    exit;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lot of databsse errors reported in the logs’ is closed to new replies.