Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAIL glenux/jessie64-lxc with #42

Open
bpiselli opened this issue Jan 15, 2016 · 3 comments
Open

FAIL glenux/jessie64-lxc with #42

bpiselli opened this issue Jan 15, 2016 · 3 comments

Comments

@bpiselli
Copy link

While configuring an LXC box on top of a capsule VM and using bridge capabilities to expose it on the network outside the capsule VM

Vagrant script

   # RABBITMQ LXC
   config.vm.define :rabbitmq do |box|
      box.vm.hostname = "ets-rabbitmq"
      box.vm.box = "glenux/jessie64-lxc"
      box.vm.provider :lxc do |provider|
         provider.customize "network.type", "veth"
         provider.customize "network.flags", "up"
         provider.customize "network.link", "lxcbr1"
         provider.customize "network.ipv4", "192.168.xx.xx/24"
      end
   end

Working perfectly with "fgrehm/wheezy64-lxc" but failing with "glenux/jessie64-lxc"
@fgrehm can you provide a LXC box for "debian/Jessie" ?

Here is the error given with vagrant up --debug

DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: stderr: ==> rabbitmq: An error occurred. The error will be shown after all tasks complete.
 INFO interface: info: ==> rabbitmq: An error occurred. The error will be shown after all tasks complete.
 INFO interface: info: ==> capsule: ==> rabbitmq: An error occurred. The error will be shown after all tasks complete.
==> capsule: ==> rabbitmq: An error occurred. The error will be shown after all tasks complete.

DEBUG ssh: stderr: 

DEBUG ssh: stderr: An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'rabbitmq'
machine. Please handle this error then try again:

There was an error executing lxc-attach

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
 INFO interface: info: An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An error occurred while executing the action on the 'rabbitmq'
machine. Please handle this error then try again:

There was an error executing lxc-attach

Or @glenux can you solve that issue ?

Thanks guys !

@glenux
Copy link
Contributor

glenux commented Jan 25, 2016

Interesting. Can you send us the output of the same command with VAGRANT_LOG=debug ?

@lloydoliver
Copy link

@glenux I'm seeing potentially the same issue and I think there are two parts to this.

First issue is the networking doesn't come up fully due to the folder /run/network not being present in the box.

devground (master):~/git/vagrant$ sudo lxc-attach --name vagrant_dc1-pc-node001_1453725458865_97865
root@dc1-pc-node001:/# ifup eth0
ifup: failed to open lockfile /run/network/.ifstate.lock: No such file or directory
root@dc1-pc-node001:/# ifdown eth0
ifdown: failed to open lockfile /run/network/.ifstate.lock: No such file or directory

I think this is what is causing the initial vagrant up problem as it appears to be timing out waiting for the box to come up (below), but I can still manually run lxc-attach as seen above.

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
ERROR vagrant: /home/ubuntu/.vagrant.d/gems/gems/vagrant-lxc-1.2.1/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb:27:in `block in assigned_ip'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/retryable.rb:17:in `retryable'
/home/ubuntu/.vagrant.d/gems/gems/vagrant-lxc-1.2.1/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb:24:in `assigned_ip'
/home/ubuntu/.vagrant.d/gems/gems/vagrant-lxc-1.2.1/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb:14:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:224:in `action_raw'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:199:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:181:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:181:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `action'
/home/ubuntu/.vagrant.d/gems/gems/vagrant-lxc-1.2.1/lib/vagrant-lxc/provider.rb:81:in `ssh_info'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:425:in `ssh_info'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/communicators/ssh/communicator.rb:46:in `block in wait_for_ready'
/opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
/opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
/opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
/opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/communicators/ssh/communicator.rb:42:in `wait_for_ready'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
 INFO interface: error: There was an error executing lxc-attach

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.

The second part to this appears to be an issue with systemd (or whatever init system you have in the box) as after the box fails to provision via vagrant, trying to do a vagrant destroy yeilds a similar error;

devground (master):~/git/vagrant$ vagrant destroy dc1-pc-node001
    dc1-pc-node001: Are you sure you want to destroy the 'dc1-pc-node001' VM? [y/N] y
==> dc1-pc-node001: Forcing shutdown of container...
There was an error executing ["sudo", "/usr/bin/env", "lxc-attach", "--name", "vagrant_dc1-pc-node001_1453725458865_97865", "--", "/sbin/halt"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.

If i run the command vagrant is trying to run above the response is

Failed to talk to init daemon.

Trying to call any systemd function inside the container also yeilds

Failed to get D-Bus connection: Unknown error -1

Versions:

devground (master):~/git/vagrant$ vagrant box list
glenux/jessie64-lxc    (lxc, 1.2.0)
devground (master):~/git/vagrant$ vagrant --version
Vagrant 1.8.1

@bpiselli could you confirm if my findings are the same as what you are experiencing.. if not I will move this information into a seperate ticket.

@AlexeyDemidov
Copy link

I had similar issue today - vagrant fails to communicate with container; when you lxc-attach to container it has no network initialized due to missing /run/network directory. Fixed it in two steps - first updated lxc and lxc-template from trusty-backports to version 1.1.5-0ubuntu3~ubuntu14.04.1, second, replaced lxc-config provided by box with two lines of code

 lxc.include = /usr/share/lxc/config/debian.common.conf
 lxc.arch = amd64

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

No branches or pull requests

4 participants