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

Error in lxc-create #282

Closed
agriffis opened this issue May 6, 2014 · 5 comments
Closed

Error in lxc-create #282

agriffis opened this issue May 6, 2014 · 5 comments
Labels
Milestone

Comments

@agriffis
Copy link
Contributor

agriffis commented May 6, 2014

Trying out vagrant-lxc-1.0.0.alpha.1 with lxc-0.9.0-2.fc20.x86_64

Debug output shows that lxc-create thinks it isn't being passed a config, probably because of the double-dash?

==> default: Importing base box 'fgrehm/trusty64-lxc'...
 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:0x0000000168bec8>
 INFO driver: Copying LXC template into place
 INFO subprocess: Starting process: ["/usr/bin/sudo", "cp", "/home/aron/.vagrant.d/gems/gems/vagrant-lxc-1.0.0.alpha.1/scripts/lxc-template", "/usr/share/lxc/templates/lxc-vagrant-tmp-mark-sarah_default_1399387733379_80869"]
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-mark-sarah_default_1399387733379_80869"]
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", "--template", "vagrant-tmp-mark-sarah_default_1399387733379_80869", "--name", "mark-sarah_default_1399387733379_80869", "--", "--tarball", "/home/aron/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.1.0/lxc/rootfs.tar.gz", "--config", "/home/aron/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.1.0/lxc/lxc-config"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: 
DEBUG subprocess: stdout: lxc-create: No config file specified, using the default config /etc/lxc/default.conf
DEBUG subprocess: stdout: 'rootfs' parameter is required
DEBUG subprocess: stderr: lxc-create: failed to execute template 'vagrant-tmp-mark-sarah_default_1399387733379_80869'
DEBUG subprocess: stderr: lxc-create: aborted
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-mark-sarah_default_1399387733379_80869"]
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", "--template", "vagrant-tmp-mark-sarah_default_1399387733379_80869", "--name", "mark-sarah_default_1399387733379_80869", "--", "--tarball", "/home/aron/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.1.0/lxc/rootfs.tar.gz", "--config", "/home/aron/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.1.0/lxc/lxc-config"]
@fgrehm fgrehm added bug labels May 6, 2014
@fgrehm fgrehm added this to the v1.0.0 milestone May 6, 2014
@fgrehm
Copy link
Owner

fgrehm commented May 6, 2014

I've seen this show up on 0.8.something on some ubuntu that I can't remember right now, I have no idea what's going on yet but I'm tagging it as a bug and I hope to fix it for the next alpha.

IIRC you are using Fedora right? Just to confirm, are containers stored on /var/lib/lxc by default as well? Maybe we should bring in @oker1's patch from https://github.com/fgrehm/vagrant-lxc/pull/270/files#diff-1ba542f0345b5a47bc6f15eebe83e72dR57

@fgrehm
Copy link
Owner

fgrehm commented May 6, 2014

Oh, it just came to my mind that the issue could be on the bundled lxc template and I believe it is something that can be easily fixed. It didn't break on the past because the old version had a fallback for that and I believe it doesn't break for me because lxc 1.0 passes it in automagically.

We could look backporting it over here and because the template for new boxes are bundled with the plugin, it will be easier for me as it won't require me to rebuild boxes 😁

@morrizon
Copy link

morrizon commented May 7, 2014

Same issue in Ubuntu 12.04.4 (kernel 3.10.23), lxc 0.7.5, vagrant 1.6.0 and vagrant-lxc 1.0.0.alpha.1.

DEBUG driver: Creating container...
 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-create", "--template", "vagrant-tmp-first-lxc_default_1399425327760_55218", "--name", "first-lxc_default_1399425327760_55218", "--", "--tarball", "/home/cla/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-precise64-lxc/1.1.0/lxc/rootfs.tar.gz", "--config", "/home/cla/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-precise64-lxc/1.1.0/lxc/lxc-config"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout:
No config file specified, using the default config
DEBUG subprocess: stdout: 'rootfs' parameter is required
DEBUG subprocess: stdout: failed to execute template 'vagrant-tmp-first-lxc_default_1399425327760_55218'
DEBUG subprocess: stdout: aborted
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 1

@fgrehm
Copy link
Owner

fgrehm commented May 7, 2014

@agriffis @morrizon I've pushed a potential fix for this on b210b26, would you guys be able to replace your ~/.vagrant.d/gems/gems/vagrant-lxc-1.0.0.alpha.1/scripts/lxc-template with the new version from https://raw.githubusercontent.com/fgrehm/vagrant-lxc/master/scripts/lxc-template and let me know if it works?

Thanks in advance!

@fgrehm fgrehm closed this as completed in 4d45a40 May 13, 2014
@fgrehm
Copy link
Owner

fgrehm commented May 13, 2014

Just confirmed that this has been fixed by b210b26 and 4d45a40 on an Ubuntu 12.04 machine with lxc 0.7.5.

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

3 participants