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

ERROR vagrant: /home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/sudo_wrapper.rb:47:in `block in execute' #29

Closed
dragoscirjan opened this issue Feb 23, 2015 · 12 comments

Comments

@dragoscirjan
Copy link

Hi,

I'm using Ubuntu 14.10 for testing (production will be 14.04). I tried to write my own packaging script, getting inspired by your code here: http://pastebin.com/yiUkbW71, and testing it with: http://pastebin.com/WQkEu8wS.

I am no expert in vagrant, I barely scratched the surface, so before going on other channels like StackOverflow, I'm asking for your help, since you're the one who wrote the LXC module for vagrant.

Could you please tell me what am I doing wrong since, in the end, I\m getting a pretty nasty error looking like this:

P.S.

vagrant init fgrehm/precise64-lxc
vagrant up --provider=lxc

won't work either. It crashes when trying to start the container.

# lxc-info --version
1.1.0.alpha2
# vagrant --version
Vagrant 1.7.2
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.10
Release:    14.10
Codename:   utopic
==> default: Importing base box 'test1'...
 INFO handle_box_metadata: Validating box contents
 INFO handle_box_metadata: Setting box options on environment
 INFO warden: Calling IN action: #<Vagrant::LXC::Action::Create:0x00000003528700>
 INFO driver: Copying LXC template into place
 INFO subprocess: Starting process: ["/usr/bin/sudo", "cp", "/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/scripts/lxc-template", "/usr/share/lxc/templates/lxc-vagrant-tmp-test_default_1424731394620_37313"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO subprocess: Starting process: ["/usr/bin/sudo", "chmod", "+x", "/usr/share/lxc/templates/lxc-vagrant-tmp-test_default_1424731394620_37313"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG driver: Creating container...
 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: lxc_container: bdev.c: do_lvm_create: 962 No such file or directory - execlp
DEBUG subprocess: stderr: lxc_container: bdev.c: lvm_create: 1154 Error creating new lvm blockdev /dev/lxc/test_default_1424731394620_37313 size 1073741824 bytes
DEBUG subprocess: stderr: getopt: unrecognized option '--arch'
getopt: unrecognized option '--release'
getopt: unrecognized option '--dist'
getopt: unrecognized option '--logfile'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:214:in `action_raw'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:191:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:516:in `lock'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `action'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
 INFO interface: error: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
 INFO interface: Machine: error-exit ["Vagrant::LXC::Errors::ExecuteError", "There was an error executing [\"sudo\", \"lxc-create\", \"-B\", \"best\", \"--template\", \"vagrant-tmp-test_default_1424731394620_37313\", \"--name\", \"test_default_1424731394620_37313\", \"--\", \"--arch\", \"amd64\", \"--release\", \"trusty\", \"--dist\", \"ubuntu\", \"--logfile\", \"/var/log/lxc.log\", \"--tarball\", \"/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz\", \"--config\", \"/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config\"]\n\nFor more information on the failure, enable detailed logging by setting\nthe environment variable VAGRANT_LOG to DEBUG."]
DEBUG subprocess: stderr: lxc_container: lxccontainer.c: create_run_template: 1121 container creation template for test_default_1424731394620_37313 failed
DEBUG subprocess: stderr: lxc_container: lxc_create.c: main: 280 Error creating container test_default_1424731394620_37313
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 1
 INFO driver: Removing LXC template
 INFO subprocess: Starting process: ["/usr/bin/sudo", "rm", "/usr/share/lxc/templates/lxc-vagrant-tmp-test_default_1424731394620_37313"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
ERROR warden: Error occurred: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
 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: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
ERROR warden: Error occurred: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x007f409c0ff9e0>
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Released process lock: machine-action-d7a6edb75ff7a59c93f6f58771f5c217
 INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x000000036f2ea0>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::LXC::Errors::ExecuteError: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.>
ERROR vagrant: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test_default_1424731394620_37313", "--name", "test_default_1424731394620_37313", "--", "--arch", "amd64", "--release", "trusty", "--dist", "ubuntu", "--logfile", "/var/log/lxc.log", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--config", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc-config"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
ERROR vagrant: /home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/sudo_wrapper.rb:47:in `block in execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb:17:in `retryable'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/sudo_wrapper.rb:37:in `execute'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/sudo_wrapper.rb:17:in `run'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/driver/cli.rb:160:in `run'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/driver/cli.rb:65:in `create'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/driver.rb:84:in `block in create'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/driver.rb:256:in `import_template'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/driver.rb:82:in `create'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/action/create.rb:22:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/home/dragosc/.vagrant.d/gems/gems/vagrant-lxc-1.1.0/lib/vagrant-lxc/action/handle_box_metadata.rb:41:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
@dragoscirjan
Copy link
Author

I'm starting to believe it's not my (created) machine's fault...

I tried the following:

vagrant init test1 https://dl.dropboxusercontent.com/u/67225617/lxc-vagrant/lxc-wheezy64-puppet3-2013-07-27.box
vagrant up --provider=lxc

