laravel / homestead

MIT License
3.85k stars 1.45k forks source link

MYSQL not installing after destroy & re-provision #1024

Closed brianrivet closed 5 years ago

brianrivet commented 5 years ago

Hi, I'm having trouble with a reinstall of Homestead. I destroyed my previous box after it went down for some reason, and when I tried to up and re-provision it . says that it is configuring mysql server and purging the old mysql config. It asks if I want to remove all MySQL databases, which appears to autoselect no and continue, but then the install hangs up when saying it is removing the old configs. It doesn't give an error, but it just sits with no prompt or updates. If I hit cntrl-c to exit, it gives me a list of errors. I've tried removing all of the VMs from virtualbox and starting over, but nothing has worked so far.

Versions

A lot of issues can be resolved by simply updating vagrant, provider or homestead.

Note: Virtualbox users, please upgrade to ~5.2. You will show as up-to-date from the ~5.0 version when you About -> Check for Updates. You'll need to download a newer version of Virtualbox.

Host operating system

Mac OS 10.14.2

Homestead.yaml

---
ip: "192.168.10.10"
memory: 4096
cpus: 1
provider: virtualbox
mariadb: true

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Users/Brian/WebDev/sites
      to: /home/vagrant/sites
      type: nfs

    - map: /Users/Brian/Homestead/setup
      to: /home/vagrant/setup
      type: nfs

    - map: /Users/Brian/generator-craftinstall
      to: /home/vagrant/generator-craftinstall
      type: nfs

    - map: /Users/Brian/webbackups
      to: /home/vagrant/backups
      type: nfs

sites:
    - map: jhasafety.dev
      to: /home/vagrant/sites/jhasafety/public

    - map: lpb.build
      to: /home/vagrant/sites/lpb/public

    - map: almagrown.dev
      to: /home/vagrant/sites/almagrown/html

    - map: simplifiedpro.build
      to: /home/vagrant/sites/simplifiedpro/public

    - map: craft3.base
      to: /home/vagrant/sites/craft3base/web

    - map: craft2test.build
      to: /home/vagrant/sites/craft2test/public

    - map: walk-ons.build
      to: /home/vagrant/sites/walkons/public

    - map: manners2018.build
      to: /home/vagrant/sites/manners2018/web

    - map: manners2018.craft2
      to: /home/vagrant/sites/manners2018c2/public

    - map: leanweb.build
      to: /home/vagrant/sites/leanweb/web

    - map: odyssey.build
      to: /home/vagrant/sites/odyssey/web

databases:
    - homestead
    - jhasafety
    - lpb
    - almagrown
    - simplifiedpro
    - manners2018
    - manners2018c2
    - craft2base
    - craft3base
    - walkons
    - leanweb
    - odyssey

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

Vagrant destroy & up output

https://gist.github.com/brianrivet/fb8bde0a1aa2972c3ceb168d7a97f992

Expected behavior

I expected Homestead to complete the installation at which point I can use the VM. I should be able to connect to the server via ssh and connect to databases via ssh in Sequel Pro.

Actual behavior

Homestead appears to hang up during the installation, at the point when it is supposed to be setting up MySQL. I can SSH into homestead from the command line, but I cannot connect to MySQL via Sequel Pro. I have run into an issue in the past where Apparmor was preventing MariaDB from running, but this doesn't appear to be the issue here. I've tried this fix for that issue () and it had no effect. Also, when I try to re-provision, It says MariaDB is installed, but then I get this error:

 homestead-7: ERROR
    homestead-7:  2002 (HY000)
    homestead-7: : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I checked the location referenced in the error and the file doesn't exist. I also tried starting mysql using "sudo /etc/init.d/mysql start" and it returned that the command was not found. I also tried to run "sudo /usr/bin/mysql start" and itr gave me this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I remember running into a similar problem before (although it didn't hang up during install) that is referenced here: https://askubuntu.com/questions/750604/why-does-mariadb-keep-dying-how-do-i-stop-it

I tried the solution described there and it still had no success (It did work in the past when I ran into this problem).

Steps to reproduce

  1. destroy/remove homestead vm
  2. try to re-install
  3. provision.

References

I've referenced everything I've looked at/tried above.

martijn94 commented 5 years ago

From line # 7 in your output it seems you are running homestead version 5.2.0. I can imagine that this version is not compatible anymore with the base box. Maybe try provisioning again with the latest version (7.20.0) ?

brianrivet commented 5 years ago

Thanks! It looks like that may have been the problem.