Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Issue detecting VM state when vagrant up #142

Closed
tripledes opened this issue Sep 13, 2013 · 26 comments
Closed

Issue detecting VM state when vagrant up #142

tripledes opened this issue Sep 13, 2013 · 26 comments
Labels

Comments

@tripledes
Copy link

Hi,

I'm setting up vagrant-lxc in a Ubuntu Precise host and I'm having some issues:

  • Environment:
Ubuntu Precise 12.04.3 
Kernel: raring-lts
LXC: 0.8.0-rc1
Vagrant: 1.3.1
Vagrant-lxc: 0.6.0
  • Error:
vagrant up
Bringing machine 'default' up with 'lxc' provider...
[default] Importing base box 'wheezy64'...
[default] Setting up mount entries for shared folders...
[default] -- /vagrant
[default] -- /packaging
[default] -- /tmp/vagrant-puppet/manifests
[default] -- /tmp/vagrant-puppet/modules-0
[default] Starting container...
[default] Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'running' state. Please verify everything is configured
properly and try again.

It's kind of weird as it says the state is 'running' but it's like it's not matching properly the strings...

The container is up and running, I can vagrant ssh to it, but all the previous steps (i.e. provisioning) are skipped as it fails to detect whether it's running or not.

Let me know if you need debug for it. I will try to dig deeper and will let u know if I can find anything else.

Thanks.

@fgrehm
Copy link
Owner

fgrehm commented Sep 13, 2013

I think I know what happened but just to double check, did you upgrade to 0.6.0? If you did, I think this is a regression caused by cf73a84 + 1da7b60

@fgrehm
Copy link
Owner

fgrehm commented Sep 13, 2013

Sorry, I didn't pay enough attention to what you wrote :P Marking this as a bug

@fgrehm
Copy link
Owner

fgrehm commented Sep 13, 2013

@tripledes BTW, are you able to vagrant provision even after that error or is it completely broken?

@tripledes
Copy link
Author

@fgrehm The provision works properly. I was not upgrading from 0.6.0 but I did use containers created with 0.5.0...then I initialized a new one with 0.6.0, it's showing same issue.

@tripledes
Copy link
Author

Just some debug:

 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-info", "--name", "test_default-1379083507"]
DEBUG subprocess: Selecting on IO
DEBUG ssh: Checking whether SSH is ready...
DEBUG subprocess: stdout: state:   RUNNING
pid:     24377
 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-info", "--name", "test_default-1379083507"]
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
ERROR warden: Error occurred: The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'running' state. Please verify everything is configured
properly and try again.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'running' state. Please verify everything is configured
properly and try again.

I just also noticed that it's not 100% reproducible, meaning it sometimes just works....I'm running it in a VMWare machine at my workplace...do you think could be something wrong in my environment?

Thanks.

@fuzzy
Copy link

fuzzy commented Sep 13, 2013

I consistently experience this issue on Ubuntu Precise amd64

$ sudo vagrant up --provider=lxc
[sudo] password for mpartin:
Bringing machine 'default' up with 'lxc' provider...
[default] Importing base box 'precise-64-lxc'...
[default] Setting up mount entries for shared folders...
[default] -- /vagrant
[default] Starting container...
[default] Waiting for container to start. This should not take long.
[default] Failed to connect to VM!
Failed to connect to VM via SSH. Please verify the VM successfully booted
by looking at the VirtualBox GUI.

$ vagrant -v
Vagrant version 1.2.7

$ vagrant plugin list
vagrant-lxc (0.6.0)

@fgrehm
Copy link
Owner

fgrehm commented Sep 13, 2013

@tripledes @fuzzy Tks for all the info guys, I'm not sure when I'll be able to get to this but for everyone using Ubuntu Precise as host please revert to vagrant 1.2.7 and vagrant-lxc 0.5.0 if possible. I'll keep you posted ;)

@tripledes
Copy link
Author

@fgrehm OK, np reverting versions, if you need anything else just say it :-)

@fgrehm
Copy link
Owner

fgrehm commented Sep 14, 2013

For the record, there was an issue with the error message reported by Vagrant which got fixed on hashicorp/vagrant@87f8bd8

@fgrehm
Copy link
Owner

fgrehm commented Sep 18, 2013

More updates from upstream: hashicorp/vagrant@f9e4ea9 got into 1.3.3 and might fix at least part of the issue ;)

@smertrios
Copy link

fyi, installed vagrant 1.3.3 on ubuntu 12.10 => same issue: "...invalid state while waiting for it to boot."

note: while the error message still shows, the vm is booting and I can ssh into it.

