admin管理员组

文章数量:1296454

I'm getting a WordPress "table doesn't exist" error in my debug.log, but unlike most errors it doesn't give a full stack trace to help me isolate the code. Anyone know how to tell WordPress to dump a full stack trace for this error? Thanks!

[03-Apr-2021 08:19:39 UTC] WordPress database error Table '**********.wp_47_wslusersprofiles' doesn't exist for query SELECT id, object_sha FROM `wp_47_wslusersprofiles` where user_id = 33 and provider = 'Google' and identifier = '115473556036777077042' made by require('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, wsl_process_login, wsl_process_login_end, wsl_process_login_update_wsl_user_data, wsl_store_hybridauth_user_profile

More context: I know the wslusersprofiles table isn't a standard WordPress table. What puzzles me is why I'm not getting a normal stack trace in my debug.log file like I would for a PHP Error, Warning, or Notice. It's as if the WordPress database class is trapping this error and only issuing an error_log() notification, without throwing a PHP error. Is there a way to force it to throw an exception? Or at least dump more details?

I'm getting a WordPress "table doesn't exist" error in my debug.log, but unlike most errors it doesn't give a full stack trace to help me isolate the code. Anyone know how to tell WordPress to dump a full stack trace for this error? Thanks!

[03-Apr-2021 08:19:39 UTC] WordPress database error Table '**********.wp_47_wslusersprofiles' doesn't exist for query SELECT id, object_sha FROM `wp_47_wslusersprofiles` where user_id = 33 and provider = 'Google' and identifier = '115473556036777077042' made by require('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, wsl_process_login, wsl_process_login_end, wsl_process_login_update_wsl_user_data, wsl_store_hybridauth_user_profile

More context: I know the wslusersprofiles table isn't a standard WordPress table. What puzzles me is why I'm not getting a normal stack trace in my debug.log file like I would for a PHP Error, Warning, or Notice. It's as if the WordPress database class is trapping this error and only issuing an error_log() notification, without throwing a PHP error. Is there a way to force it to throw an exception? Or at least dump more details?

Share Improve this question edited Apr 4, 2021 at 5:52 Martin_W asked Apr 3, 2021 at 17:32 Martin_WMartin_W 1036 bronze badges 2
  • those tables aren't WordPrress tables, they're coming from a custom plugin. Look for a plugin or theme that uses wsl and does things with user profiles that adds the wslusersprofiles table, you will need to contact their support rroute – Tom J Nowell Commented Apr 3, 2021 at 19:33
  • Thanks, but I know the wslusersprofiles table isn't a standard WordPress table. My question is how to get a stack track so I can identify and debug the code that is causing this error. I'll edit my question to clarify this point. – Martin_W Commented Apr 4, 2021 at 5:46
Add a comment  | 

1 Answer 1

Reset to default 0

You are not seeing a stack trace because this information is being logged via the error_log() function within the wpdb::print_error() method. error_log() simply sends a message to the logs.

The behaviour you're expecting with a full stack trace would require trigger_error() to be used.

本文标签: databaseHow to get the full stack trace for WordPress quottable doesn39t existquot error in debuglog