chef-boneyard / chef-provisioning

A library for creating machines and infrastructures idempotently in Chef.
Apache License 2.0
524 stars 163 forks source link

Chef Provisioning- Vagrant #372

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi All,

I am new to CHEF. I just tried using the examples in CHEF Provisioning library. Steps I followed: Step 1: Cloned the Git code (https://github.com/chef/chef-provisioning.git) Step 2: gem install chef-provisioning chef-provisioning-vagrant Step 3: export CHEF_DRIVER=vagrant

Step 4: export VAGRANT_DEFAULT_PROVIDER=virtualbox Step 5: chef-client -z vagrant_linux.rb simple.rb

I am getting bellow attached error.

dtumkursreeni-mac:examples dtumkursreeni$ chef-client -z vagrant_linux.rb simple.rb 
[2015-06-24T01:07:19-07:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /Users/dtumkursreeni/chef
  One version per cookbook

[2015-06-24T01:07:19-07:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.4.0.rc.0
[2015-06-24T01:07:19-07:00] INFO: *** Chef 12.4.0.rc.0 ***
[2015-06-24T01:07:19-07:00] INFO: Chef-client pid: 1215
[2015-06-24T01:07:21-07:00] INFO: Run List is []
[2015-06-24T01:07:21-07:00] INFO: Run List expands to []
[2015-06-24T01:07:21-07:00] INFO: Starting Chef Run for dtumkursreeni
[2015-06-24T01:07:21-07:00] INFO: Running start handlers
[2015-06-24T01:07:21-07:00] INFO: Start handlers complete.
[2015-06-24T01:07:21-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
resolving cookbooks for run list: []
[2015-06-24T01:07:21-07:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-06-24T01:07:21-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-06-24T01:07:21-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:21-07:00] WARN: Chef::Resource::VagrantBox is marked as providing DSL vagrant_box, but provides :vagrant_box was never called!
[2015-06-24T01:07:21-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-06-24T01:07:21-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-06-24T01:07:21-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:21-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-06-24T01:07:21-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:21-07:00] WARN: Chef::Resource::Machine is marked as providing DSL machine, but provides :machine was never called!
[2015-06-24T01:07:21-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-06-24T01:07:21-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-06-24T01:07:21-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:21-07:00] WARN: Node dtumkursreeni has an empty run list.
Converging 2 resources
Recipe: @recipe_files::/Users/dtumkursreeni/cheh_demo/chef-provisioning/docs/examples/vagrant_linux.rb
  * vagrant_box[sles11sp3.box] action create[2015-06-24T01:07:21-07:00] INFO: Processing vagrant_box[sles11sp3.box] action create (@recipe_files::/Users/dtumkursreeni/cheh_demo/chef-provisioning/docs/examples/vagrant_linux.rb line 77)
[2015-06-24T01:07:21-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
[2015-06-24T01:07:21-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/cheh_demo/chef-provisioning/docs/examples/simple.rb
  * machine[Makeitpossible] action converge[2015-06-24T01:07:22-07:00] INFO: Processing machine[Makeitpossible] action converge (@recipe_files::/Users/dtumkursreeni/cheh_demo/chef-provisioning/docs/examples/simple.rb line 77)
[2015-06-24T01:07:22-07:00] WARN: Class Chef::Provider::Machine does not declare 'provides :machine'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Makeitpossible
[2015-06-24T01:07:22-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] WARN: Chef::Resource::VagrantCluster is marked as providing DSL vagrant_cluster, but provides :vagrant_cluster was never called!
[2015-06-24T01:07:22-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-06-24T01:07:22-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] INFO: Processing vagrant_cluster[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 77)
[2015-06-24T01:07:22-07:00] WARN: Class Chef::Provider::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] INFO: Processing directory[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 15)
[2015-06-24T01:07:22-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Vagrantfile] action create (basic_chef_client::block line 16)
[2015-06-24T01:07:22-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Makeitpossible.vm] action create (basic_chef_client::block line 232)
[2015-06-24T01:07:22-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Makeitpossible.vm] created file /Users/dtumkursreeni/.chef/vms/Makeitpossible.vm

    - create new file /Users/dtumkursreeni/.chef/vms/Makeitpossible.vm[2015-06-24T01:07:22-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Makeitpossible.vm] updated file contents /Users/dtumkursreeni/.chef/vms/Makeitpossible.vm

    - update content in file /Users/dtumkursreeni/.chef/vms/Makeitpossible.vm from none to 17e8e2
    - --- /Users/dtumkursreeni/.chef/vms/Makeitpossible.vm  2015-06-24 01:07:22.000000000 -0700
    - +++ /Users/dtumkursreeni/.chef/vms/.Makeitpossible.vm20150624-1215-1mb7dfx    2015-06-24 01:07:22.000000000 -0700
    - @@ -1 +1,7 @@
    - +Vagrant.configure('2') do |outer_config|
    - +  outer_config.vm.define "Makeitpossible" do |config|
    - +    config.vm.box = "sles11sp3.box"
    - +    config.vm.hostname = "Makeitpossible"
    - +  end
    - +end[2015-06-24T01:07:22-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] WARN: Chef::Resource::ChefNode is marked as providing DSL chef_node, but provides :chef_node was never called!
[2015-06-24T01:07:22-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-06-24T01:07:22-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] INFO: Processing chef_node[Makeitpossible] action create (basic_chef_client::block line 77)
[2015-06-24T01:07:22-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
[2015-06-24T01:07:22-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-06-24T01:07:22-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Makeitpossible

    - create node Makeitpossible 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"=>"Makeitpossible", "vm_file_path"=>"/Users/dtumkursreeni/.chef/vms/Makeitpossible.vm", "allocated_at"=>"2015-06-24 08:07:22 UTC", "host_node"=>"chefzero://localhost:8889/nodes/", "needs_reload"=>true}}
    ================================================================================
    Error executing action `converge` on resource 'machine[Makeitpossible]'
    ================================================================================

    RuntimeError
    ------------
    vagrant up Makeitpossible failed!
    STDOUT:Bringing machine 'Makeitpossible' up with 'vmware_fusion' provider...
    ==> Makeitpossible: Cloning VMware VM: 'sles11sp3.box'. This can take some time...
    ==> Makeitpossible: Verifying vmnet devices are healthy...
    ==> Makeitpossible: Couldn't find Cheffile at ./Cheffile.
    ==> Makeitpossible: Preparing network adapters...
    ==> Makeitpossible: Fixed port collision for 22 => 2222. Now on port 2200.
    ==> Makeitpossible: Starting the VMware VM...
    ==> Makeitpossible: Waiting for machine to boot. This may take a few minutes...
        Makeitpossible: SSH address: 172.16.127.141:22
        Makeitpossible: SSH username: vagrant
        Makeitpossible: SSH auth method: private key
        Makeitpossible: Warning: Connection refused. Retrying...
        Makeitpossible: 
        Makeitpossible: Vagrant insecure key detected. Vagrant will automatically replace
        Makeitpossible: this with a newly generated keypair for better security.
        Makeitpossible: 
        Makeitpossible: Inserting generated public key within guest...
        Makeitpossible: Removing insecure key from the guest if its present...
        Makeitpossible: Key inserted! Disconnecting and reconnecting using new SSH key...
    ==> Makeitpossible: Machine booted and ready!
    ==> Makeitpossible: Forwarding ports...
        Makeitpossible: -- 22 => 2200
    ==> Makeitpossible: Setting hostname...
    ==> Makeitpossible: Configuring network adapters within the VM...
    ==> Makeitpossible: Waiting for HGFS kernel module to load...

    STDERR:The HGFS kernel module was not found on the running virtual machine.
    This must be installed for shared folders to work properly. Please
    install the VMware tools within the guest and try again. Note that
    the VMware tools installation will succeed even if HGFS fails
    to properly install. Carefully read the output of the VMware tools
    installation to verify the HGFS kernel modules were installed properly.

    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("Makeitpossible") 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_options=>{"vm.box"=>"sles11sp3.box"}}
      declared_type :machine
      cookbook_name "@recipe_files"
      recipe_name "/Users/dtumkursreeni/cheh_demo/chef-provisioning/docs/examples/simple.rb"
      attribute_modifiers [["tags", #<Proc:0x007fe8cc2565b8@/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-06-24T01:13:13-07:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-06-24T01:13:13-07:00] ERROR: Running exception handlers
Running handlers complete
[2015-06-24T01:13:13-07:00] ERROR: Exception handlers complete
[2015-06-24T01:13:13-07:00] FATAL: Stacktrace dumped to /Users/dtumkursreeni/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 353.805855 seconds
[2015-06-24T01:13:13-07:00] ERROR: machine[Makeitpossible] (@recipe_files::/Users/dtumkursreeni/cheh_demo/chef-provisioning/docs/examples/simple.rb line 77) had an error: RuntimeError: vagrant up Makeitpossible failed!
STDOUT:Bringing machine 'Makeitpossible' up with 'vmware_fusion' provider...
==> Makeitpossible: Cloning VMware VM: 'sles11sp3.box'. This can take some time...
==> Makeitpossible: Verifying vmnet devices are healthy...
==> Makeitpossible: Couldn't find Cheffile at ./Cheffile.
==> Makeitpossible: Preparing network adapters...
==> Makeitpossible: Fixed port collision for 22 => 2222. Now on port 2200.
==> Makeitpossible: Starting the VMware VM...
==> Makeitpossible: Waiting for machine to boot. This may take a few minutes...
    Makeitpossible: SSH address: 172.16.127.141:22
    Makeitpossible: SSH username: vagrant
    Makeitpossible: SSH auth method: private key
    Makeitpossible: Warning: Connection refused. Retrying...
    Makeitpossible: 
    Makeitpossible: Vagrant insecure key detected. Vagrant will automatically replace
    Makeitpossible: this with a newly generated keypair for better security.
    Makeitpossible: 
    Makeitpossible: Inserting generated public key within guest...
    Makeitpossible: Removing insecure key from the guest if its present...
    Makeitpossible: Key inserted! Disconnecting and reconnecting using new SSH key...
==> Makeitpossible: Machine booted and ready!
==> Makeitpossible: Forwarding ports...
    Makeitpossible: -- 22 => 2200
==> Makeitpossible: Setting hostname...
==> Makeitpossible: Configuring network adapters within the VM...
==> Makeitpossible: Waiting for HGFS kernel module to load...

STDERR:The HGFS kernel module was not found on the running virtual machine.
This must be installed for shared folders to work properly. Please
install the VMware tools within the guest and try again. Note that
the VMware tools installation will succeed even if HGFS fails
to properly install. Carefully read the output of the VMware tools
installation to verify the HGFS kernel modules were installed properly.

[2015-06-24T01:13:13-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Please, help

Thanks, Darshan

tyler-ball commented 9 years ago

Hey @DarshanMurthy it looks like there is an issue with the sles11sp3.box box you are using. Where did that come from? Do you get the same error if you use the precise64 error that is in the examples?

ghost commented 9 years ago

hi @tyler-ball

Its our own box. Now its working... but I have other issues:

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

[2015-07-02T15:27:10-07:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.4.0.rc.0
[2015-07-02T15:27:10-07:00] INFO: *** Chef 12.4.0.rc.0 ***
[2015-07-02T15:27:10-07:00] INFO: Chef-client pid: 54288
[2015-07-02T15:27:12-07:00] INFO: Run List is []
[2015-07-02T15:27:12-07:00] INFO: Run List expands to []
[2015-07-02T15:27:12-07:00] INFO: Starting Chef Run for dtumkursreeni
[2015-07-02T15:27:12-07:00] INFO: Running start handlers
[2015-07-02T15:27:12-07:00] INFO: Start handlers complete.
[2015-07-02T15:27:12-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
resolving cookbooks for run list: []
[2015-07-02T15:27:12-07:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-07-02T15:27:12-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:12-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:12-07:00] WARN: Chef::Resource::VagrantBox is marked as providing DSL vagrant_box, but provides :vagrant_box was never called!
[2015-07-02T15:27:12-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-02T15:27:12-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:12-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:12-07:00] WARN: Node dtumkursreeni has an empty run list.
Converging 1 resources
Recipe: @recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb
  * vagrant_box[sles11sp3] action create[2015-07-02T15:27:12-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-02T15:27:12-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:12-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
 (up to date)
[2015-07-02T15:27:13-07:00] INFO: Chef Run complete in 1.316378 seconds

Running handlers:
[2015-07-02T15:27:13-07:00] INFO: Running report handlers
Running handlers complete
[2015-07-02T15:27:13-07:00] INFO: Report handlers complete
Chef Client finished, 0/1 resources updated in 3.336512 seconds
dtumkursreeni-mac:examples dtumkursreeni$ chef-client -z vagrant_linux.rb vagrant_linux.rb 
[2015-07-02T15:27:32-07:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /Users/dtumkursreeni/chef
  One version per cookbook

[2015-07-02T15:27:32-07:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.4.0.rc.0
[2015-07-02T15:27:32-07:00] INFO: *** Chef 12.4.0.rc.0 ***
[2015-07-02T15:27:32-07:00] INFO: Chef-client pid: 54405
[2015-07-02T15:27:34-07:00] INFO: Run List is []
[2015-07-02T15:27:34-07:00] INFO: Run List expands to []
[2015-07-02T15:27:34-07:00] INFO: Starting Chef Run for dtumkursreeni
[2015-07-02T15:27:34-07:00] INFO: Running start handlers
[2015-07-02T15:27:34-07:00] INFO: Start handlers complete.
[2015-07-02T15:27:34-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
resolving cookbooks for run list: []
[2015-07-02T15:27:34-07:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-07-02T15:27:34-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:34-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:34-07:00] WARN: Chef::Resource::VagrantBox is marked as providing DSL vagrant_box, but provides :vagrant_box was never called!
[2015-07-02T15:27:34-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-02T15:27:34-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:34-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:34-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:34-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:34-07:00] WARN: Cloning resource attributes for vagrant_box[sles11sp3] from prior resource (CHEF-3694)
[2015-07-02T15:27:34-07:00] WARN: Previous vagrant_box[sles11sp3]: /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'
[2015-07-02T15:27:34-07:00] WARN: Current  vagrant_box[sles11sp3]: /Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb:3:in `from_file'
[2015-07-02T15:27:34-07:00] WARN: Node dtumkursreeni has an empty run list.
Converging 2 resources
Recipe: @recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb
  * vagrant_box[sles11sp3] action create[2015-07-02T15:27:34-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-02T15:27:34-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:34-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
 (up to date)
  * vagrant_box[sles11sp3] action create[2015-07-02T15:27:35-07:00] INFO: Processing vagrant_box[sles11sp3] action create (@recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb line 3)
[2015-07-02T15:27:35-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:35-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
 (up to date)
[2015-07-02T15:27:36-07:00] INFO: Chef Run complete in 2.487808 seconds

Running handlers:
[2015-07-02T15:27:36-07:00] INFO: Running report handlers
Running handlers complete
[2015-07-02T15:27:36-07:00] INFO: Report handlers complete
Chef Client finished, 0/2 resources updated in 4.515791 seconds
dtumkursreeni-mac:examples dtumkursreeni$ chef-client -z vagrant_linux.rb simple.rb 
[2015-07-02T15:27:52-07:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /Users/dtumkursreeni/chef
  One version per cookbook

[2015-07-02T15:27:52-07:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.4.0.rc.0
[2015-07-02T15:27:52-07:00] INFO: *** Chef 12.4.0.rc.0 ***
[2015-07-02T15:27:52-07:00] INFO: Chef-client pid: 54533
[2015-07-02T15:27:54-07:00] INFO: Run List is []
[2015-07-02T15:27:54-07:00] INFO: Run List expands to []
[2015-07-02T15:27:54-07:00] INFO: Starting Chef Run for dtumkursreeni
[2015-07-02T15:27:54-07:00] INFO: Running start handlers
[2015-07-02T15:27:54-07:00] INFO: Start handlers complete.
[2015-07-02T15:27:54-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
resolving cookbooks for run list: []
[2015-07-02T15:27:54-07:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-07-02T15:27:54-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:54-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:54-07:00] WARN: Chef::Resource::VagrantBox is marked as providing DSL vagrant_box, but provides :vagrant_box was never called!
[2015-07-02T15:27:54-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-02T15:27:54-07:00] WARN: Class Chef::Resource::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:54-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:54-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-07-02T15:27:54-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:54-07:00] WARN: Chef::Resource::Machine is marked as providing DSL machine, but provides :machine was never called!
[2015-07-02T15:27:54-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-02T15:27:54-07:00] WARN: Class Chef::Resource::Machine does not declare 'provides :machine'.
[2015-07-02T15:27:54-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:54-07:00] WARN: Node dtumkursreeni has an empty run list.
Converging 2 resources
Recipe: @recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/vagrant_linux.rb
  * vagrant_box[sles11sp3] action create[2015-07-02T15:27:54-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-02T15:27:54-07:00] WARN: Class Chef::Provider::VagrantBox does not declare 'provides :vagrant_box'.
[2015-07-02T15:27:54-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[Test] action converge[2015-07-02T15:27:55-07:00] INFO: Processing machine[Test] action converge (@recipe_files::/Users/dtumkursreeni/Tryitspossible/chef-provisioning/docs/examples/simple.rb line 77)
[2015-07-02T15:27:55-07:00] WARN: Class Chef::Provider::Machine does not declare 'provides :machine'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Test
[2015-07-02T15:27:55-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] WARN: Chef::Resource::VagrantCluster is marked as providing DSL vagrant_cluster, but provides :vagrant_cluster was never called!
[2015-07-02T15:27:55-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-02T15:27:55-07:00] WARN: Class Chef::Resource::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] INFO: Processing vagrant_cluster[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 77)
[2015-07-02T15:27:55-07:00] WARN: Class Chef::Provider::VagrantCluster does not declare 'provides :vagrant_cluster'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] INFO: Processing directory[/Users/dtumkursreeni/.chef/vms] action create (basic_chef_client::block line 15)
[2015-07-02T15:27:55-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Vagrantfile] action create (basic_chef_client::block line 16)
[2015-07-02T15:27:55-07:00] INFO: Processing file[/Users/dtumkursreeni/.chef/vms/Test.vm] action create (basic_chef_client::block line 232)
[2015-07-02T15:27:55-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Test.vm] created file /Users/dtumkursreeni/.chef/vms/Test.vm

    - create new file /Users/dtumkursreeni/.chef/vms/Test.vm[2015-07-02T15:27:55-07:00] INFO: file[/Users/dtumkursreeni/.chef/vms/Test.vm] updated file contents /Users/dtumkursreeni/.chef/vms/Test.vm

    - update content in file /Users/dtumkursreeni/.chef/vms/Test.vm from none to 36cb7c
    - --- /Users/dtumkursreeni/.chef/vms/Test.vm    2015-07-02 15:27:55.000000000 -0700
    - +++ /Users/dtumkursreeni/.chef/vms/.Test.vm20150702-54533-fnkcn1  2015-07-02 15:27:55.000000000 -0700
    - @@ -1 +1,9 @@
    - +Vagrant.configure('2') do |outer_config|
    - +  outer_config.vm.define "Test" 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-02T15:27:55-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] WARN: Chef::Resource::ChefNode is marked as providing DSL chef_node, but provides :chef_node was never called!
[2015-07-02T15:27:55-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-02T15:27:55-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] INFO: Processing chef_node[Test] action create (basic_chef_client::block line 77)
[2015-07-02T15:27:55-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:27:55-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:27:55-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/Test

    - create node Test 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"=>"Test", "vm_file_path"=>"/Users/dtumkursreeni/.chef/vms/Test.vm", "allocated_at"=>"2015-07-02 22:27:55 UTC", "host_node"=>"chefzero://localhost:8889/nodes/", "needs_reload"=>true}}
    - run vagrant up Test (status was 'not created')[2015-07-02T15:28:58-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:28:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:58-07:00] INFO: Processing chef_node[Test] action create (basic_chef_client::block line 57)
[2015-07-02T15:28:58-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:28:58-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.

    - update node Test 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-02T15:28:58-07:00] INFO: Executing sudo cp /etc/chef/client.pem /tmp/client.pem.1180258582 on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed cp /etc/chef/client.pem /tmp/client.pem.1180258582 on vagrant@172.16.127.172: exit status 1
[2015-07-02T15:28:59-07:00] ERROR: Unable to download /etc/chef/client.pem to /tmp/client.pem.1180258582 on vagrant@172.16.127.172 -- Error: command 'cp /etc/chef/client.pem /tmp/client.pem.1180258582' exited with code 1.

[2015-07-02T15:28:59-07:00] INFO: Executing sudo rm /tmp/client.pem.1180258582 on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed rm /tmp/client.pem.1180258582 on vagrant@172.16.127.172: exit status 1
[2015-07-02T15:28:59-07:00] WARN: Unable to clean up /tmp/client.pem.1180258582 on vagrant@172.16.127.172 -- Error: command 'rm /tmp/client.pem.1180258582' exited with code 1.

[2015-07-02T15:28:59-07:00] WARN: Class Chef::Resource::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] WARN: Chef::Resource::PrivateKey is marked as providing DSL private_key, but provides :private_key was never called!
[2015-07-02T15:28:59-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-02T15:28:59-07:00] WARN: Class Chef::Resource::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] INFO: Processing private_key[in_memory] action create (basic_chef_client::block line 77)
[2015-07-02T15:28:59-07:00] WARN: Class Chef::Provider::PrivateKey does not declare 'provides :private_key'.
[2015-07-02T15:28:59-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-02T15:28:59-07:00] INFO: Executing sudo ls -d /etc/chef/client.pem on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed ls -d /etc/chef/client.pem on vagrant@172.16.127.172: exit status 2
[2015-07-02T15:28:59-07:00] INFO: Executing sudo ls -d /etc/chef on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed ls -d /etc/chef on vagrant@172.16.127.172: exit status 2
[2015-07-02T15:28:59-07:00] INFO: Executing sudo mkdir -p /etc/chef on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed mkdir -p /etc/chef on vagrant@172.16.127.172: exit status 0

    - create directory /etc/chef on Test[2015-07-02T15:28:59-07:00] INFO: Executing sudo mkdir -p /etc/chef on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed mkdir -p /etc/chef on vagrant@172.16.127.172: exit status 0
[2015-07-02T15:28:59-07:00] INFO: Executing sudo mv /tmp/client.pem.250111036 /etc/chef/client.pem on vagrant@172.16.127.172
[2015-07-02T15:28:59-07:00] INFO: Completed mv /tmp/client.pem.250111036 /etc/chef/client.pem on vagrant@172.16.127.172: exit status 0

    - write file /etc/chef/client.pem on Test[2015-07-02T15:28:59-07:00] WARN: Class Chef::Resource::ChefClient does not declare 'provides :chef_client'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] WARN: Chef::Resource::ChefClient is marked as providing DSL chef_client, but provides :chef_client was never called!
[2015-07-02T15:28:59-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-02T15:28:59-07:00] WARN: Class Chef::Resource::ChefClient does not declare 'provides :chef_client'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] WARN: Class Chef::Resource::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] INFO: Processing chef_client[Test] action create (basic_chef_client::block line 77)
[2015-07-02T15:28:59-07:00] WARN: Class Chef::Provider::ChefClient does not declare 'provides :chef_client'.
[2015-07-02T15:28:59-07:00] WARN: This will no longer work in Chef 13: you must use 'provides' to provide DSL.
[2015-07-02T15:28:59-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/clients/Test

    - create client Test at clients
    -   add public_key = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyWlRqS4S8E0fU1w0lRXs\nQRcCm5Ayn5ZFrn7Q3lQGd8RJ5e2a8ddi32F6H9dt4QnBTf+zxoGq/Y8xnHnj5udV\nbCTVwggkvBxW1mmtufbcBVD+bdIH1QaSSq3cvlN/tkBLjsNLxdF8HsJ5WDER/Ek+\napAXXATyxUyDM/9KptlcX3Gwv8LFyog5+0iUM0u9qdDlAh/wqFOYDA9nJQ82g3ej\ndB5Mld54AFAIPnUIl0WMFy6kd70LVAJfyGCkGAnqszK+aj0z+QMHDlU9kBYK60Do\nlZciA8iNsSRIQbny80h7/FZ95CDs+npptDaVYcoZ0q/vn/iIpn3BI4vagaNKdRF7\nGwIDAQAB\n-----END PUBLIC KEY-----\n"[2015-07-02T15:28:59-07:00] INFO: Processing chef_node[Test] action create (basic_chef_client::block line 143)
[2015-07-02T15:28:59-07:00] WARN: Class Chef::Provider::ChefNode does not declare 'provides :chef_node'.
[2015-07-02T15:28:59-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[Test]'
    ================================================================================

    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("Test") 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:0x007f8342ad7510@/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-02T15:29:00-07:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-07-02T15:29:00-07:00] ERROR: Running exception handlers
Running handlers complete
[2015-07-02T15:29:00-07:00] ERROR: Exception handlers complete
[2015-07-02T15:29:00-07:00] FATAL: Stacktrace dumped to /Users/dtumkursreeni/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 67.978502 seconds
[2015-07-02T15:29:00-07:00] ERROR: machine[Test] (@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-02T15:29:00-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
dtumkursreeni-mac:examples dtumkursreeni$ 
tyler-ball commented 9 years ago

Okay, this looks like a valid issue now - its an error forwarding the port. Can you include the output of /Users/dtumkursreeni/.chef/local-mode-cache/cache/chef-stacktrace.out as a gist so we can see the stacktrace? Do you know if there is a configuration on your workstation that would prevent forwarding 8889 from your vagrant instance to your workstation? Does SLES have some kind of firewalling or port restrction turned on by default? What happens if you try to use precise64 instead of SLES?

ghost commented 9 years ago

Hey @tyler-ball , Now, I am trying with VSphere as provider; I have hit with the same error (unfortunately). can you please, tell us why it is forwarding the port?

This is my config file: https://gist.github.com/DarshanMurthy/c4227990c45eacd8c398

Here's log: https://gist.github.com/DarshanMurthy/c0d61b883bf482ba35e6#file-log. Thanks, Darshan

christinedraper commented 9 years ago

@tyler-ball see #392 for a stacktrace.

@DarshanMurthy - I think you managed to get my blog example on vagrant working with a ubuntu VM? If so it is more likely something about the network or the client VM's setup than your workstation. Are you using the same client VM in both the vagrant and vsphere cases? As tyler said above, is there anything about their setup which could be restricting ports?

ghost commented 9 years ago

@christinedraper : I followed your blog with this config file(https://gist.github.com/DarshanMurthy/38e1516fe003f0c78d7e)

Yes I'm using same client VM

Nothing restrictions as such we tested all the way to prevent firewall issues.

hh commented 9 years ago

I'm running into the same error on a centos 7 box with chef server running locally. I think it has something to do with services already listening on those ports. It might be possible to have chef-provisioning check to see what other ports are available if it can't create on on 443 for example.

ghost commented 9 years ago

@hh is this the error: Error forwarding port: could not forward 8889 or 0 ?

hh commented 9 years ago

I have a stanza like this where the chef server is actually running on this box:

with_chef_server 'https://chef.customer.com/organizations/customer',
  :client_name => Chef::Config[:node_name],
  :signing_key_filename => Chef::Config[:client_key]
machine 'foo'

The code has worked fine before on boxes that are not also running chef-server 12

hh commented 9 years ago

The stacktrace:

RuntimeError: machine[admin-2015-07-22-1] (@recipe_files::/home/prov/customer/code/provisioning/sync_server.rb line 77) had an error: RuntimeError: Error forwarding port: could not forward 443 or 0
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provisioning/transport/ssh.rb:147:in `make_url_available_to_remote'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provisioning/machine/basic_machine.rb:75:in `make_url_available_to_remote'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provisioning/convergence_strategy/precreate_chef_objects.rb:22:in `setup_convergence'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provisioning/convergence_strategy/install_sh.rb:40:in `setup_convergence'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provisioning/machine/basic_machine.rb:17:in `setup_convergence'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-provisioning-1.1.1/lib/chef/provider/machine.rb:57:in `block in <class:Machine>'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:60:in `instance_eval'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:60:in `recipe_eval_with_update_check'
/opt/chefdk/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:45:in `block in action'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:130:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:562:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:339:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:334:in `catch'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:334:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:353:in `converge_and_save'
/opt/chefdk/embedded/apps/chef/lib/chef/client.rb:457:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:271:in `block in fork_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:259:in `fork'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:259:in `fork_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:225:in `block in run_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/local_mode.rb:39:in `with_server_connectivity'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:213:in `run_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:402:in `block in interval_run_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:392:in `loop'
/opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:392:in `interval_run_chef_client'
/opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:382:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application.rb:60:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:51:in `load'
ghost commented 9 years ago

I have been facing similar problem :( .... I didnt find solution or work around.

btw why dont you try chef-zero server? (for others it is working)

machine "Test17" do chef_server( :chef_server_url => 'http://MAC_OS_IP:8889') # explicitly specify the chef server url in chef_vsphere_config.rb. The IP is the server where you run 'chef-client -z chef_vsphere_config.rb' run_list [''] end

tyler-ball commented 9 years ago

@hh Can you try with version 1.2 of chef-provisioning and see if you get the same error? Looking at the code though, I'm guessing that won't fix it.d

Running chef-client on the same machine thats running the Chef Server shouldn't be an issue... It is the provisioned machine that is having its ports forwarded so it can communicate with the chef server. My guess is that the is_local_machine is succeeding on the chef.customer.com host, but when it tries to forward 443 on the provisioned machine that fails because it is a port less than 1000. Can you try updating your with_chef_server url to include the real port the chef service is running on? I would be curious to see if that still fails.

When the chef server is not the same machine as the provisioning node, then the is_local_machine check fails and no port-forwarding is attempted. We could also make that forwarding toggleable, or make it only look for localhost or 127.0.0.1

tyler-ball commented 9 years ago

Hey @DarshanMurthy its been a while since we heard from you - I'm going to close this but please re-open or file a new issue if you want to continue troubleshooting!

hh commented 9 years ago

I think for me this had to do with running the chef-client (running the chef-provisioning machine resource) on the chef-server itself. I have since moved to a provisioning that was not running on the chef server itself and the issue went away.