@fgrehm
Copy link
Owner

fgrehm commented Sep 18, 2013

@smertrios were you using vagrant-lxc 0.6.0?

@smertrios
Copy link

ah yes, sorry, vagrant-lxc (0.6.0)

@fgrehm
Copy link
Owner

fgrehm commented Sep 18, 2013

@smertrios tks!

@juanje
Copy link

juanje commented Sep 23, 2013

Hi, I having the same issue here lately.

My environment:

  • Host OS: Ubuntu 12.04.3 LTS
  • Host kernel: 3.2.0-53-generic
  • Host LXC: 0.7.5
  • Vagrant version: 1.3.3
  • Vagrant plugins:
    • vagrant-berkshelf (1.3.3)
    • vagrant-cachier (0.3.3)
    • vagrant-global-status (0.1.1)
    • vagrant-lxc (0.6.0)
    • vagrant-omnibus (1.1.1)

The error:

$ vagrant up
Bringing machine 'default' up with 'lxc' provider...
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
[Berkshelf] You should check for a newer version of vagrant-berkshelf.
[Berkshelf] If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
[Berkshelf] You can also join the discussion in #berkshelf on Freenode.
[Berkshelf] Updating Vagrant's berkshelf: '/home/jojeda/.berkshelf/default/vagrant/berkshelf-20130922-2655-1a7gpdq-default'
[Berkshelf] Using apt (1.4.4)
[Berkshelf] Using wantudu-devbox (0.0.1)
[Berkshelf] Using nginx (1.7.0)
[Berkshelf] Using build-essential (1.4.0)
[Berkshelf] Using yum (2.3.0)
[Berkshelf] Using runit (1.1.6)
[Berkshelf] Using ohai (1.1.10)
[default] Setting up mount entries for shared folders...
[default] -- /vagrant
[default] -- /var/www
[default] -- /tmp/vagrant-cache
[default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Starting container...
[default] Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'stopped' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.

The LXC box was a Ubuntu 12.04 i386 I created two days ago with the new scripts.

I hope this help.

@fgrehm
Copy link
Owner

fgrehm commented Sep 27, 2013

Hey guys, sorry for the silence, I've been pretty sick since sunday and I just got back to work today. I hope to release a fix for those issues over the weekend :)

@bobmaerten
Copy link

I have the same problem and a similar config as @juanje. If it can help, when the lxc-VM starts and displays the message, a vagrant reload solves the problem, set the hostname and trigger other plugins (hostmanager) correctly. I can then launch vagrant provision with no futher problems.

my 2 cents.

@fgrehm
Copy link
Owner

fgrehm commented Sep 27, 2013

@tripledes @fuzzy @smertrios @juanje @bobmaerten

While waiting for a long bundle update to finish I looked into this and I think I was able to fix it on 2116737. Would you guys be able to install the plugin from sources and check if the issue has been fixed?
Things are looking fine down here but since I haven't hit this bug I'm not sure if that will do the trick for you ;)

@smertrios
Copy link

just built from source:

host: ubuntu 12.04 (64bit)
vagrant 1.3.3
vagrant-lxc (0.6.1.dev)

with this new version, I'm not seeing the warming/error message anymore! Thanks for the fix :)

@fgrehm
Copy link
Owner

fgrehm commented Sep 27, 2013

awesome :) I'll just wait for one more 👍 and I'll release a new version with the fix

@juanje
Copy link

juanje commented Sep 27, 2013

Same here! 😄

It looks fixed to me. Thanks so much!

@fgrehm
Copy link
Owner

fgrehm commented Sep 28, 2013

Ok guys, this seems to have been fixed in git, a new version will be available on rubygems as soon as I'm able to run the acceptance specs against the new base boxes.

Tks for all the help :)

@fgrehm fgrehm closed this as completed Sep 28, 2013
@tripledes
Copy link
Author

Sorry for delay answering...I was on holidays :-)

I can confirm the issue is gone! 👍

Thanks a lot @fgrehm

@fgrehm
Copy link
Owner

fgrehm commented Sep 30, 2013

@tripledes I'm glad that it worked for you too! I'll just get to GH-147 and GH-149 that are pretty simple and will cut a new release after that :)

@fgrehm
Copy link
Owner

fgrehm commented Oct 3, 2013

🎆 0.6.1 is out! 🎆
I'll deal with GH-147 and GH-149 afterwards ;)

@fgrehm
Copy link
Owner

fgrehm commented Oct 3, 2013

0.6.2 is out too with a fix / improvement to some last minute changes I made :P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants