Jul 30, 2020 4:57 am
I'm using wpDiscuz 7.0.5, and I've had reports of slow voting acknowledgment (10 seconds). I cannot reproduce it myself. but while looking into my logs I can see some apparently related databases errors:
2020/07/30 05:41:11 [error] 4994#4994: *2051902 FastCGI sent in stderr: "PHP message: WordPress database error Unknown column 'post_id' in 'field list' for query INSERT INTO `wp_wc_users_voted`(`user_id`, `comment_id`, `vote_type`,`is_guest`,`post_id`,`date`)VALUES('807b19d8c11efce82ae178d568f8bf75',574498,-1,1,79070,1596087671); made by do_action('wp_ajax_nopriv_wpdVoteOnComment'), WP_Hook->do_action, WP_Hook->apply_filters, WpdiscuzHelperAjax->voteOnComment, WpdiscuzDBManager->addVoteType" while reading response header from upstream, client: 197.200.100.175, server: www.cnx-software.com, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.cnx-software.com", referrer: "https://www.cnx-software.com/2020/07/25/buy-rock-pi-4c-sbc-with-4gb-ram-hdmi-and-displayport/"
2020/07/30 05:41:35 [error] 4994#4994: *2051852 FastCGI sent in stderr: "PHP message: WordPress database error Unknown column 'post_id' in 'field list' for query INSERT INTO `wp_wc_users_voted`(`user_id`, `comment_id`, `vote_type`,`is_guest`,`post_id`,`date`)VALUES('807b19d8c11efce82ae178d568f8bf75',574488,-1,1,79070,1596087695); made by do_action('wp_ajax_nopriv_wpdVoteOnComment'), WP_Hook->do_action, WP_Hook->apply_filters, WpdiscuzHelperAjax->voteOnComment, WpdiscuzDBManager->addVoteType" while reading response header from upstream, client: 197.200.100.175, server: www.cnx-software.com, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.cnx-software.com", referrer: "https://www.cnx-software.com/2020/07/25/buy-rock-pi-4c-sbc-with-4gb-ram-hdmi-and-displayport/"
It looks like the plygin is trying to access 'post_id' column that does not existing in 'field list'.
Is that a bug or a problem with my database?
2 Replies
Jul 30, 2020 9:02 am
Hi @cnxsoft,
Execute the SQL query below in phpMyAdmin database manager SQL Tab. You can install phpMyAdmin plugin, or use your Hosting Service cPanel > phpMyAdmin Database Manager > Your website Database > SQL Tab:
ALTER TABLE `wp_wc_users_voted` ADD COLUMN `post_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, ADD COLUMN `date` INT(11) UNSIGNED NOT NULL DEFAULT 0, ADD INDEX `post_id` (`post_id`);
Please check the red marked wp_ prefix. If your database table prefix is different, you should change it to yours.
Jul 30, 2020 9:30 am
Thanks. That fixed it. I did it in the terminal with mysql command line instead.