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


#1

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.


#2

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?


#3

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


#4

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


#5

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!


#6

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


#7

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


#8

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


Stop working on mac?
#9

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.


Error Establishing Database Connections
WordPress Installation Fails and can't connect to Database
Stuck on Provisioning (Installing WordPress)
Critical error when stopping a site, now Local has completely stopped working
#10

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.


#11

This is what happened when I tried.

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


#12

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


#13

@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
0%…
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
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Oracle VM VirtualBox Command Line Management Interface Version 6.0.6
© 2005-2019 Oracle Corporation
All rights reserved.
Usage:
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
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…
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
© 2005-2019 Oracle Corporation
All rights reserved.
Usage:
VBoxManage storageattach <uuid|vmname>

VBoxManage: error: Invalid parameter ‘1’

Still no joy.


#14

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.


#15

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!


#16

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.