Uh-oh! Unable to start site on large multisite: mysqld not ready before ping gives up (10.2.x, MySQL 8.0.35+4)

Bug Summary

Starting a large multisite (100+ sub-sites) fails with “Uh-oh! Unable to start site.” because mysqladmin ping can’t connect to the socket. mysqld does start, but it isn’t ready before Local stops pinging, so the site never starts.

This is the same behavior I reported earlier ( https://community.localwp.com/t/uh-oh-unable-to-provision-site-on-large-multisite-setup/46050 ), which has resurfaced in Local 10.2.x with the bundled MySQL 8.0.35+4. A fix was provided which worked for a long time, but now it resurfaced, and I think it happended with v10.2.

Steps to reproduce

  1. Open a multisite with 100+ sub-sites.
  2. Start (or stop and start) the site.
  3. Local shows “Unable to start site.”

Environment Info

  • macOS: [version]
  • Local: [10.2.x + build]
  • Web server / PHP: [e.g. Nginx, PHP 8.x]
  • MySQL: 8.0.35+4
  • Site: multisite, 100+ sub-sites [approx. DB size]

Supporting info

Error shown:

Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.35+4/bin/darwin/bin/mysqladmin ping
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘%%site.runData%%/mysql/mysqld.sock’ (2)’
Check that mysqld is running and that the socket exists!

  • Other single sites and multisites start fine; only the very large multisites are affected.
  • [Log line “Database did NOT respond to ping after 15 tries”, if present. Also whether mysqld shows in Activity Monitor afterwards.]
  • Screenshot and Local logs (Support > Download Local Logs) attached.

Please could you share your full logs, @peroks? They contain timing data that may help us to see how long MySQL is taking to start for you.

(Local → Help → Download Local logs.)

We already extended MySQL startup wait significantly, but your logs may help to show if we need to extend it even further to help with large databases like the one you mention.

local-logs.zip (1.3 MB)

Thanks for these logs, @peroks. They show this particular database has grown to exceed Local’s newer timeout. (The database takes about 80 seconds to start.)

We’d need to lengthen Local’s timeout further to help with cases like this. I’ve logged this with our team but don’t yet know when it will be fixed. Thank you for reporting it to us and sorry not to have a quick workaround for you this time.