Page MenuHomePhabricator

Puppet::Environments::EnvironmentNotFound after `vagrant up` or `vagrant provision`
Open, Needs TriagePublic

Description

Versions

MediaWiki-Vagrant commit: dc48c03
Virtualbox: 5.2.10
Vagrant: 2.0.4
Host OS: Ubuntu 16.04.4

The error below occurs when running vagrant up for the first time, i.e. after ./setup.sh.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'debian/contrib-stretch64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'debian/contrib-stretch64' is up to date...
==> default: Setting the name of the VM: vagrant_default_1524738541438_85631
==> 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: 8080 (guest) => 8080 (host) (adapter 1)
    default: 443 (guest) => 4430 (host) (adapter 1)
    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: 5.1.30_Debian r118389
    default: VirtualBox Version: 5.2
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Running provisioner: lsb_check...
==> default: Running provisioner: file_perms...
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20180426-22248-1yl1m9i.sh
==> default: Running provisioner: puppet...
==> default: Running Puppet with environment vagrant...
==> default: /usr/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'vagrant' anywhere in the path: /vagrant/puppet/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
==> default: 	from /usr/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in `push_application_context'
==> default: 	from /usr/lib/ruby/vendor_ruby/puppet/application.rb:337:in `run'
==> default: 	from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
==> default: 	from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
==> default: 	from /usr/bin/puppet:5:in `<main>'
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.

Event Timeline

It seems that it was the Vagrant version that caused this. I downgraded to 1.9.0 (and VirtualBox 5.1.36, since Vagrant couldn't run with 5.2) and vagrant up ran without problems.

Vvjjkkii renamed this task from vagrant up: Could not find a directory environment named 'vagrant' anywhere in the path to y5daaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from y5daaaaaaa to vagrant up: Could not find a directory environment named 'vagrant' anywhere in the path.Jul 2 2018, 4:36 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Seems to have something to do with NFS. Any action that tries to interact with NFS folders (e.g. ls /vagrant freezes and does not react to SIGTERM even).

zeljkofilipin renamed this task from vagrant up: Could not find a directory environment named 'vagrant' anywhere in the path to Could not find a directory environment named 'vagrant' anywhere in the path: /vagrant/puppet/environments. Does the directory exist?.Mar 6 2019, 10:31 AM
zeljkofilipin renamed this task from Could not find a directory environment named 'vagrant' anywhere in the path: /vagrant/puppet/environments. Does the directory exist? to Puppet::Environments::EnvironmentNotFound after `vagrant up`.Mar 6 2019, 11:19 AM
zeljkofilipin removed zeljkofilipin as the assignee of this task.
zeljkofilipin raised the priority of this task from Low to Needs Triage.
bd808 renamed this task from Puppet::Environments::EnvironmentNotFound after `vagrant up` to Puppet::Environments::EnvironmentNotFound after `vagrant up` or `vagrant provision`.Apr 17 2019, 8:40 PM

I ran into this one today with a fresh install:
Virtualbox: 6.1.38
Vagrant: 2.3.1
Host OS: Ubuntu 22.04.1

The complaint first occurs during vagrant up and then subsequently during vagrant provision

Looks like this might have been caused by failed nfs mounting. Setting nfs_force_v4: true in .settings.yaml might have been what allowed me to move past this post.