WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30477 closed defect (bug) (duplicate)

Assistance required debugging 4.1-beta2-30532 wp-db.php problem

Reported by: dfavor Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1
Component: Database Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Someone tell me the correct way to log all queries to debug.log as they execute, so I can debug this...

Thanks.
_

[24-Nov-2014 13:51:13 UTC] PHP Warning:  mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in /cluster/vhost/fastseohosting.com/wordpress/wp-includes/wp-db.php on line 1677
[24-Nov-2014 13:51:13 UTC] PHP Stack trace:
[24-Nov-2014 13:51:13 UTC] PHP   1. {main}() /cluster/vhost/fastseohosting.com/wordpress/wp-admin/admin-ajax.php:0
[24-Nov-2014 13:51:13 UTC] PHP   2. require_once() /cluster/vhost/fastseohosting.com/wordpress/wp-admin/admin-ajax.php:22
[24-Nov-2014 13:51:13 UTC] PHP   3. require_once() /cluster/vhost/fastseohosting.com/wordpress/wp-load.php:29
[24-Nov-2014 13:51:13 UTC] PHP   4. require_once() /cluster/vhost/fastseohosting.com/wordpress/wp-config.php:88
[24-Nov-2014 13:51:13 UTC] PHP   5. require_wp_db() /cluster/vhost/fastseohosting.com/wordpress/wp-settings.php:79
[24-Nov-2014 13:51:13 UTC] PHP   6. wpdb->__construct() /cluster/vhost/fastseohosting.com/wordpress/wp-includes/load.php:352
[24-Nov-2014 13:51:13 UTC] PHP   7. wpdb->db_connect() /cluster/vhost/fastseohosting.com/wordpress/wp-includes/wp-db.php:647
[24-Nov-2014 13:51:13 UTC] PHP   8. wpdb->set_sql_mode() /cluster/vhost/fastseohosting.com/wordpress/wp-includes/wp-db.php:1487
[24-Nov-2014 13:51:13 UTC] PHP   9. wpdb->query() /cluster/vhost/fastseohosting.com/wordpress/wp-includes/wp-db.php:831
[24-Nov-2014 13:51:13 UTC] PHP  10. mysqli_fetch_object() /cluster/vhost/fastseohosting.com/wordpress/wp-includes/wp-db.php:1677

Change History (9)

#1 @dfavor
6 years ago

All plugins turned off. Twenty Fifteen active.

#2 @dfavor
6 years ago

Hum... seems like I found the place to insert debug code.

Offending query seems to be...

query   : SELECT option_value FROM wp_options WHERE option_name = '_transient_dash_4077549d03da2e451c8b5f002294ff51' LIMIT 1

Checking http://$site/wp-admin/options.php this transient does exist, so I'm unsure why the error is being thrown.

<div class="rss-widget"><ul><li><a class='rsswidget' href='https://wordpress.org/news/2014/11/wordpress-4-0-1/'>WordPress 4.0.1 Security Release</a> <span class="rss-date">November 20, 2014</span><div class="rssSummary">WordPress 4.0.1 is now available. This is a critical security release for all previous versions and we strongly encourage you to update your sites immediately. Sites that support automatic background updates will be updated to WordPress 4.0.1 within the next few hours. If you are still on WordPress 3.9.2, 3.8.4, or 3.7.4, you will be […]</div></li></ul></div><div class="rss-widget"><ul><li><a class='rsswidget' href='http://wptavern.com/wordpress-4-1-to-remove-custom-background-and-header-admin-screens'>WPTavern: WordPress 4.1 to Remove Custom Background and Header Admin Screens</a></li><li><a class='rsswidget' href='http://wptavern.com/hierarchy-plugin-enhances-wordpress-as-a-cms'>WPTavern: Hierarchy Plugin Enhances WordPress as a CMS</a></li><li><a class='rsswidget' href='http://wptavern.com/wordpress-4-0-1-exposes-bad-development-practices-used-in-some-plugins'>WPTavern: WordPress 4.0.1 Exposes Bad Development Practices Used in Some Plugins</a></li></ul></div><div class="rss-widget"><ul><li class='dashboard-news-plugin'><span>Popular Plugin:</span> <a href='https://wordpress.org/plugins/jetpack/' class='dashboard-news-plugin-link'>Jetpack by WordPress.com</a> <span>(<a href='plugin-install.php?tab=plugin-information&plugin=jetpack&_wpnonce=42054dbbfe&TB_iframe=true&width=600&height=800' class='thickbox' title='Jetpack by WordPress.com'>Install</a>)</span></li></ul></div>
Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#3 @dfavor
6 years ago

Hum... Looks like this error is being thrown for many query sets.

#4 @SergeyBiryukov
6 years ago

  • Description modified (diff)

#5 @SergeyBiryukov
6 years ago

  • Version set to trunk

#6 @pento
6 years ago

Hi dfavor!

Going by the stack trace you posted, this seems to have happened when the DB first connected, and tried to set the sql_mode.

In your query log, could you please find the full query that starts with this?

SET SESSION sql_mode=

Also, what version of MySQL are you running?

#7 @johnbillion
6 years ago

  • Keywords reporter-feedback added

#8 @johnbillion
6 years ago

dfavor, can you let us know the answer to Pento's question above please?

#9 @pento
6 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #27982.

No need for feedback, this was fixed by [30677].

Note: See TracTickets for help on using tickets.