Vvv: Getting this error /tmp/vagrant-shell: line 11: git: command not found

Created on 7 May 2017  路  20Comments  路  Source: Varying-Vagrant-Vagrants/VVV

Hi there!

I've just installed VVV and tried vagrant up but getting errors. Here is the problem I'm getting:

==> default: Downloading core resources, see https://github.com/Varying-Vagrant-Vagrants/vvv-utilities.git
==> default: /tmp/vagrant-shell: line 11: git: command not found
==> default: /tmp/vagrant-shell: line 12: cd: /vagrant/provision/resources/core: No such file or directory
==> default: /tmp/vagrant-shell: line 13: git: command not found
==> default: Running provisioner: utility-core-memcached-admin (shell)...
    default: Running: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/vagrant-shell20170507-2046-1j6bbuy.sh
==> default: Running provisioner: utility-core-opcache-status (shell)...
    default: Running: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/vagrant-shell20170507-2046-hxkpx8.sh
==> default: Running provisioner: utility-core-phpmyadmin (shell)...
    default: Running: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/vagrant-shell20170507-2046-ibh0c4.sh
==> default: Running provisioner: utility-core-webgrind (shell)...
    default: Running: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/vagrant-shell20170507-2046-3cx05e.sh
==> default: Running provisioner: site-wordpress-default (shell)...
    default: Running: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/vagrant-shell20170507-2046-pmd0n9.sh
==> default: Downloading wordpress-default, see https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
==> default: /tmp/vagrant-shell: line 47: git: command not found
==> default: find: 
==> default: `/srv/www/wordpress-default'
==> default: : No such file or directory
==> default: nginx: unrecognized service
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.

I can run vagrant destroy with no problem. I can run git on my machine.

My environment is the following:
VVV version: 2.0.0
Vagrant version: 1.9.4
VM Provider name: VirtualBox
VM Provider version: 5.1
Operating System and version: macOS Sierra 10.12.4

Hope someone could help me.

bug testing support

Most helpful comment

@jbarbaran can you reprovision? If it doesn't solve the problem can you copy the entire log output not just the final part into a gist and post the link?

vagrant reload --provision

All 20 comments

Any idea someone?

Thanks!

@jbarbaran can you reprovision? If it doesn't solve the problem can you copy the entire log output not just the final part into a gist and post the link?

vagrant reload --provision

@tomjn I've just done it with same result. Thank you anyway.

Not sure, but it seems related to network conectivity on the VM, but I haven't got a clue. I also tried different versions of Virtualbox and reinstalled vagrant, with no luck.

Here is the whole output (vagrant up + vagrant reload --provision):

```
MacBook-Air-de-Juan:vagrant-local javier.barbaran$ vagrant up

__ ___ ___ __ ____
\ \ / \ \ / \ \ / / |___ \
\ \ / / \ \ / / \ \ / / __) |
\ V / \ V / \ V / / __/
_/ _/ _/ |_____|

