Obscure mysql error when trying to start site

Bug Summary

I’ve been using Local successfully for a long while, but I’ve suddenly started encountering an error when I try to start any site. I’ve tried reinstalling, updating, starting from blueprint and from scratch, creating the mysqld.sock file, all to no avail.

Here’s the error I’m seeing:

I’ve also noticed this only happens when I try to create a site with MySQL 8.*. If I try an older version it doesn’t happen.

Steps to reproduce

It happens when I try to start any site.

Environment Info

Describe your environment.

  • What Operating System are you using?
    Ubuntu
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used?
    It occurs with version Mysql 8.*
  • What version of Local is installed?
    9.0.3

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

Here’s the log file(s)

{"class":"Process","level":"warn","message":"nginx: [emerg] bind() to [::1]:10008 failed (99: Cannot assign requested address)","process":"nginx","thread":"main","timestamp":"2024-06-18T20:22:19.069Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.187157Z 0 [System] [MY-010116] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld (mysqld 8.0.16) starting as process 10124","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:19.454Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.187871Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:19.454Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.454237Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:19.454Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.454338Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:19.455Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.454339Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 10009 ?","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:19.455Z"}
{"class":"Process","level":"warn","message":"nginx: [emerg] bind() to [::1]:10008 failed (99: Cannot assign requested address)","process":"nginx","thread":"main","timestamp":"2024-06-18T20:22:19.577Z"}
{"class":"Process","level":"warn","message":"nginx: [emerg] bind() to [::1]:10008 failed (99: Cannot assign requested address)","process":"nginx","thread":"main","timestamp":"2024-06-18T20:22:20.085Z"}
{"class":"Process","level":"warn","message":"nginx: [emerg] bind() to [::1]:10008 failed (99: Cannot assign requested address)","process":"nginx","thread":"main","timestamp":"2024-06-18T20:22:20.592Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:19.454428Z 0 [ERROR] [MY-010119] [Server] Aborting","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:21.370Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:21.370141Z 0 [System] [MY-010910] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:21.370Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.027073Z 0 [System] [MY-010116] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld (mysqld 8.0.16) starting as process 10181","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:22.272Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.027596Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:22.272Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.271670Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:22.272Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.271766Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:22.272Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.271767Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 10009 ?","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:22.272Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:22.271842Z 0 [ERROR] [MY-010119] [Server] Aborting","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:23.682Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:23.681841Z 0 [System] [MY-010910] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:23.682Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.367189Z 0 [System] [MY-010116] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld (mysqld 8.0.16) starting as process 10228","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:24.606Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.367670Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:24.606Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.605601Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:24.606Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.605698Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:24.606Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.605699Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 10009 ?","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:24.607Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:24.605772Z 0 [ERROR] [MY-010119] [Server] Aborting","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.017Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.016894Z 0 [System] [MY-010910] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.018Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.719068Z 0 [System] [MY-010116] [Server] %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqld (mysqld 8.0.16) starting as process 10281","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.960Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.719521Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.960Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.959622Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.960Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.959714Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.960Z"}
{"class":"Process","level":"warn","message":"2024-06-18T20:22:26.959715Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 10009 ?","process":"mysql","thread":"main","timestamp":"2024-06-18T20:22:26.961Z"}
{"level":"error","message":"Database did NOT respond to ping after 15 tries.","service":{},"serviceBinVersion":{},"stack":"Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqladmin ping\n\u0007mysqladmin: connect to server at 'localhost' failed\nerror: 'Can't connect to local MySQL server through socket '%%site.runData%%/mysql/mysqld.sock' (2)'\nCheck that mysqld is running and that the socket: '%%site.runData%%/mysql/mysqld.sock' exists!\n\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:517:28)\n    at maybeClose (node:internal/child_process:1098:16)\n    at Socket.<anonymous> (node:internal/child_process:450:11)\n    at Socket.emit (node:events:517:28)\n    at Pipe.<anonymous> (node:net:350:12)","thread":"main","timestamp":"2024-06-18T20:22:27.120Z"}
{"class":"SiteProcessManagerService","level":"error","message":"Unable to start site.","stack":"Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqladmin ping\n\u0007mysqladmin: connect to server at 'localhost' failed\nerror: 'Can't connect to local MySQL server through socket '%%site.runData%%/mysql/mysqld.sock' (2)'\nCheck that mysqld is running and that the socket: '%%site.runData%%/mysql/mysqld.sock' exists!\n\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:517:28)\n    at maybeClose (node:internal/child_process:1098:16)\n    at Socket.<anonymous> (node:internal/child_process:450:11)\n    at Socket.emit (node:events:517:28)\n    at Pipe.<anonymous> (node:net:350:12)","thread":"main","timestamp":"2024-06-18T20:22:27.120Z"}
{"class":"SiteProvisionerService","level":"error","message":"Unable to provision site.","stack":"Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqladmin ping\n\u0007mysqladmin: connect to server at 'localhost' failed\nerror: 'Can't connect to local MySQL server through socket '%%site.runData%%/mysql/mysqld.sock' (2)'\nCheck that mysqld is running and that the socket: '%%site.runData%%/mysql/mysqld.sock' exists!\n\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:517:28)\n    at maybeClose (node:internal/child_process:1098:16)\n    at Socket.<anonymous> (node:internal/child_process:450:11)\n    at Socket.emit (node:events:517:28)\n    at Pipe.<anonymous> (node:net:350:12)","thread":"main","timestamp":"2024-06-18T20:22:28.732Z"}
{"eventId":"600924e26eb940879ca68c12e91e0029","level":"warn","message":"Unhandled Rejection.","p":{},"reason":{"cmd":"%%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysqladmin ping","code":1,"killed":false,"signal":null},"thread":"main","timestamp":"2024-06-18T20:22:29.868Z"}

Hi @joelclimbsthings

When you’re creating a site with MySQL 8 are you using a specific PHP version? Or do you get the same error no matter what version you select?

Hi @Nick-B ,

It doesn’t seem to be influenced by the PHP version, only the MySQL version. If I use a version of MySQL other than 8.0.16 then I can create the site without error, but it doesn’t actually work (404’s for both admin and site). Any site with 8.0.16 throws the above error.

What about changing your Router Mode? Does that have any impact? Some of the errors in your logs may indicate a port conflict.

Preferences>Advanced>Router Mode

I’ve usually used localhost as I’ve always had conflicts with using custom domains for each site. That said, I just switched and still receive the same error message no matter the routing mode.

The only combination I’ve found that results in a working site is MySQL 5 and Apache, as for some reason using nginx I was able to create a site, but it was broken (not resolving).

Are you running other developer applications simultaneously? Apps like MAMP, XAMPP, or Docker for example.

I have, although I’ve also shut down any processes that have open ports and still encountered the same error. :person_shrugging:

Hi @joelclimbsthings

Could you share your full logs here so we can review those? There are some different ways to access and share Local Logs. For us to be able to troubleshoot thoroughly, please click the Download Local Logs button from the Support tab in Local. This will generate a zip archive that contains the Local log along with some other diagnostic information to help quickly zero in on any issues that Local is encountering.

Yup, I can do that. Note that there are a few older router logs pointing to a failure to bind, but they seem to be unrelated to this issue.

local-logs.zip (79.4 KB)

Thanks!
Joel T