Automattic / studio

Studio by WordPress.com, a free desktop app that helps developers streamline their local WordPress development workflow.
https://developer.wordpress.com/studio/
GNU General Public License v2.0
192 stars 18 forks source link

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

Closed Robertght closed 2 months ago

Robertght commented 6 months ago

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

github-actions[bot] commented 6 months ago

Support References

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

dcalhoun commented 6 months ago

From a cursory glance, this issue may relate to https://github.com/WordPress/wordpress-playground/issues/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 https://github.com/WordPress/wordpress-playground/issues/731#issuecomment-2117223068. This issue may be resolved by https://github.com/WordPress/sqlite-database-integration/pull/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 https://github.com/Automattic/studio/pull/136. All that to say, this may be a "wait and see" situation.

adamziel commented 6 months ago

The fix is now in trunk

dcalhoun commented 6 months ago

I confirmed that https://github.com/WordPress/sqlite-database-integration/pull/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 https://github.com/Automattic/studio/pull/136 relies upon release tags, I'll mark this resolved once a new sqlite-database-integration release is published and https://github.com/Automattic/studio/pull/136 is merged.

adamziel commented 6 months ago

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

aristath commented 6 months ago

v2.1.11 released 👍

dcalhoun commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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:

https://github.com/WordPress/wordpress-playground/issues/1341

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

Robertght commented 5 months ago

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 commented 5 months ago

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

costasovo commented 3 months ago

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 (https://github.com/mailpoet/mailpoet/pull/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 commented 3 months ago

@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 commented 3 months ago

The good news is that we are currently working on replacing the PDO connection with WPDB (https://github.com/mailpoet/mailpoet/pull/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: https://github.com/Automattic/studio/issues/172, https://github.com/Automattic/studio/issues/181

katinthehatsite commented 2 months ago

Some notes while I am testing this:

Screenshot 2024-08-21 at 4 48 48 PM
wojtekn commented 2 months ago

@katinthehatsite see https://github.com/mailpoet/mailpoet/pull/5777 and pcNwfB-4c8-p2

JanJakes commented 2 months ago

@katinthehatsite @wojtekn With the build from https://github.com/mailpoet/mailpoet/pull/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 commented 2 months ago

Thank you @JanJakes !

paulopmt1 commented 2 months ago

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.

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 = ‘admin@localhost.com’ 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?

JanJakes commented 2 months ago

@paulopmt1

Although we https://github.com/mailpoet/mailpoet/pull/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 commented 2 months ago

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 commented 2 months ago

@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 https://github.com/WordPress/sqlite-database-integration/pull/156. Is there a way for you to try this with the latest version of the SQLite integration?

paulopmt1 commented 2 months ago

Is there a way for you to try this with the latest version of the SQLite integration?

I just checked at the Studio/project-name/wp-content/mu-plugins/sqlite-database-integration and it's running the latest 2.1.14 stable version:

image

I tried downloading the trunk version and replacing the files, but the error remains.

As we talked on Slack, you plan to look at it this week, so let me know if I can help.

JanJakes commented 2 months ago

@paulopmt1 The 2.1.14 version doesn't include https://github.com/WordPress/sqlite-database-integration/pull/156.

I tried downloading the trunk version and replacing the files, but the error remains.

There is no trunk, which branch exactly did you try? The fix is in develop, and with that branch, it works for me:

Screenshot 2024-08-27 at 15 14 44 Screenshot 2024-08-27 at 15 17 07

Please, make sure you create the site first, then update the SQLite plugin to develop, and only then try to install and activate MailPoet.

As we talked on Slack, you plan to look at it this week, so let me know if I can help.

To clarify, I want to look at another error that is logged during the activation, but doesn't crash the process. The error above seems to be resolved for me with both WP Playground and Studio.

If you want to have the SQLite integration tagged, I'm sure someone from the Orbit team will be able to help.

MailPoet 5.0.2 was just released, so you can use the official package 🎉

I hope that helps and the Studio will finally be able to run with MailPoet as well 🤞

paulopmt1 commented 2 months ago

Thanks for sharing the details! As we talked, with your recent fixes + the MailPoet 5.0.2 we can install it on Studio:

image

For WooCommerce + MailPoet, we're getting a new error now:

image

The next step you already shared with me: "This looks like an UPDATE or DELETE query with JOIN that SQLite doesn’t support (nor does the plugin). I will try it with WooCommerce too and get these errors fixed this week. Thanks for the report!".

Thanks so much for looking at this @JanJakes!

JanJakes commented 2 months ago

@paulopmt1 I prepared a pull request with the fixes, and there is a build that you can try already. This is likely to be included in the MailPoet release next week.

paulopmt1 commented 2 months ago

Applying the trunk SQLite + the recent Mailpoet version worked perfectly @JanJakes. Thanks for fixing it!

image

Do we know when we'll have a release of that trunk SQLite?

aristath commented 2 months ago

New version of the SQLite plugin was just released 👍

katinthehatsite commented 2 months ago

Thank you for the fix @JanJakes and for investigation @paulopmt1 ! I tested everything once again and I am not seeing the issue anymore 🥳