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

Using the available chef package for bootstrapping a container returns an exception #55

Open
therobot opened this issue Oct 17, 2014 · 0 comments

Comments

@therobot
Copy link
Contributor

I'm getting the following exception when trying to create a container with lxc cookbook. I'm using Ubuntu 14.04 and the 2.0 version of the lxc cookbook.

  * execute[lxc copy_chef_full[mycontainer]] action run
================================================================================
Error executing action `run` on resource 'execute[lxc copy_chef_full[mycontainer]]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of cp ["/opt/chef_11.12.8-2_amd64.deb"] /var/lib/lxc/mycontainer/rootfs/opt ----
STDOUT:
STDERR: cp: cannot stat '[/opt/chef_11.12.8-2_amd64.deb]': No such file or directory
---- End output of cp ["/opt/chef_11.12.8-2_amd64.deb"] /var/lib/lxc/mycontainer/rootfs/opt ----
Ran cp ["/opt/chef_11.12.8-2_amd64.deb"] /var/lib/lxc/mycontainer/rootfs/opt returned 1


Cookbook Trace:
---------------
/var/chef/cache/cookbooks/lxc/libraries/monkey.rb:20:in `monkey_shell_out!'


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/lxc/providers/container.rb

148:     execute "lxc copy_chef_full[#{new_resource.name}]" do
149:       command "cp #{file_path} #{_lxc.rootfs.join('opt')}"
150:       not_if do
151:         file_path.nil? || !new_resource.chef_enabled || _lxc.rootfs.join(file_path).exist?
152:       end
153:     end
154:



Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/lxc/providers/container.rb:148:in `block in class_from_file'

execute("lxc copy_chef_full[mycontainer]") do
  action "run"
  retries 0
  retry_delay 2
  guard_interpreter :default
  command "cp [\"/opt/chef_11.12.8-2_amd64.deb\"] /var/lib/lxc/mycontainer/rootfs/opt"
  backup 5
  returns 0
  cookbook_name "dnsimple-lxc"
  not_if { #code block }
end

After I remove /opt/chef_11.12.8-2_amd64.deb from its location the exception disappears and chef completes successfully.

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

1 participant