vvchik / vagrant-serverspec

Vagrant plugin that integrates serverspec
MIT License
191 stars 28 forks source link

Lock error #27

Closed neilhwatson closed 6 years ago

neilhwatson commented 8 years ago

This plugin always gives me the following error:

$> vagrant provision
==> default: Running provisioner: serverspec...
An action 'up' was attempted on the machine 'default',
but another process is already executing an action on the machine.
Vagrant locks each machine for access by only one process at a time.
Please wait until the other Vagrant process finishes modifying this
machine, then try again.

Using Vagrant 1.8.1 with Virtualbox 5.

Vagrant.configure(2) do |config|

  config.vm.box = "scalefactory/centos6"

   config.ssh.insert_key = false
  config.vm.provision "serverspec" do |spec|
     spec.pattern = 'spec/default/*_spec.rb'
  end

end
neilhwatson commented 8 years ago

The trouble is that by default the plugin creates the line vagrant up #{host} in spec_helper.rb, assuming that the host is not already up.

lmayorga1980 commented 7 years ago

@neilhwatson do you still need help with this?

neilhwatson commented 7 years ago

I went another way. AFAIK the problem still exists.

lmayorga1980 commented 7 years ago

@neilhwatson ,

You might be still using vagrant 1.8.1 but that version had some issues with ssh keys and it was resolved on https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md#186-september-27-2016

My current configuration is vagrant 1.9.3 with vagrant-serverspec 1.2.0. I don't think is a serverspec issue but a vagrant issue. Can you test with a higher version of vagrant after 1.8.6?

With this configuration vagrant-serverspec worked fine.

 vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'scalefactory/centos6'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'scalefactory/centos6' is up to date...
==> default: Setting the name of the VM: centos_default_1491440239941_37402
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> 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: Mounting shared folders...
    default: /vagrant => /Users/user1/gitcom/vagrant-serverspec/test/centos
==> default: Running provisioner: serverspec...
.

Finished in 0.22048 seconds (files took 0.05258 seconds to load)
1 example, 0 failures
neilhwatson commented 7 years ago

So much time has passed I don't have the original files to reproduce this.

vvchik commented 6 years ago

Closed as lack of response