Unable to connect to database on any site previously working working without issue

For some reason I’m getting an unable to connect to database errror on every install on local. It was working fine yesterday. Any ideas what may cause this? I’ve tried rebooting.

If you right-click on any site you’re having trouble with then go to Open Site SSH and type service mysql restart what happens?

Error 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysql/mysqld.sock’ (111)

Interesting, that’s the only output after that command?

I rebooted again and got the following error
[ ok ] Stopping MySQL database server: mysqld.
[…] /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full! [FA failed!

I am seeing the same issue, any word on potential fix?

I tried deleting a few installs from my Local install (wondering if it would free up some space ) and no luck

Any update on this issue @clay? All my sites suddenly stopped working with this error :frowning:

Hey all,

I’ve created a gist to help out with this: https://gist.github.com/claygriffiths/fd270f45d82da6feefd723c4fce5a4d7

You can download and run this shell script (it will resize it from 20G to 50G). You may need to change VM_NAME to pressmatic if you used Pressmatic previously.

After you execute the script you must follow the steps starting after to take advantage of the new size. # Install GParted on your boot2docker vm:

If anyone gets stuck please let me know.


Hi Clay!

Thanks for the script! After some time I’ve deleted Virtual box from my Mac and when restarting Local it installed it again. After that the sites were working again.

Maybe it’s just a coincidence but I though others may try this too.

1 Like

This is what happened when I tried.

‘service’ is not recognized as an internal or external command,
operable program or batch file.

Awesome @clay, this worked perfectly. Instructions aren’t 100% clear, but possible to follow :slight_smile:

@clay I have suddenly run into this issue. I’ve tried the script but it errors.

$ /Users/afragen/Downloads/resize_local_machine.sh
/Users/afragen/Downloads/resize_local_machine.sh: line 15: /Users/afragen/Applications/Local%20by%20Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine: No such file or directory
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to clone medium
VBoxManage: error: Could not create the clone medium ‘/Users/afragen/.docker/machine/machines/local-by-flywheel/disk.vdi’.
VBoxManage: error: VDI: cannot create image ‘/Users/afragen/.docker/machine/machines/local-by-flywheel/disk.vdi’ (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage: error: Context: “RTEXITCODE handleCloneMedium(HandlerArg *)” at line 1023 of file VBoxManageDisk.cpp
Oracle VM VirtualBox Command Line Management Interface Version 6.0.6
(C) 2005-2019 Oracle Corporation
All rights reserved.
VBoxManage storageattach <uuid|vmname>

VBoxManage: error: Invalid parameter ‘1’

Now I’m stuck and can’t access any site. Help please.

$ ls -la /Users/afragen/.docker/machine/machines/local-by-flywheel/
total 68011712
drwx------ 14 afragen staff 448 Apr 20 10:02 .
drwx------ 3 afragen staff 96 Mar 9 2017 …
-rw------- 1 afragen staff 50331648 Nov 1 18:41 boot2docker.iso
-rw-r–r-- 1 afragen staff 1038 Jul 3 2018 ca.pem
-rw-r–r-- 1 afragen staff 1078 Jul 3 2018 cert.pem
-rw------- 1 afragen staff 3031 Apr 20 10:02 config.json
-rw------- 1 afragen staff 15719202816 Apr 20 09:57 disk.vdi
-rw------- 1 afragen staff 19034996736 Apr 20 10:02 disk.vmdk
-rw------- 1 afragen staff 1675 Mar 9 2017 id_rsa
-rw------- 1 afragen staff 381 Mar 9 2017 id_rsa.pub
-rw------- 1 afragen staff 1675 Jul 3 2018 key.pem
drwx------ 6 afragen staff 192 Apr 20 10:02 local-by-flywheel
-rw------- 1 afragen staff 1679 Jul 3 2018 server-key.pem
-rw-r–r-- 1 afragen staff 1123 Jul 3 2018 server.pem

I backed up and removed disk.vdi and re-ran the script the following is the result.

$ /Users/afragen/Downloads/resize_local_machine.sh
/Users/afragen/Downloads/resize_local_machine.sh: line 15: /Users/afragen/Applications/Local%20by%20Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine: No such file or directory
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Failed to clone medium
VBoxManage: error: Cannot register the hard disk ‘/Users/afragen/.docker/machine/machines/local-by-flywheel/disk.vdi’ {6ed199a4-506e-40c9-abfe-d8ce7cd9728a} because a hard disk ‘/Users/afragen/.docker/machine/machines/local-by-flywheel/disk.vdi’ with UUID {cb4355d7-b7ff-4a8d-b5b6-d6e526e458eb} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox
VBoxManage: error: Context: “RTEXITCODE handleCloneMedium(HandlerArg *)” at line 1023 of file VBoxManageDisk.cpp
VBoxManage: error: Code NS_ERROR_ABORT (0x80004004) - Operation aborted (extended info not available)
VBoxManage: error: Context: “Resize(cbResize, pProgress.asOutParam())” at line 762 of file VBoxManageDisk.cpp
VBoxManage: error: Failed to resize medium!
Oracle VM VirtualBox Command Line Management Interface Version 6.0.6
(C) 2005-2019 Oracle Corporation
All rights reserved.
VBoxManage storageattach <uuid|vmname>

VBoxManage: error: Invalid parameter ‘1’

Still no joy.

So I ended up removing the “local-by-flywheel” vm in VirtualBox.

Restarting Local created a new “local-by-flywheel” vm with new larger size.
Then just needed to restore sites from missing site container warning.

Hey @afragen,

Were you able to get back up and running?

Feel free to drop me an e-mail at clay@getflywheel.com.

So sorry about this!

I was back up and running in no time. The only thing I think that could still use improvement is to save the Volumes Add-on data to a JSON and if that JSON exists, reload those data. This is needed for when Environment updates are done.

The issue I was having was simply running out of space in my old image. Fortunately removing the old image and recreating a new image solved the issue. Leaving everything in place made the import of “missing site containers” very easy.

Thanks for the follow-up. I hope you and your family are doing well.

For people looking for hand-holding, here is what worked for me (on OSX):

  • Stop all sites
  • Close Local
  • Open VirtualBox > right click local-by-flywheel VM > Remove > Remove Only (don’t delete files)
  • Open Local > you’ll get a “Welcome” screen > VirtualBox should have a check, Host machine won’t > Click Let’s Go > it will recreate the virtual machine > When it’s done you’ll see all your sites with a warning icon next to them > Click on each site > click “Restore” > problem solved!

The above script mostly worked for me. I got the “./resize_local_machine.sh: line 14: /Applications/Local: No such file or directory” error. So I had to stop the docker machine manually. For some reason, adding the backslashes to escape the spaces also didn’t work for me.

The GParted is also terrifying and would really benefit from an accompanying video guide.

Hi all,
Just wanted to say a big thank you to @clay and others that work on Local.
I had a wide scope of issues come up today with a big database. Issues like Local by Flywheel not starting and the Regenerating certificates loop issues. Tried a bunch of stuff and when I saw this thread, it hit me the disk could be too small and voila!

I followed the gist here and it worked great. Disk resized to 50G and Local is back up and humming.

Thank you for all the work and support on Local and here in the forum!