Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite extension not working on clean Azure Web App w/ WordPress 6.1.1 installation #657

Closed
gerardv opened this issue Feb 18, 2023 · 7 comments
Assignees
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Bug An existing feature is broken

Comments

@gerardv
Copy link

gerardv commented Feb 18, 2023

I can't get the SQLite extension to work on an Azure web app, both from the Performance Lab as using the stand alone plugin.
The site does work against an Azure Database for MySQL, otherwise the plugins mentioned above cannot be installed. I think it would be great if it were possible to start with SQLite from scratch, but I think that's on te roadmap already.

After activating the SQLite extension as a Performance Lab module I get the following stack trace.

NOTICE: PHP message: PHP Fatal error: Uncaught Error: Call to a member function has() on null in /home/site/wwwroot/wp-includes/l10n.php:1268
Stack trace:
#0 /home/site/wwwroot/wp-includes/l10n.php(1303): _load_textdomain_just_in_time('performance-lab')
#1 /home/site/wwwroot/wp-includes/l10n.php(187): get_translations_for_domain('performance-lab')
#2 /home/site/wwwroot/wp-includes/l10n.php(299): translate('Queries made or...', 'performance-lab')
#3 /home/site/wwwroot/wp-content/plugins/performance-lab/modules/database/sqlite/wp-includes/sqlite/class-perflab-sqlite-pdo-engine.php(610): __('Queries made or...', 'performance-lab')
#4 /home/site/wwwroot/wp-content/plugins/performance-lab/modules/database/sqlite/wp-includes/sqlite/class-perflab-sqlite-db.php(252): Perflab_SQLite_PDO_Engine->get_error_message()
#5 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): Perflab_SQLite_DB->query('SELECT option_n...')
#6 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#7 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#8 /home/site/wwwroot/wp-includes/l10n.php(63): get_option('WPLANG')
#9 /home/site/wwwroot/wp-includes/l10n.php(139): get_locale()
#10 /home/site/wwwroot/wp-includes/l10n.php(866): determine_locale()
#11 /home/site/wwwroot/wp-includes/class-wp-fatal-error-handler.php(47): load_default_textdomain()
#12 [internal function]: WP_Fatal_Error_Handler->handle()
#13 {main}
thrown in /home/site/wwwroot/wp-includes/l10n.php on line 1268

After activating the stand-alone plugin and clicking 'Install SQLite database' I get this:

NOTICE: PHP message: PHP Warning: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: mytableprefix_options in /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php:696
Stack trace:
#0 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(696): PDO->prepare('SELECT option_n...')
#1 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(464): WP_SQLite_PDO_Engine->prepare_query()
#2 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(243): WP_SQLite_PDO_Engine->query('SELECT option_n...')
#3 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#4 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#5 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#6 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#7 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#8 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#9 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#10 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#11 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#12 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#13 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#14 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#15 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#16 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#17 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#18 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#19 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#20 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#21 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#22 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#23 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#24 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#25 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#26 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#27 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#28 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#29 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#30 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#31 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#32 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#33 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#34 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#35 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#36 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#37 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#38 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#39 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#40 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#41 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#42 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#43 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#44 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#45 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#46 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#47 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#48 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#49 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#50 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#51 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#52 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#53 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#54 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#55 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#56 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#57 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#58 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#59 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#60 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#61 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#62 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#63 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#64 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php(607): esc_html('Raw query:\nSELE...')
#65 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(250): WP_SQLite_PDO_Engine->get_error_message()
#66 /home/site/wwwroot/wp-includes/class-wpdb.php(2854): WP_SQLite_DB->query('SELECT option_n...')
#67 /home/site/wwwroot/wp-includes/option.php(312): wpdb->get_results('SELECT option_n...')
#68 /home/site/wwwroot/wp-includes/option.php(191): wp_load_alloptions()
#69 /home/site/wwwroot/wp-includes/formatting.php(1107): get_option('blog_charset')
#70 /home/site/wwwroot/wp-includes/formatting.php(4564): wp_check_invalid_utf8('Raw query:\nSELE...')
#71 /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sq...
127.0.0.1 - 18/Feb/2023:20:06:28 +0000 "GET /wp-admin/index.php" 500
NOTICE: PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/site/wwwroot/wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-engine.php on line 697

@gerardv gerardv added the [Type] Bug An existing feature is broken label Feb 18, 2023
@OllieJones OllieJones self-assigned this Feb 21, 2023
@OllieJones
Copy link
Contributor

Looks to me like unintended recursion in an error reporting code path.

@OllieJones
Copy link
Contributor

In the first traceback something's not initialized. The l10n code assumes global $wp_textdomain_registry is ready to rock-n-roll, but it isn't, it's null.

@OllieJones
Copy link
Contributor

@gerardv What's the value of $table_prefix in your wp-config.php file? Are there any other WP_SOMETHING definitions we should know about? (Don't upload wp-config.php, it contains too many secrets to be safe on gh.)

@gerardv
Copy link
Author

gerardv commented Feb 24, 2023

@OllieJones in my wp_config.php it reads $table_prefix = 'nadiart_'; and it's a clean out-of-the-box WP install without any other non-standard WP_THINGS.

@OllieJones
Copy link
Contributor

esc_html uses get_option( 'blog_charset' ) which makes it unsuitable for use when SELECT doesn't work reliably.

Rework of ->get_error_message() since this defect was reported has eliminated the problem.

@gerardv
Copy link
Author

gerardv commented Mar 2, 2023

@OllieJones Is there a branch I can check out to get the remedy?

@OllieJones
Copy link
Contributor

OllieJones commented Mar 2, 2023

The fix is in the standalone plugin.

The task of pulling it back into this Performance Lab plugin is #661.

@felixarntz felixarntz added the [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Bug An existing feature is broken
Projects
None yet
Development

No branches or pull requests

4 participants