Skip to content
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.

Chef Provisioning- Vagrant (Port issues) #23

Open
ghost opened this issue Jul 2, 2015 · 8 comments
Open

Chef Provisioning- Vagrant (Port issues) #23

ghost opened this issue Jul 2, 2015 · 8 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2015

[2015-07-02T12:20:57-07:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /Users/dtumkursreeni/chef
One version per cookbook

[2015-07-02T12:20:57-07:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.4.0.rc.0
[2015-07-02T12:20:57-07:00] INFO: *** Chef 12.4.0.rc.0 ***
[2015-07-02T12:20:57-07:00] INFO: Chef-client pid: 34428
[2015-07-02T12:20:58-07:00] INFO: Run List is []
[2015-07-02T12:20:58-07:00] INFO: Run List expands to []
[2015-07-02T12:20:58-07:00] INFO: Starting Chef Run for dtumkursreeni
[2015-07-02T12:20:58-07:00] INFO: Running start handlers
[2015-07-02T12:20:58-07:00] INFO: Start handlers complete.
[2015-07-02T12:20:58-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
resolving cookbooks for run list: []
[2015-07-02T12:20:58-07:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-07-02T12:20:58-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:20:58-07:00] WARN: Chef::Resource::VagrantBox is marked as providing DSL vagrant_box, but provides :vagrant_box was never called!
[2015-07-02T12:20:58-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
[2015-07-02T12:20:58-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:20:58-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:20:58-07:00] WARN: Chef::Resource::Machine is marked as providing DSL machine, but provides :machine was never called!
[2015-07-02T12:20:58-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
[2015-07-02T12:20:58-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:20:58-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:20:58-07:00] WARN: Node dtumkursreeni has an empty run list.
Converging 3 resources
Recipe: @recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb

  • vagrant_box[sles11sp3] action create[2015-07-02T12:20:58-07:00] INFO: Processing vagrant_box[sles11sp3] action create (@recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb line 77)
    [2015-07-02T12:20:58-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
    [2015-07-02T12:20:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    (up to date)
    Recipe: @recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/simple.rb
  • machine[Mario] action converge[2015-07-02T12:21:00-07:00] INFO: Processing machine[Mario] action converge (@recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/simple.rb line 77)
    [2015-07-02T12:21:00-07:00] WARN: Class Chef::Provider::Machine does not declare 'provides :machine'.
    [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    [2015-07-02T12:21:00-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Mario
    [2015-07-02T12:21:00-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
    [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    [2015-07-02T12:21:00-07:00] WARN: Chef::Resource::VagrantCluster is marked as providing DSL vagrant_cluster, but provides :vagrant_cluster was never called!
    [2015-07-02T12:21:00-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
    [2015-07-02T12:21:00-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
    [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    [2015-07-02T12:21:00-07:00] INFO: Processing vagrant_cluster[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 77)
    [2015-07-02T12:21:00-07:00] WARN: Class Chef::Provider::VagrantCluster does not declare 'provides :vagrant_cluster'.
    [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    [2015-07-02T12:21:00-07:00] INFO: Processing directory[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 15)
    [2015-07-02T12:21:00-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Vagrantfile] action create (basic_chef_client::block line 16)
    [2015-07-02T12:21:00-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Mario.vm] action create (basic_chef_client::block line 232)
    [2015-07-02T12:21:00-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Mario.vm] created file /Users/dtumkursreeni/.chef/vms/Mario.vm
    • create new file /Users/dtumkursreeni/.chef/vms/Mario.vm[2015-07-02T12:21:00-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Mario.vm] updated file contents /Users/dtumkursreeni/.chef/vms/Mario.vm
    • update content in file /Users/dtumkursreeni/.chef/vms/Mario.vm from none to 237956
    • --- /Users/dtumkursreeni/.chef/vms/Mario.vm 2015-07-02 12:21:00.000000000 -0700
    • +++ /Users/dtumkursreeni/.chef/vms/.Mario.vm20150702-34428-1shmyh9 2015-07-02 12:21:00.000000000 -0700
    • @@ -1 +1,9 @@
    • +Vagrant.configure('2') do |outer_config|
    • + outer_config.vm.define "Mario" do |config|
    • + config.vm.box = "sles11sp3"
    • + config.vm.box_url = "http://jenkins-hzn.eng.vmware.com/tools/vagrant/sles11sp3.box"
    • + config.vm.hostname = "default-sles11sp3.vagrantup.com"
    • + config.vm.synced_folder ".", "/vagrant", disabled: true
    • + end
    • +end[2015-07-02T12:21:00-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
      [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
      [2015-07-02T12:21:00-07:00] WARN: Chef::Resource::ChefNode is marked as providing DSL chef_node, but provides :chef_node was never called!
      [2015-07-02T12:21:00-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
      [2015-07-02T12:21:00-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
      [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
      [2015-07-02T12:21:00-07:00] INFO: Processing chef_node[Mario] action create (basic_chef_client::block line 77)
      [2015-07-02T12:21:00-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
      [2015-07-02T12:21:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
      [2015-07-02T12:21:00-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Mario
    • create node Mario at chefzero://localhost:8889
    • add normal.tags = ["itsa_me"]
    • add normal.chef_provisioning = {"reference"=>{"driver_url"=>"vagrant:/Users/dtumkursreeni/.chef/vms", "driver_version"=>"0.8.3", "vm_name"=>"Mario", "vm_file_path"=>"/Users/dtumkursreeni/.chef/vms/Mario.vm", "allocated_at"=>"2015-07-02 19:21:00 UTC", "host_node"=>"chefzero://localhost:8889/nodes/", "needs_reload"=>true}}
    • run vagrant up Mario (status was 'not created')[2015-07-02T12:22:00-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
      [2015-07-02T12:22:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
      [2015-07-02T12:22:00-07:00] INFO: Processing chef_node[Mario] action create (basic_chef_client::block line 57)
      [2015-07-02T12:22:00-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
      [2015-07-02T12:22:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
    • update node Mario at chefzero://localhost:8889
    • update normal.chef_provisioning.reference.needs_reload from true to false
    • add normal.chef_provisioning.reference.forwarded_ports = {"22"=>"2222"}[2015-07-02T12:22:00-07:00] INFO: Executing sudo cp /etc/chef/client.pem /tmp/client.pem.1767459981 on vagrant@172.16.127.166
      [2015-07-02T12:22:00-07:00] INFO: Completed cp /etc/chef/client.pem /tmp/client.pem.1767459981 on vagrant@172.16.127.166: exit status 1
      [2015-07-02T12:22:00-07:00] ERROR: Unable to download /etc/chef/client.pem to /tmp/client.pem.1767459981 on vagrant@172.16.127.166 -- Error: command 'cp /etc/chef/client.pem /tmp/client.pem.1767459981' exited with code 1.

[2015-07-02T12:22:00-07:00] INFO: Executing sudo rm /tmp/client.pem.1767459981 on vagrant@172.16.127.166
[2015-07-02T12:22:00-07:00] INFO: Completed rm /tmp/client.pem.1767459981 on vagrant@172.16.127.166: exit status 1
[2015-07-02T12:22:00-07:00] WARN: Unable to clean up /tmp/client.pem.1767459981 on vagrant@172.16.127.166 -- Error: command 'rm /tmp/client.pem.1767459981' exited with code 1.

[2015-07-02T12:22:00-07:00] WARN: Class Chef::Resource::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T12:22:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:00-07:00] WARN: Chef::Resource::PrivateKey is marked as providing DSL private_key, but provides :private_key was never called!
[2015-07-02T12:22:00-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
[2015-07-02T12:22:00-07:00] WARN: Class Chef::Resource::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T12:22:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:00-07:00] INFO: Processing private_key[in_memory] action create (basic_chef_client::block line 77)
[2015-07-02T12:22:00-07:00] WARN: Class Chef::Provider::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T12:22:00-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.

- generate private key (2048 bits)[2015-07-02T12:22:00-07:00] INFO: Executing sudo ls -d /etc/chef/client.pem on vagrant@172.16.127.166

[2015-07-02T12:22:01-07:00] INFO: Completed ls -d /etc/chef/client.pem on vagrant@172.16.127.166: exit status 2
[2015-07-02T12:22:01-07:00] INFO: Executing sudo ls -d /etc/chef on vagrant@172.16.127.166
[2015-07-02T12:22:01-07:00] INFO: Completed ls -d /etc/chef on vagrant@172.16.127.166: exit status 2
[2015-07-02T12:22:01-07:00] INFO: Executing sudo mkdir -p /etc/chef on vagrant@172.16.127.166
[2015-07-02T12:22:01-07:00] INFO: Completed mkdir -p /etc/chef on vagrant@172.16.127.166: exit status 0

- create directory /etc/chef on Mario[2015-07-02T12:22:01-07:00] INFO: Executing sudo mkdir -p /etc/chef on vagrant@172.16.127.166

[2015-07-02T12:22:01-07:00] INFO: Completed mkdir -p /etc/chef on vagrant@172.16.127.166: exit status 0
[2015-07-02T12:22:01-07:00] INFO: Executing sudo mv /tmp/client.pem.807567514 /etc/chef/client.pem on vagrant@172.16.127.166
[2015-07-02T12:22:01-07:00] INFO: Completed mv /tmp/client.pem.807567514 /etc/chef/client.pem on vagrant@172.16.127.166: exit status 0

- write file /etc/chef/client.pem on Mario[2015-07-02T12:22:01-07:00] WARN: Class Chef::Resource::ChefClient does not declare 'provides :chef_client'.

[2015-07-02T12:22:01-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:01-07:00] WARN: Chef::Resource::ChefClient is marked as providing DSL chef_client, but provides :chef_client was never called!
[2015-07-02T12:22:01-07:00] WARN: In Chef 13, this will break: you must call provides to mark the names you provide, even if you also override provides? yourself.
[2015-07-02T12:22:01-07:00] WARN: Class Chef::Resource::ChefClient does not declare 'provides :chef_client'.
[2015-07-02T12:22:01-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:01-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T12:22:01-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:01-07:00] INFO: Processing chef_client[Mario] action create (basic_chef_client::block line 77)
[2015-07-02T12:22:01-07:00] WARN: Class Chef::Provider::ChefClient does not declare 'provides :chef_client'.
[2015-07-02T12:22:01-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T12:22:01-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/clients/Mario

- create client Mario at clients
-   add public_key = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAus1npLwpCjWIqG6WWq0U\nlTBxre/fiPK7mQv0HoWlXXrWX7CFTbn5dfUD7+cGaFyURtZq4VLMDgQ/hZNRMj46\nXHAEX+M18mLoo8tRW8AF0rUuzCFWoqbeUlYk541FR0K5qFdlFfwRJBnwRr9nXhst\nEiLYRN8bAUHd0xnUfy+ema8iD7z5dMaSd1yNNzd6/s5etXsUsHqQV9qL+HIvghCX\npP1IoqpWSaeMfy4uelk79wPSVOAaY7flHRQBuf1NyLU2947yj0x+g+sXZe1AXGbx\ns4llV7r0rizd8wQziHdbR7NU0/zVjXojFR0kqHBGH2Tlm8O7G4hqvmO8T+R3aDhM\nnwIDAQAB\n-----END PUBLIC KEY-----\n"[2015-07-02T12:22:01-07:00] INFO: Processing chef_node[Mario] action create (basic_chef_client::block line 143)

[2015-07-02T12:22:01-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T12:22:01-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.

================================================================================
Error executing action `converge` on resource 'machine[Mario]'
================================================================================

RuntimeError
------------
Error forwarding port: could not forward 8889 or 0

Resource Declaration:
---------------------
# In /Users/dtumkursreeni/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/chef-12.4.0.rc.0/lib/chef/dsl/recipe.rb

 77:           return send(method_symbol, *args, &block)
 78:         end

Compiled Resource:
------------------
# Declared in /Users/dtumkursreeni/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/chef-12.4.0.rc.0/lib/chef/dsl/recipe.rb:77:in `method_missing'

machine("Mario") do
  action [:converge]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  chef_server {:chef_server_url=>"chefzero://localhost:8889", :options=>{:client_name=>"dtumkursreeni", :signing_key_filename=>"/Users/dtumkursreeni/.chef/dtumkursreeni.pem"}}
  driver "vagrant"
  machine_options {:vagrant_config=>"     config.vm.synced_folder \".\", \"/vagrant\", disabled: true\n", :vagrant_options=>{"vm.box"=>"sles11sp3", "vm.box_url"=>"http://jenkins-hzn.eng.vmware.com/tools/vagrant/sles11sp3.box", "vm.hostname"=>"default-sles11sp3.vagrantup.com"}}
  declared_type :machine
  cookbook_name "@recipe_files"
  recipe_name "/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/simple.rb"
  attribute_modifiers [["tags", #<Proc:0x007fc1a9ca8718@/Users/dtumkursreeni/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cheffish-1.2/lib/cheffish.rb:149>]]
  converge true
end

[2015-07-02T12:22:01-07:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-07-02T12:22:01-07:00] ERROR: Running exception handlers
Running handlers complete
[2015-07-02T12:22:01-07:00] ERROR: Exception handlers complete
[2015-07-02T12:22:01-07:00] FATAL: Stacktrace dumped to /Users/dtumkursreeni/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 64.504854 seconds
[2015-07-02T12:22:01-07:00] ERROR: machine[Mario](@recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/simple.rb line 77) had an error: RuntimeError: Error forwarding port: could not forward 8889 or 0
[2015-07-02T12:22:02-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

@ghost
Copy link
Author

ghost commented Jul 2, 2015

screen shot 2015-07-02 at 12 41 25 pm

@ghost
Copy link
Author

ghost commented Jul 4, 2015

screen shot 2015-07-03 at 6 15 48 pm

@dblessing
Copy link

For the error about /etc/chef/client.pem - chef-zero requires a client.pem, no matter its validity. Simply copy some pem file to /etc/chef/client.pem on your workstation.

Also, try upgrading to Chef 12.4.0 actual release. You're using RC, which could potentially have bugs that have been fixed.

@christinedraper
Copy link

Is it possible that TCP forwarding is disabled on your SLES VM?

@christinedraper
Copy link

I'd also suggest downgrading to chef 12.3, as there are some known compatibility problems between chef provisioning and chef 12.4.0 which you might otherwise encounter (chef-boneyard/chef-provisioning#377)

@ghost
Copy link
Author

ghost commented Jul 7, 2015

Hey Christine,
Thanks so much for the reply :) I went through your blog as well (https://christinemdraper.wordpress.com/2015/02/01/deploying-a-multi-node-application-to-vagrant-using-chef-provisioning/).

I will try your comments and get back to you.

@tyler-ball
Copy link
Contributor

Chef 12.4.1 has been released - can you try that version? It has a slew of fixes in it.

@ghost
Copy link
Author

ghost commented Jul 21, 2015

sure.. will update in the late evening..

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

No branches or pull requests

3 participants