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

WooCommerce errors: cannot create a manual order/ see the home dashboard #132

Open
Robertght opened this issue May 15, 2024 · 22 comments
Open

Comments

@Robertght
Copy link

Quick summary

After creating a new instance with Studio and installing WooCommerce, I'm unable to create manual orders or see the main Woo home dashboard.

Steps to reproduce

  1. Start Studio.
  2. Create a new site and install WooCommerce
  3. Go through the WooCommerce wizard and install all the additional plugins(MailPoet, etc)
  4. Access the WooCommerce home dashboard
  5. Try to create a manual order.

What you expected to happen

To be able to create the manual payment order

What actually happened

First, the Woo home dashboard wouldn't load but I saw this error:

Exception: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:20 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(20): PDO->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:10 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(24): MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:89 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(77): MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(69): MailPoetVendor\Doctrine\DBAL\DBALException::wrapException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...') #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(16): MailPoetVendor\Doctrine\DBAL\DBALException::driverException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #8 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #9 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #12 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #13 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #15 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #16 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #17 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #18 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #21 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #22 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #23 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #24 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #25 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #26 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #27 {main} thrown in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 89
There has been a critical error on this website. Please check your site admin email inbox for instructions.

Once MailPoet was deactivated, I was able to load the WooCommerce home dashboard, but the Order page wouldn't load. The errors I saw with Debug mode turned on:

 [<div style="clear:both">&nbsp;</div> <div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;"> <p>MySQL query:</p> <p> INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` ) VALUES ( '', 0, 'admin', NULL, NULL, 0.000000, 0.000000, 0, 0, 18, 'wc_order_3dmcHLBmqEeOL', 0, 0, 0, 0.000000, 0.000000, '8.9.0' ) ON DUPLICATE KEY UPDATE `cart_hash` = VALUES( `cart_hash` ), `coupon_usages_are_counted` = VALUES( `coupon_usages_are_counted` ), `created_via` = VALUES( `created_via` ), `date_completed_gmt` = VALUES( `date_completed_gmt` ), `date_paid_gmt` = VALUES( `date_paid_gmt` ), `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `download_permission_granted` = VALUES( `download_permission_granted` ), `new_order_email_sent` = VALUES( `new_order_email_sent` ), `order_id` = VALUES( `order_id` ), `order_key` = VALUES( `order_key` ), `order_stock_reduced` = VALUES( `order_stock_reduced` ), `prices_include_tax` = VALUES( `prices_include_tax` ), `recorded_sales` = VALUES( `recorded_sales` ), `shipping_tax_amount` = VALUES( `shipping_tax_amount` ), `shipping_total_amount` = VALUES( `shipping_total_amount` ), `woocommerce_version` = VALUES( `woocommerce_version` ) </p> <p>Queries made or created this session were:</p> <ol> <li>Executing: BEGIN | (no parameters)</li> <li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li> <li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_operational_data&quot;) as l; | (no parameters)</li> <li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_operational_data__order_id&quot;) as l; | (no parameters)</li> <li>Executing: INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` ) VALUES ( :param0 , 0, :param1 , NULL, NULL, 0.000000, 0.000000, 0, 0, 18, :param2 , 0, 0, 0, 0.000000, 0.000000, :param3 ) ON CONFLICT (&quot;order_id&quot;, ) DO UPDATE SET `cart_hash` = excluded. `cart_hash` , `coupon_usages_are_counted` = excluded. `coupon_usages_are_counted` , `created_via` = excluded. `created_via` , `date_completed_gmt` = excluded. `date_completed_gmt` , `date_paid_gmt` = excluded. `date_paid_gmt` , `discount_tax_amount` = excluded. `discount_tax_amount` , `discount_total_amount` = excluded. `discount_total_amount` , `download_permission_granted` = excluded. `download_permission_granted` , `new_order_email_sent` = excluded. `new_order_email_sent` , `order_id` = excluded. `order_id` , `order_key` = excluded. `order_key` , `order_stock_reduced` = excluded. `order_stock_reduced` , `prices_include_tax` = excluded. `prices_include_tax` , `recorded_sales` = excluded. `recorded_sales` , `shipping_tax_amount` = excluded. `shipping_tax_amount` , `shipping_total_amount` = excluded. `shipping_total_amount` , `woocommerce_version` = excluded. `woocommerce_version` | parameters: , admin, wc_order_3dmcHLBmqEeOL, 8.9.0</li> <li>Executing: ROLLBACK | (no parameters)</li> </ol> </div> <div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;"> Error occurred at line 3764 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error. </div> <p>Backtrace:</p> <pre>#0 /var/www/html/wp-content/mu-plugins/sqlite-database-integration-main/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message() #1 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...') #2 /var/www/html/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1867): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_ope...', Array, Array) #3 /var/www/html/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2539): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order), false) #4 /var/www/html/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2496): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save(Object(WC_Order)) #5 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create(Object(WC_Order)) #6 /var/www/html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214): WC_Data_Store->create(Object(WC_Order)) #7 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save() #8 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(388): WC_Order->save() #9 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php(167): Automattic\WooCommerce\Internal\Admin\Orders\PageController->setup_action_new_order() #10 [internal function]: Automattic\WooCommerce\Internal\Admin\Orders\PageController->handle_load_page_action('') #11 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Traits/AccessiblePrivateMethods.php(158): call_user_func_array(Array, Array) #12 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Orders\PageController->__call('handle_load_pag...', Array) #13 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #14 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #15 /var/www/html/wp-admin/admin.php(237): do_action('load-woocommerc...') #16 {main}</pre> ] INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` ) VALUES ( '', 0, 'admin', NULL, NULL, 0.000000, 0.000000, 0, 0, 18, 'wc_order_3dmcHLBmqEeOL', 0, 0, 0, 0.000000, 0.000000, '8.9.0' ) ON DUPLICATE KEY UPDATE `cart_hash` = VALUES( `cart_hash` ), `coupon_usages_are_counted` = VALUES( `coupon_usages_are_counted` ), `created_via` = VALUES( `created_via` ), `date_completed_gmt` = VALUES( `date_completed_gmt` ), `date_paid_gmt` = VALUES( `date_paid_gmt` ), `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `download_permission_granted` = VALUES( `download_permission_granted` ), `new_order_email_sent` = VALUES( `new_order_email_sent` ), `order_id` = VALUES( `order_id` ), `order_key` = VALUES( `order_key` ), `order_stock_reduced` = VALUES( `order_stock_reduced` ), `prices_include_tax` = VALUES( `prices_include_tax` ), `recorded_sales` = VALUES( `recorded_sales` ), `shipping_tax_amount` = VALUES( `shipping_tax_amount` ), `shipping_total_amount` = VALUES( `shipping_total_amount` ), `woocommerce_version` = VALUES( `woocommerce_version` )

Last, but not least, I'm not able to deactivate WooCommerce through the Plugins page once installed.

Impact

Some (< 50%)

Available workarounds?

No and the app is unusable

Platform

Mac Silicon, Mac Intel

Logs or notes

8191986-zd-a8c

@Robertght Robertght added [Type] Bug Something isn't working Needs triage Ticket needs to be triaged labels May 15, 2024
@Robertght Robertght changed the title WooCommerce errors: cannot create a manual order WooCommerce errors: cannot create a manual order/ see the home dashboard May 15, 2024
Copy link

Support References

This comment is automatically generated. Please do not edit it.

  • 8191986-zen

@dcalhoun
Copy link
Member

From a cursory glance, this issue may relate to WordPress/wordpress-playground#731. I see what appears to be an extra , in the reported database query error in ON CONFLICT (&quot;order_id&quot;, ), which is also referenced in WordPress/wordpress-playground#731 (comment). This issue may be resolved by WordPress/sqlite-database-integration#113.

If that is accurate, upgrading Studio's sqlite-database-integration installation to the to-be-released version including the fix would resolve this issue. Automatically upgrading sqlite-database-integration is pending review and merge in #136. All that to say, this may be a "wait and see" situation.

@dcalhoun dcalhoun self-assigned this May 17, 2024
@adamziel
Copy link

The fix is now in trunk

@dcalhoun
Copy link
Member

I confirmed that WordPress/sqlite-database-integration#113 resolves this issue.

The fix is now in trunk

Thanks for the note, @adamziel! Given Studio's new sqlite-databse-integration upgrade logic in #136 relies upon release tags, I'll mark this resolved once a new sqlite-database-integration release is published and #136 is merged.

@adamziel
Copy link

In that case, you might need to ask @aristath to publish a new release.

@aristath
Copy link

v2.1.11 released 👍

@dcalhoun
Copy link
Member

dcalhoun commented May 20, 2024

It appears my follow up testing was completed a bit too hastily. I did not have the MailPoet plugin activated.

When MailPoet is deactivated, WooCommerce order creation works as expected. When MailPoet is activated, the first error reported in the issue description still occurs. I also see the below error message atop WP Admin pages.

MailPoet Error: MailPoet requires a PDO_MYSQL PHP extension. Please read our instructions on how to resolve this issue.

Expanded SQL error
Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:20 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(20): PDO->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(268): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(384): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:10 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(24): MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(268): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(384): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:89 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(77): MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(69): MailPoetVendor\Doctrine\DBAL\DBALException::wrapException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...') #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(16): MailPoetVendor\Doctrine\DBAL\DBALException::driverException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #8 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #9 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #12 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #13 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #15 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #16 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #17 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #18 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(268): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #21 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(384): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #22 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #23 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #24 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #25 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #26 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #27 {main} thrown in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 89

This issue also occurs in Playground sites outside of Studio. It appears there may be lingering incompatibility between sqlite-database-integration and MailPoet's use of PDO.

@aristath
Copy link

Ideally, MailPoet would check the type of db used and then use the corresponding driver for that… They use doctrine-dbal which is an amazing database abstraction layer, but they are forcing MySQL there, and bypassing the WP database system altogether.
Doctrine-DBAL allows using different db engines just by switching the driver, so if MailPoet chooses to bypass $wpdb and use their own implementation, there’s not much we can do to intercept these queries and translate them to SQLite 🤷

@adamziel
Copy link

adamziel commented May 20, 2024

Actually, Playground could ship a MySQL to SQLite proxy and support every possible way of connecting to MySQL. There are higher priority platform-level issues we'll be working on in the medium term. If this feature is something you'd like to like to get sooner than later, I suggest contributing to core:

WordPress/wordpress-playground#1341

Oh, and check in with MailPoet folks first, I vaguely remember they were exploring a migration to $wpdb.

@Robertght
Copy link
Author

I wanted to confirm the issue with MailPoet happens on the Windows built too and it's quite easy to replicate. Just install and activate WooCommerce and while in the wizard, leave all recommended plugins to be installed and the error will show up right after it's finished.

The error

Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:20 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(20): PDO->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT [t0.name](http://t0.name/) ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:10 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(24): MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(14): MailPoetVendor\Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'username_here', 'password_here', Array) #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT [t0.name](http://t0.name/) ...', Array, Array) #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #8 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #9 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #12 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #13 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #15 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #16 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #17 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #18 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #21 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #22 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #23 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #24 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #25 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #26 {main} Next MailPoetVendor\Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Address family not supported by protocol in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:89 Stack trace: #0 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(77): MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #1 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(69): MailPoetVendor\Doctrine\DBAL\DBALException::wrapException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception), 'An exception oc...') #2 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(16): MailPoetVendor\Doctrine\DBAL\DBALException::driverException(Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver), Object(MailPoetVendor\Doctrine\DBAL\Driver\PDO\Exception)) #3 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(149): MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'username_here', 'password_here', Array) #4 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(806): MailPoetVendor\Doctrine\DBAL\Connection->connect() #5 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(484): MailPoetVendor\Doctrine\DBAL\Connection->getWrappedConnection() #6 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(476): MailPoetVendor\Doctrine\DBAL\Connection->executeQuery('SELECT [t0.name](http://t0.name/) ...', Array, Array) #7 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(73): MailPoetVendor\Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #8 /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(68): MailPoetVendor\Doctrine\ORM\EntityRepository->findBy(Array) #9 /var/www/html/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(84): MailPoetVendor\Doctrine\ORM\EntityRepository->findAll() #10 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(147): MailPoet\Doctrine\Repository->findAll() #11 /var/www/html/wp-content/plugins/mailpoet/lib/Settings/SettingsController.php(37): MailPoet\Settings\SettingsController->ensureLoaded() #12 /var/www/html/wp-content/plugins/mailpoet/lib/Config/Changelog.php(84): MailPoet\Settings\SettingsController->get('version') #13 /var/www/html/wp-content/plugins/mailpoet/lib/API/MP/v1/API.php(112): MailPoet\Config\Changelog->shouldShowWelcomeWizard() #14 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(374): MailPoet\API\MP\v1\API->isSetupComplete() #15 /var/www/html/wp-content/plugins/woocommerce/src/Admin/Marketing/InstalledExtensions.php(31): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_mailpoet_extension_data() #16 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/Marketing.php(233): Automattic\WooCommerce\Admin\Marketing\InstalledExtensions::get_data() #17 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\Admin\Marketing->component_settings(Array) #18 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #19 /var/www/html/wp-content/plugins/woocommerce/src/Internal/Admin/WCAdminSharedSettings.php(61): apply_filters('woocommerce_adm...', Array) #20 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(269): Automattic\WooCommerce\Internal\Admin\WCAdminSharedSettings->Automattic\WooCommerce\Internal\Admin\{closure}() #21 /var/www/html/wp-content/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php(385): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->execute_lazy_data() #22 /var/www/html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->enqueue_asset_data('') #23 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #24 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #25 /var/www/html/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #26 /var/www/html/wp-admin/admin.php(297): require_once('/var/www/html/w...') #27 {main} thrown in /var/www/html/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 89

For a newcommer, this would be quite the block.

@dcalhoun
Copy link
Member

Removing my assignment as I am currently focused on other work.

@dcalhoun dcalhoun removed their assignment Jun 11, 2024
@costasovo
Copy link

If I understand correctly, the Studio uses WordPress Playground under the hood, am I right?

The current version of MailPoet (4.57.0) needs a PDO connection, and it is not supported by the WP Playground.

The good news is that we are currently working on replacing the PDO connection with WPDB (mailpoet/mailpoet#5734).

Switching to WPDB should be the first step to enable the MailPoet to run on WP Playground.

We already tested the WPDB version with the WP Playground and ran into a couple of issues with SQLite-database-integration that prevented the plugin from running.

After these issue are fixed and WPDB branch is released hopefully the plugin will run 🤞

@wojtekn
Copy link
Contributor

wojtekn commented Jul 26, 2024

@costasovo thanks for testing the plugin and sharing the findings.

If I understand correctly, the Studio uses WordPress Playground under the hood, am I right?

Yes, this is correct.

@lsl
Copy link

lsl commented Aug 8, 2024

The good news is that we are currently working on replacing the PDO connection with WPDB (mailpoet/mailpoet#5734).

If this is a while out it might be worth making WooCommerce or Mailpoet detect this issue and either not install or fail gracefully.

However.. this feels like it may be a bigger product discussion, there will be other plugins, themes and custom code that expect PDO / mysql libs.

Is Studio able to detect and handle these issues more gracefully?

Detection could be a mix of code scanning and error log checking, e.g. catching things like: #172, #181

@katinthehatsite
Copy link
Contributor

Some notes while I am testing this:

  • If I deactivate MailPoet, I am able to create a manual order with no issues;
  • Generally activating MailPoet breaks many things in WooCommerce on Studio and throws the following error:
Screenshot 2024-08-21 at 4 48 48 PM

@wojtekn
Copy link
Contributor

wojtekn commented Aug 22, 2024

@katinthehatsite see mailpoet/mailpoet#5777 and pcNwfB-4c8-p2

@JanJakes
Copy link

@katinthehatsite @wojtekn With the build from mailpoet/mailpoet#5777, there are indeed no errors on MailPoet activation in WordPress playground. I will move the pull request forward, so the changes on our side get to trunk and a release. That said, it's also necessary to use the latest version of the SQLite integration plugin, as we've added a batch of fixes and improvements recently.

@katinthehatsite
Copy link
Contributor

Thank you @JanJakes !

@paulopmt1 paulopmt1 self-assigned this Aug 26, 2024
@paulopmt1
Copy link

Thanks for moving this forward @JanJakes!

Although we have landed the WPDB driver for Doctrine change and it's indeed in the 5.0.1 release I still see the same issue no such column: rl.step_key reported here.

  • When opening the plugins page, I see a migration error: Migration "MailPoet\Migrations\Db\Migration_20230831_143755_Db" failed. Details: An exception occurred while executing a query: SELECT rl.id, rl.automation_run_id, rl.step_id, rl.started_at, v.steps FROM wp_mailpoet_automation_run_logs rl JOIN wp_mailpoet_automation_runs r ON r.id = rl.automation_run_id JOIN wp_mailpoet_automation_versions v ON v.id = r.version_id WHERE rl.step_key = '' ORDER BY rl.id ASC LIMIT 50, Caused by : Error occurred at line 4108 in Function handle_error. Error message was: SQLSTATE[HY000]: General error: 1 no such column: rl.step_key.

  • When trying to create a new order I get a different error now: table wp_mailpoet_log has no column named raw_message. More about the error:

MySQL query:

INSERT INTO wp_mailpoet_log (name, level, message, raw_message, context, created_at) VALUES (‘WooCommerce Update Subscriber Engagement’, ‘400’, ‘[2024-08-26T18:20:34.261000+00:00] WooCommerce Update Subscriber Engagement.ERROR: An exception occurred while executing a query:

MySQL query:

SELECT t0.wp_user_id AS wp_user_id_1, t0.is_woocommerce_user AS is_woocommerce_user_2, t0.first_name AS first_name_3, t0.last_name AS last_name_4, t0.email AS email_5, t0.status AS status_6, t0.subscribed_ip AS subscribed_ip_7, t0.confirmed_ip AS confirmed_ip_8, t0.confirmed_at AS confirmed_at_9, t0.last_subscribed_at AS last_subscribed_at_10, t0.unconfirmed_data AS unconfirmed_data_11, t0.source AS source_12, t0.count_confirmations AS count_confirmations_13, t0.unsubscribe_token AS unsubscribe_token_14, t0.link_token AS link_token_15, t0.engagement_score AS engagement_score_16, t0.engagement_score_updated_at AS engagement_score_updated_at_17, t0.last_engagement_at AS last_engagement_at_18, t0.last_sending_at AS last_sending_at_19, t0.last_open_at AS last_open_at_20, t0.last_click_at AS last_click_at_21, t0.last_purchase_at AS last_purchase_at_22, t0.last_page_view_at AS last_page_view_at_23, t0.woocommerce_synced_at AS woocommerce_synced_at_24, t0.email_count AS email_count_25, t0.id AS id_26, t0.created_at AS created_at_27, t0.updated_at AS updated_at_28, t0.deleted_at AS deleted_at_29 FROM wp_mailpoet_subscribers t0 WHERE t0.email = ‘[email protected]’ LIMIT 1

Error occurred at line 4108 in Function handle_error. Error message was: SQLSTATE[HY000]: General error: 1 no such column: t0.last_sending_at.

it's also necessary to use the latest version of the SQLite integration plugin

Can you confirm these errors occur due to the SQLite version we're using at Studio?

@paulopmt1 paulopmt1 assigned paulopmt1 and unassigned paulopmt1 Aug 26, 2024
@JanJakes
Copy link

@paulopmt1

Although we mailpoet/mailpoet#5734 and it's indeed in the 5.0.1 release

Actually, 5.0.1 was only a cherry-picked fix, so it does not contain the changes. All of them will be released tomorrow in version 5.0.2. You can also use the build from here, if you want to give it a try a bit earlier.

@paulopmt1
Copy link

Thanks for pointing me to the correct release file @JanJakes!

I did download that 5.0.2 version, and after enabling it I'm betting a fatal screen error:

And the logs show this:

Migration "MailPoet\Migrations\Db\Migration_20230831_143755_Db" failed. Details: An exception occurred while executing a query:

MySQL query:

ALTER TABLE wp_mailpoet_automation_run_logs DROP COLUMN completed_at
image

Am I missing something?

@JanJakes
Copy link

@paulopmt1 I was unable to replicate this in WP Playground, so I downloaded Studio, and got this:

Migration "MailPoet\Migrations\Db\Migration_20230831_143755_Db" failed. Details: An exception occurred while executing a query:

MySQL query:

ALTER TABLE wp_mailpoet_automation_run_logs DROP COLUMN completed_at

Queries made or created this session were:

Executing: BEGIN | (no parameters)
Executing: DROP TRIGGER IF EXISTS "__wp_mailpoet_automation_run_logs_COLUMN_on_update__" | (no parameters)
Executing: ALTER TABLE wp_mailpoet_automation_run_logs DROP COLUMN completed_at | (no parameters)
Executing: ROLLBACK | (no parameters)

Error occurred at line 4108 in Function handle_error. Error message was: SQLSTATE[HY000]: General error: 1 error in trigger __wp_mailpoet_scheduled_task_subscribers_updated_at_on_update__: no such column: id.

This is a regression in the sqlite-database-integration that was fixed in WordPress/sqlite-database-integration#156. Is there a way for you to try this with the latest version of the SQLite integration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests