we-bridge / vagrant-ansible-symfony

A template Vagrant Symfony2 project setup, supporting mixed Linux/OSX/Windows host environments
7 stars 5 forks source link

Text file busy and NO MORE HOSTS Left messages #24

Open cAstraea opened 8 years ago

cAstraea commented 8 years ago

Hello , didn't have this issue before . I tried to replace the APPNAME with a new project to test , when doing the provision it fails. I'm seeing this for the task where it replaces the username and password in the parameters.yml ==> default: failed: [[default] vagrant-ubuntu-trusty-64](item={u'key': u'database_password', u'value': u'vagrant'}) => {"failed": true, "item": {"key": "database_password", "value": "vagrant"}, "msg": "Could not replace file: /tmp/tmpZlHQVM to /vagrant/skoazell/app/config/parameters.yml: [Errno 26] Text file busy"}

and the next thing after it's ==> default: NO MORE HOSTS LEFT (what does this even mean? )

The machine boots up but the appname folder is not mounted up to /var/www , when I go to localhost:8080 I see the default ubuntu index.html.

thomas-barthelemy commented 8 years ago

==> default: NO MORE HOSTS LEFT (what does this even mean? )

Ansible allows to do the provisioning on multiple hosts, it's just telling you it tried to provision on all the given hosts (only one in that case).

[Errno 26] Text file busy

This would tend to mean the given file parameters.yml is locked by another app preventing ansible from overwriting its content. Can you remove that file manually to check if it's not locked. You can also check from withing the VM (using vagrant ssh) to check if the directories access rights are sufficient (if not it would come from the share used).

You can leave some more info on your current host system (OS / version) which would help understand what's happening.

cAstraea commented 8 years ago

Hello , I'm on windows 10 64 bit Vagrant version 1.8.1 Ansible version inside the guest is ansible 2.0.2.0

Checked the rights , seems ok deleted the parameters.yml and it got recreated by vagrant up but the password and user don't get replaced

This is the last think I see in the terminal

==> default: failed: [[default] vagrant-ubuntu-trusty-64] (item={u'key': u'database_user', u'value': u'vagrant'}) => {"failed": true, "item": {"key": "database_user", "value": "vagrant"}, "msg": "Could not replace file: /tmp/tmp9gOiJl to /vagrant/skoazell/app/config/parameters.yml: [Errno 26] Text file busy"} ==> default: failed: [[default] vagrant-ubuntu-trusty-64] (item={u'key': u'database_password', u'value': u'vagrant'}) => {"failed": true, "item": {"key": "database_password", "value": "vagrant"}, "msg": "Could not replace file: /tmp/tmp4HienR to /vagrant/skoazell/app/config/parameters.yml: [Errno 26] Text file busy"} ==> default: ==> default: NO MORE HOSTS LEFT ************************************************************* ==> default: to retry, use: --limit @/vagrant/provisioning/site.retry ==> default: ==> default: PLAY RECAP ********************************************************************* ==> default: [default] vagrant-ubuntu-trusty-64 : ok=21 changed=2 unreachable=0 failed=1 The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.

No idea why the file would be busy it's not opened in anything on my side ?

thomas-barthelemy commented 8 years ago

I've just ran a clean vagrant up on a machine with the same config as yours, and this step did not give any error. on a side note I did have an error on the composer install and re-running a vagrant provision after the first vagrant up fixes it. We have another internal repository with a backend template that we use and does not have those issue (and uses php7/symfony3) but it isn't on github yet, I'll try to set-up an auto-push this week. you can consider the following to help you find why it wouldn't work:

1 - vagrant destroy 2 - git reset --hard origin/master && git clean -df This will clean and reset the whole folder to this repository if still linked, careful for you changes 3 - Reboot (have u tried turning it off and back on again #itcrowd) 4 - disable any 3rd party firewall you might have (who knows) 5 - vagrant up