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

"Cannot forward a socketless Chef Zero server" error when following Vagrant try it out #597

Open
clems4ever opened this issue Sep 17, 2017 · 1 comment

Comments

@clems4ever
Copy link

Hello,
When I tried to follow the try it out section for Vagrant, the first run ended up with the following error when running:

bundle exec chef-client -z vagrant_linux.rb simple.rb

* machine[mario] action converge/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/cheffish-13.0.0/lib/cheffish/merged_config.rb:6: warning: toplevel constant Mash referenced by Chef::Mash
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/cheffish-13.0.0/lib/cheffish/merged_config.rb:7: warning: toplevel constant Mash referenced by Chef::Mash
:paranoid is deprecated, please use :verify_host_key. Supported values are exactly the same, only the name of the option has changed.

    
    ================================================================================
    Error executing action `converge` on resource 'machine[mario]'
    ================================================================================
    
    RuntimeError
    ------------
    Cannot forward a socketless Chef Zero server, see https://docs.chef.io/deprecations_local_listen.html for more information
    
    Resource Declaration:
    ---------------------
    # In /home/clement/projects/chef-provisioning/docs/examples/simple.rb
    
      3: machine 'mario' do
      4:   tag 'itsa_me'
      5:   converge true
      6: end
    
    Compiled Resource:
    ------------------
    # Declared in /home/clement/projects/chef-provisioning/docs/examples/simple.rb:3:in `from_file'
    
    machine("mario") do
      action [:converge]
      default_guard_interpreter :default
      chef_server {:chef_server_url=>"chefzero://localhost:1", :options=>{:client_name=>"clement-N56VB", :signing_key_filename=>nil, :api_version=>"0"}}
      chef_environment nil
      driver "vagrant"
      machine_options {:vagrant_options=>{"vm.box"=>"precise64"}}
      declared_type :machine
      cookbook_name "@recipe_files"
      recipe_name "/home/clement/projects/chef-provisioning/docs/examples/simple.rb"
      attribute_modifiers [["tags", #<Proc:0x0000000004e304f0@/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/cheffish-13.0.0/lib/cheffish/node_properties.rb:39>]]
      converge true
      node_properties_name "mario"
    end
    
    System Info:
    ------------
    chef_version=13.4.24
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
    program_name=chef-client worker: ppid=11123;start=13:21:19;
    executable=/opt/chefdk/embedded/bin/bundle

The solution is to run the command with the following flags

`bundle exec chef-client --local-mode --listen -z vagrant_linux.rb simple.rb` 

as stated in the doc: https://github.com/chef/chef-web-docs/blob/master/chef_master/source/deprecations_local_listen.rst

I think it would be great to have a troubleshooting section somewhere to mention it or directly put it in the snippet. What do you think?

@korney4eg
Copy link

If you look to chef-client --help, you will notice that --local-mode is -z, so no need to have both. Anyway thank you for solution.

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

No branches or pull requests

2 participants