Varying Vagrant Vagrants 2.0.0

Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: vagrant-local
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.36
default: VirtualBox Version: 5.1
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater] 192.168.50.4 vvv # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 vvv.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 local.wordpress.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 src.wordpress-develop.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 build.wordpress-develop.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
Password:
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local
default: /srv/www => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/www
default: /srv/log => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/log
default: /srv/config => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/config
default: /srv/database => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/database
==> default: Running provisioner: fix-no-tty (shell)...
default: Running: inline script
==> default: Running provisioner: default (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-1mrz901.sh
==> default: Network connection not detected. Unable to reach google.com...
==> default: No network connection available, skipping package installation
==> default: Running provisioner: utility-source-core (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-p09nb4.sh
==> default: Downloading core resources, see https://github.com/Varying-Vagrant-Vagrants/vvv-utilities.git
==> default: /tmp/vagrant-shell: line 11: git: command not found
==> default: /tmp/vagrant-shell: line 12: cd: /vagrant/provision/resources/core: No such file or directory
==> default: /tmp/vagrant-shell: line 13: git: command not found
==> default: Running provisioner: utility-core-memcached-admin (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-1scikhr.sh
==> default: Running provisioner: utility-core-opcache-status (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-gacgqx.sh
==> default: Running provisioner: utility-core-phpmyadmin (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-1jfjycn.sh
==> default: Running provisioner: utility-core-webgrind (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-enrea7.sh
==> default: Running provisioner: site-wordpress-default (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18293-yy26eg.sh
==> default: Downloading wordpress-default, see https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
==> default: /tmp/vagrant-shell: line 47: git: command not found
==> default: find:
==> default: `/srv/www/wordpress-default'
==> default: : No such file or directory
==> default: nginx: unrecognized service
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.
MacBook-Air-de-Juan:vagrant-local javier.barbaran$ vagrant reload --provision

__ ___ ___ __ ____
\ \ / \ \ / \ \ / / |___ \
\ \ / / \ \ / / \ \ / / __) |
\ V / \ V / \ V / / __/
_/ _/ _/ |_____|

Varying Vagrant Vagrants 2.0.0

Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv

==> default: Running triggers before reload...
bash: vagrant_halt: command not found
Connection to 127.0.0.1 closed.
==> default: [vagrant-hostsupdater] Removing hosts
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.36
default: VirtualBox Version: 5.1
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater] 192.168.50.4 vvv # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 vvv.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 local.wordpress.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 src.wordpress-develop.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] 192.168.50.4 build.wordpress-develop.dev # VAGRANT: b75bb64c0b0c1dc82a60b2f2e6d6b09f (default) / 75295433-e287-45e4-9ea4-b85f3ff9d7c6
==> default: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local
default: /srv/www => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/www
default: /srv/log => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/log
default: /srv/config => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/config
default: /srv/database => /Users/javier.barbaran/Documents/wordpress-dev/vagrant-local/database
==> default: Running provisioner: fix-no-tty (shell)...
default: Running: inline script
==> default: Running provisioner: default (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-12omayq.sh
==> default: Network connection not detected. Unable to reach google.com...
==> default: No network connection available, skipping package installation
==> default: Running provisioner: utility-source-core (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-14plwfa.sh
==> default: Downloading core resources, see https://github.com/Varying-Vagrant-Vagrants/vvv-utilities.git
==> default: /tmp/vagrant-shell: line 11: git: command not found
==> default: /tmp/vagrant-shell: line 12: cd: /vagrant/provision/resources/core: No such file or directory
==> default: /tmp/vagrant-shell: line 13: git: command not found
==> default: Running provisioner: utility-core-memcached-admin (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-xyca19.sh
==> default: Running provisioner: utility-core-opcache-status (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-7a8tp1.sh
==> default: Running provisioner: utility-core-phpmyadmin (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-j5fsrn.sh
==> default: Running provisioner: utility-core-webgrind (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-1blxjxq.sh
==> default: Running provisioner: site-wordpress-default (shell)...
default: Running: /var/folders/d3/000g94dd7nn8wlg07tn44mtw0000gp/T/vagrant-shell20170514-18423-i21gtz.sh
==> default: Downloading wordpress-default, see https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
==> default: /tmp/vagrant-shell: line 47: git: command not found
==> default: find:
==> default: /srv/www/wordpress-default
==> default: : No such file or directory
==> default: nginx: unrecognized service
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.
````

The vagrant box is not able to connect to the internet

==> default: Network connection not detected. Unable to reach google.com...
==> default: No network connection available, skipping package installation

Can you try running vagrant box update then running the provisioning again?

Then post the logs again (in a gist linked here please) and a screenshot of the box settings in virtualbox.

@LoreleiAurora yes, I checked th output and I noticed that there is something with the Internet connection on the VM. I have followed your advise with no luck, when I run the box update I'm getting the following:


MacBook-Air-de-Juan:vagrant-local javier.barbaran$ vagrant box update


  __     ___     ___     __  ____    
  \ \   / \ \   / \ \   / / |___ \   
   \ \ / / \ \ / / \ \ / /    __) |  
    \ V /   \ V /   \ V /    / __/   
     \_/     \_/     \_/    |_____|  

  Varying Vagrant Vagrants 2.0.0

  Docs:       https://varyingvagrantvagrants.org/
  Contribute: https://github.com/varying-vagrant-vagrants/vvv



==> default: Checking for updates to 'ubuntu/trusty64'
    default: Latest installed version: 20170509.0.0
    default: Version constraints: 
    default: Provider: virtualbox
==> default: Box 'ubuntu/trusty64' (v20170509.0.0) is running the latest version.

And afterwards and did the provisioning and up, getting the same error I posted first.

I'm having this same problem in a clean environment, and I tried other local environment based in vagrants like Salty WordPress and this does not happens with them.
Any idea, please?

==> default: Running provisioner: fix-no-tty (shell)...
    default: Running: inline script
==> default: Running provisioner: default (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-1u2lx09.sh
==> default: Network connection not detected. Unable to reach google.com...
==> default: No network connection available, skipping package installation
==> default: Running provisioner: utility-source-core (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-19yii4t.sh
==> default: Downloading core resources, see https://github.com/Varying-Vagrant-Vagrants/vvv-utilities.git
==> default: /tmp/vagrant-shell: line 11: git: command not found
==> default: /tmp/vagrant-shell: line 12: cd: /vagrant/provision/resources/core: No such file or directory
==> default: /tmp/vagrant-shell: line 13: git: command not found
==> default: Running provisioner: utility-core-memcached-admin (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-1vc9obt.sh
==> default: Running provisioner: utility-core-opcache-status (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-pm1aph.sh
==> default: Running provisioner: utility-core-phpmyadmin (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-1drxg6m.sh
==> default: Running provisioner: utility-core-webgrind (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-9ifiud.sh
==> default: Running provisioner: site-wordpress-default (shell)...
    default: Running: /var/folders/k4/268rg5xd6_b8080x2p9y50z00000gn/T/vagrant-shell20170606-4971-kk4m7v.sh
==> default: Downloading wordpress-default, see https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
==> default: /tmp/vagrant-shell: line 47: git: command not found
==> default: find:
==> default: `/srv/www/wordpress-default'
==> default: : No such file or directory
==> default: nginx: unrecognized service
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.

I had the same issue. Disabling the Mac OS firewall fixed it.

My firewall is off, but getting the same result, not working :-(

@jbarbaran Did you find a fix for this? I've been experiencing a similar issue.

@jondueck No, none of the solutions worked for me. Last week I got an upgrade for MacOS, I'll try again just to check if it is something related to the OS version, but I don't think it is going to make much difference.
I'm considering on moving to a docker-based solution. Probably is not as well integrated in order to contribute to Wordpress, but it has taken me a lot of time with no results.

I encountered the same issue today after running an ubuntu update within the virtual machine. As a result I got the same unrecognised service error, my instance was complaining about git not being available.

I ended up following @MrVibe's solution from https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1043#issuecomment-266745833 and completely reinstalled my VVV聽installation.

was having this issue before:
Network connection not detected. Unable to reach google.com...
Tried to run:
vagrant box update
as @LoreleiAurora suggested and tried
vagrant up --provision
this solution did work for me.

@jbarbaran @jondueck

I was having this same issue, I just installed git and tried the vagrant reload --provision command and that worked for this particular issue. Now I'm fighting against other issues that came up

  1. SSH into the vagrant box.
  2. enter sudo apt-get install git and install the package (Y).
  3. exit the vagrant box and enter vagrant reload --provision
vagrant up
vagrant ssh
sudo apt-get install git
exit
vagrant reload --provision

I would advise if your VVV box has Ubuntu updates, that it's the Vagrant box, not the VMs internals that need updating. Updated versions of the box contain all of the updates

@LoreleiAurora could this be related to the unknown job issue #1379 ?

I was getting the same errors with other package not installed.
Later I discovered that the reason was my provision-custom.sh file that wasn't executing provision.sh.

@Mte90 any clues as to why that might be happening?

In my case was a custom script executed that wasn't including the standard provisioning so git wasn't installed on the machine.
I think that on first run of provision is better to check to not execute the custom but the original one to have everything in the machine but I guess that 3.x will fix this if we will have a vm that contains everything.

That would certainly cause this, though the other logs report it's a problem with network connectivity

I'm going to close this for now

@ArianJM thanks, that suggestion to ssh into vagrant and manually install git, worked for me

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings