vagrant provision give me
unable to connect to database, I’ve tried to leave the default values in vault.yml and wordpress_sites.yml
but the vagrant machine ins’t accessible
Any idea?
This is the error:
unable to connect to database, check login_user and login_password are
correct or /root/.my.cnf has the credentials. Exception message: (2002,
“Can’t connect to local MySQL server through socket
‘/var/run/mysqld/mysqld.sock’ (111)”)
failed: [default] (item=default) => {“changed”: false, “item”: “default”}
unable to connect to database, check login_user and login_password are
correct or /root/.my.cnf has the credentials. Exception message: (2002,
“Can’t connect to local MySQL server through socket
‘/var/run/mysqld/mysqld.sock’ (111)”)
failed: [default] (item=127.0.0.1) => {“changed”: false, “item”: “127.0.0.1”}
unable to connect to database, check login_user and login_password are
correct or /root/.my.cnf has the credentials. Exception message: (2002,
“Can’t connect to local MySQL server through socket
‘/var/run/mysqld/mysqld.sock’ (111)”)
failed: [default] (item=::1) => {“changed”: false, “item”: “::1”}
unable to connect to database, check login_user and login_password are
correct or /root/.my.cnf has the credentials. Exception message: (2002,
“Can’t connect to local MySQL server through socket
‘/var/run/mysqld/mysqld.sock’ (111)”)
failed: [default] (item=localhost) => {“changed”: false, “item”: “localhost”}
to retry, use: --limit @/home/luke/dev/projects/pedroripolgroup.com/trellis/dev.retry
PLAY RECAP *********************************************************************
default : ok=31 changed=0 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
It is a new installation (I reinstalled twice for differents problems)
I runned first vagrant up and the virtual machine starts without problems and I can ssh in it
Then I runned vagrant provision and the error appears
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/li
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [ERROR] InnoDB: Cannot open datafile ‘./ibdata1’
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data fil
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [Note] InnoDB: Starting shutdown…
May 17 12:37:13 example mysqld[7730]: 2018-05-17 12:37:13 139751284500672 [ERROR] Plugin ‘InnoDB’ init function returned error.
May 17 12:37:13 example systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Job for mariadb.service failed because a fatal signal was delivered causing the control process to dump core. See “systemctl status mariadb.service” and “journalctl -xe” for details.
I tried to remove Maria Db but the machine crashed and after that looks like corrupted;
I tryend vagrant halt and vagrant up but nothing happened.
So I run vagrant destroy and than vagrant up
and it created the machine with this error:
** [WARNING]: - composer was NOT installed successfully: Failed to get data from
the API server (https://galaxy.ansible.com/api/): Failed to connect to galaxy.ansible.com at port 443: [Errno -2] Name or service not known
ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
**
anyway I tried to vagrant provision and this was the error:
Composer could not find a composer.json file in /srv/www/example.com/current
To initialize a project, please create a composer.json file as described in
the https://getcomposer.org/ “Getting Started” section
failed: [default] (item=example.com) => {“changed”: false, “item”: “example.com”, “stdout”: “Composer could not find a composer.json file in /srv/www/example.com/current\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section\n”, “stdout_lines”: [“Composer could not find a composer.json file in /srv/www/example.com/current”, “To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section”]}
Note I installed composer through brew (linuxbrew)
(Warning: composer 1.6.5 is already installed and up-to-date
To reinstall 1.6.5, run `brew reinstall composer)
Looks like you’re running into a lot of unusual errors
That Composer issue was definitely just a network connectivity one which can obviously happen but we can’t do much about it. But as you saw, you won’t be able to provision properly without Composer installed and working.
I can only suggest the usual vagrant destroy && vagrant up solution. If any errors happen during that process, it’s likely it won’t work properly.
So I tried and tried and that is what I’ve understood:
my linux partition is encrypted and whenever I vagrant Up I get an NFS problem. (its a common issue and I have no idea how to solve it)
So I tried to move my dev directory in a secondary HD; I destroy the vm and I vagrant up again but I am getting a composer error
Blockquote
Composer could not find a composer.json file in /srv/www/mush- shop.com/current To initialize a project, please create a composer.json file
as described in the https://getcomposer.org/ “Getting Started” section
failed: [default] (item=mush-shop.com) => {“changed”: false, “item”: “mush-shop.com”, “stdout”: “Composer could not find a composer.json file in /srv/www/mush-shop.com/current\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section\n”, “stdout_lines”: [“Composer could not find a composer.json file in /srv/www/mush-shop.com/current”, “To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section”]}
Blockquote
I am thinking to give up and build manually a wordpress Virtualbox to clone when I start a new project.