And I get a similar error:

INFO interface: error: There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test1_default_1424858375837_66330", "--name", "test1_default_1424858375837_66330", "-f", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc.conf", "--", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--auth-key", "/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/keys/vagrant.pub"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test1_default_1424858375837_66330", "--name", "test1_default_1424858375837_66330", "-f", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc.conf", "--", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--auth-key", "/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/keys/vagrant.pub"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
INFO interface: Machine: error-exit ["Vagrant::LXC::Errors::ExecuteError", "There was an error executing ["sudo", "lxc-create", "-B", "best", "--template", "vagrant-tmp-test1_default_1424858375837_66330", "--name", "test1_default_1424858375837_66330", "-f", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/lxc.conf", "--", "--tarball", "/home/dragosc/.vagrant.d/boxes/test1/0/lxc/rootfs.tar.gz", "--auth-key", "/opt/vagrant/embedded/gems/gems/vagrant-1.7.2/keys/vagrant.pub"]\n\nFor more information on the failure, enable detailed logging by setting\nthe environment variable VAGRANT_LOG to DEBUG."]

Any idea why ?

@fgrehm
Copy link
Owner

fgrehm commented Mar 8, 2015

Do you mind trying to set up a VBox environment that reproduces your issue? https://github.com/fgrehm/vagrant-lxc-vbox-hosts should give you a head start.

Thanks in advance!

@dragoscirjan
Copy link
Author

I managed to make your script work :D. Already forked it, trying to make some new fixes and add new feature. Hope you'll hear from me soon :)

Thank you for your interest.

@fgrehm
Copy link
Owner

fgrehm commented Mar 8, 2015

Looking forward to hearing back from you again!

@dragoscirjan
Copy link
Author

Hey there,

as promissed, please take a look @ https://github.com/dragoscirjan/vagrant-lxc-base-boxes

I'm not adding a pull request since everything is a mess still (I've changed a lot in your code).
Added complete (Ubuntu 14.04) support for:
CentOS, Fedora, Oracle
and planning support for Ubuntu Cloud.

I noticed LXC repo has templates for a huge set of distro templates (https://github.com/lxc/lxc/tree/master/templates), however Ubuntu 14.04 does not list many of them.

Would love if someone ( as enthusiast as us ) would be able to help us implement some more.

Anyways, if my adaptations of your code please you, feel free to implement them as well.

@fgrehm
Copy link
Owner

fgrehm commented Apr 10, 2015

WOW! That is AWESOME! I'd love to bring those changes in! Have those boxes been working fine or were you able to notice any weirdness while trying them out?

I will do my best to give them a try over here when I have a chance and push some pre packaged boxes to Atlas.

Thanks a lot for the work you've done so far!

@dragoscirjan
Copy link
Author

I think I started each machine once or twice... But to be honest, I focused
on the ones I needed: CentOS 7 and Oracle. Those work OK.

I'm still not sure how of how to wait for a machine to initiate its network
IP (as you will see in my code I do a series of pings + sleeps) .
If I find a better method I'll let you know.

On Fri, Apr 10, 2015 at 3:25 PM, Fabio Rehm notifications@github.com
wrote:

WOW! That is AWESOME! I'd love to bring those changes in! Have those
boxes been working fine or were you able to notice any weirdness while
trying them out?

I will do my best to give them a try over here when I have a chance and
push some pre packaged boxes to Atlas.

Thanks a lot for the work you've done so far!


Reply to this email directly or view it on GitHub
#29 (comment)
.


Cristian - Dragos, Cirjan

Email: dragos.cirjan@gmail.com
Email (work): dragosc@itmcd.ro
Skype: dragos.cirjan, YM: cirjandragos, MSN: cirjandragos
Telefon: +40 726/355762, +40 771/437090, +40 771/437095

@fgrehm
Copy link
Owner

fgrehm commented Dec 6, 2015

I've stepped down as a maintainer of the plugin and I'm no longer maintaining this repo. Feel free to use it as a starting point for your own boxes and if you need any help with that just LMK! 🍻

@fgrehm fgrehm closed this as completed Dec 6, 2015
@dragoscirjan
Copy link
Author

Wow... received your message 2 days ago, and the notification for closing this today :)). You not being able to maintain this project anymore leaves it hanging. I've seen that for the vagrant plugin someone took over. Would you mind if I try to take over this one? No point in having two repositories doing the same thing. As I said I'm pretty interested in it and depending on it a lot (at least for now).

@fgrehm
Copy link
Owner

fgrehm commented Dec 8, 2015

You can add your repo to the brand new section of the readme that lists active forks 😄 Feel free to open up a PR!

@ccope
Copy link

ccope commented Jan 23, 2016

@globin @fpletz do you guys also want to take over this project?

@dragoscirjan
Copy link
Author

Hello,

if nor @globin nor @fpletz are manifesting their interest for this, I think I would. I wrote a lot of changes on my fork (even though didn't require for a pull yet) and I would be grateful if you let me continue the development of this repo.

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

3 participants