markolson / chef-ssh

Chef cookbook for managing some mildly-difficult-to-automate SSH configuration
39 stars 54 forks source link

default_or_user_path from ssh_config_helpers now not found #32

Closed lonniev closed 9 years ago

lonniev commented 9 years ago
==> vb-tt-dev: [2014-12-15T10:16:17-07:00] ERROR: ssh_known_hosts[bitbucket.org] (get-gitrepos::default line 54) had an error: NoMethodError: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'

@tejaycar did you just change something here with the PR merge?

lonniev commented 9 years ago

Newbie here thinks he sees the issue:

require 'shellwords'
include Chef::SSH::Helpers

action :add do

Notice that you do not include the Chef::SSH::ConfigHelpers library. (If you had, it would have indirectly included the original Chef::SSH:Helpers file, also.)

lonniev commented 9 years ago

When I revert back to the 0.6.6 version with commit 8cd907f01b31c6277e8b1e5272c1a0257a30d2b8, I still get this NoMethodError. This wasn't happening last week. What is changed this week?

tejaycar commented 9 years ago

@lonniev If you're still getting the issue with version 0.6.6, then the change must be outside this cookbook. If you can give me a full stacktrace, I may be able to help nail down the root issue. Chef errors are not always the most self explanatory.

lonniev commented 9 years ago

Is this enough?

==> vb-tt-dev: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'
==> vb-tt-dev: 
==> vb-tt-dev: Cookbook Trace:
==> vb-tt-dev: ---------------
==> vb-tt-dev: /tmp/vagrant-chef-2/chef-solo-1/cookbooks/ssh/providers/known_hosts.rb:6:in `block in class_from_file'
==> vb-tt-dev: 
==> vb-tt-dev: Resource Declaration:
==> vb-tt-dev: ---------------------
==> vb-tt-dev: # In /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb
==> vb-tt-dev: 
==> vb-tt-dev:  54:     ssh_known_hosts "#{repo['host']}" do
==> vb-tt-dev:  55:       user gitUserName
==> vb-tt-dev:  56:       path sshDir.join( "known_hosts" ).to_s
==> vb-tt-dev:  57:       hashed true
==> vb-tt-dev:  58:     end
==> vb-tt-dev:  59: 
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: Compiled Resource:
==> vb-tt-dev: ------------------
==> vb-tt-dev: # Declared in /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb:54:in `block (2 levels) in from_file'
==> vb-tt-dev: 
==> vb-tt-dev: ssh_known_hosts("bitbucket.org") do
==> vb-tt-dev:   action :add
==> vb-tt-dev:   retries 0
==> vb-tt-dev:   retry_delay 2
==> vb-tt-dev:   default_guard_interpreter :default
==> vb-tt-dev:   cookbook_name :"get-gitrepos"
==> vb-tt-dev:   recipe_name "default"
==> vb-tt-dev:   user "lvanzandt"
==> vb-tt-dev:   path "/home/lvanzandt/.ssh/known_hosts"
==> vb-tt-dev:   hashed true
==> vb-tt-dev: end
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: [2014-12-15T10:35:47-07:00] ERROR: Running exception handlers
==> vb-tt-dev: [2014-12-15T10:35:47-07:00] ERROR: Exception handlers complete
==> vb-tt-dev: [2014-12-15T10:35:47-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> vb-tt-dev: [2014-12-15T10:35:47-07:00] ERROR: ssh_known_hosts[bitbucket.org] (get-gitrepos::default line 54) had an error: NoMethodError: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'
==> vb-tt-dev: [2014-12-15T10:35:47-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

I suspect some kind of include/depends oversight.

lonniev commented 9 years ago

One can see the client code at https://github.com/lonniev/get-gitrepos

There is also manage-users at https://github.com/lonniev/manage-users

tejaycar commented 9 years ago

Yea, that should be enough. I think I may be missing a test case which let this slip through. I'll see what I can find.

On Mon, Dec 15, 2014 at 10:50 AM, Lonnie VanZandt notifications@github.com wrote:

One can see the client code at https://github.com/lonniev/get-gitrepos

There is also manage-users at https://github.com/lonniev/manage-users

— Reply to this email directly or view it on GitHub https://github.com/markolson/chef-ssh/issues/32#issuecomment-67034667.

tejaycar commented 9 years ago

@lonniev, Can you run this again with v0.10.0? The stacktrace you gave me is with 0.6.6.

lonniev commented 9 years ago

It isn't much different:

==> vb-tt-dev: 
==> vb-tt-dev: ================================================================================
==> vb-tt-dev: Error executing action `add` on resource 'ssh_known_hosts[bitbucket.org]'
==> vb-tt-dev: ================================================================================
==> vb-tt-dev: 
==> vb-tt-dev: NoMethodError
==> vb-tt-dev: -------------
==> vb-tt-dev: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: Cookbook Trace:
==> vb-tt-dev: ---------------
==> vb-tt-dev: /tmp/vagrant-chef-2/chef-solo-1/cookbooks/ssh/providers/known_hosts.rb:6:in `block in class_from_file'
==> vb-tt-dev: 
==> vb-tt-dev: Resource Declaration:
==> vb-tt-dev: ---------------------
==> vb-tt-dev: # In /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev:  54:     ssh_known_hosts "#{repo['host']}" do
==> vb-tt-dev: 
==> vb-tt-dev:  55:       user gitUserName
==> vb-tt-dev: 
==> vb-tt-dev:  56:       path sshDir.join( "known_hosts" ).to_s
==> vb-tt-dev:  57:       hashed true
==> vb-tt-dev:  58:     end
==> vb-tt-dev:  59: 
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: Compiled Resource:
==> vb-tt-dev: 
==> vb-tt-dev: ------------------
==> vb-tt-dev: # Declared in /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb:54:in `block (2 levels) in from_file'
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: ssh_known_hosts("bitbucket.org") do
==> vb-tt-dev: 
==> vb-tt-dev:   action :add
==> vb-tt-dev: 
==> vb-tt-dev:   retries 0
==> vb-tt-dev:   retry_delay 2
==> vb-tt-dev: 
==> vb-tt-dev:   default_guard_interpreter :default
==> vb-tt-dev: 
==> vb-tt-dev:   cookbook_name :"get-gitrepos"
==> vb-tt-dev: 
==> vb-tt-dev:   recipe_name "default"
==> vb-tt-dev:   user "lvanzandt"
==> vb-tt-dev:   path "/home/lvanzandt/.ssh/known_hosts"
==> vb-tt-dev: 
==> vb-tt-dev:   hashed true
==> vb-tt-dev: end
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: 
==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: Running exception handlers
==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: Exception handlers complete
==> vb-tt-dev: [2014-12-15T11:00:25-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: ssh_known_hosts[bitbucket.org] (get-gitrepos::default line 54) had an error: NoMethodError: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'
==> vb-tt-dev: [2014-12-15T11:00:25-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
tejaycar commented 9 years ago

I'd suggest you log into the vagrant box directly and take a look at /tmp/vagrant-chef-2/chef-solo-1/cookbooks/ssh/metadata.rb I don't think you actually have the 0.10.0 version, as line 6 of known_hosts.rb in 0.10 is a call to `use_inline_resources', which I'm pretty sure isn't not going to throw that error.

On Mon, Dec 15, 2014 at 11:02 AM, Lonnie VanZandt notifications@github.com wrote:

It isn't much different:

==> vb-tt-dev: ==> vb-tt-dev: ================================================================================ ==> vb-tt-dev: Error executing action add on resource 'ssh_known_hosts[bitbucket.org]' ==> vb-tt-dev: ================================================================================ ==> vb-tt-dev: ==> vb-tt-dev: NoMethodError ==> vb-tt-dev: ------------- ==> vb-tt-dev: No resource or method named default_or_user_path' forChef::Provider::SshKnownHosts ""'==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: Cookbook Trace:==> vb-tt-dev: ---------------==> vb-tt-dev: /tmp/vagrant-chef-2/chef-solo-1/cookbooks/ssh/providers/known_hosts.rb:6:in block in class_from_file'==> vb-tt-dev: ==> vb-tt-dev: Resource Declaration:==> vb-tt-dev: ---------------------==> vb-tt-dev: # In /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: 54: ssh_known_hosts "#{repo['host']}" do==> vb-tt-dev: ==> vb-tt-dev: 55: user gitUserName==> vb-tt-dev: ==> vb-tt-dev: 56: path sshDir.join( "known_hosts" ).to_s==> vb-tt-dev: 57: hashed true==> vb-tt-dev: 58: end==> vb-tt-dev: 59: ==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: Compiled Resource:==> vb-tt-dev: ==> vb-tt-dev: ------------------==> vb-tt-dev: # Declared in /tmp/vagrant-chef-2/chef-solo-1/cookbooks/get-gitrepos/recipes/default.rb:54:inblock (2 levels) in from_file' ==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: ssh_known_hosts("bitbucket.org") do ==> vb-tt-dev: ==> vb-tt-dev: action :add ==> vb-tt-dev: ==> vb-tt-dev: retries 0 ==> vb-tt-dev: retry_delay 2 ==> vb-tt-dev: ==> vb-tt-dev: default_guard_interpreter :default ==> vb-tt-dev: ==> vb-tt-dev: cookbook_name :"get-gitrepos" ==> vb-tt-dev: ==> vb-tt-dev: recipe_name "default" ==> vb-tt-dev: user "lvanzandt" ==> vb-tt-dev: path "/home/lvanzandt/.ssh/known_hosts" ==> vb-tt-dev: ==> vb-tt-dev: hashed true ==> vb-tt-dev: end ==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: ==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: Running exception handlers ==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: Exception handlers complete ==> vb-tt-dev: [2014-12-15T11:00:25-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out ==> vb-tt-dev: [2014-12-15T11:00:25-07:00] ERROR: ssh_known_hosts[bitbucket.org](get-gitrepos::default line 54) had an error: NoMethodError: No resource or method named default_or_user_path' forChef::Provider::SshKnownHosts ""'==> vb-tt-dev: [2014-12-15T11:00:25-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)Chef never successfully completed! Any errors should be visible in theoutput above. Please fix your recipes so that they properly complete.

— Reply to this email directly or view it on GitHub https://github.com/markolson/chef-ssh/issues/32#issuecomment-67036633.

lonniev commented 9 years ago

metadata.rb on the guest VM does claim that the cookbook is 0.10.0. I'll do a vagrant reload just to be sure. Currently, too, the Cheffile has no :ref argument and so it should be pulling down master from the repo for me.

lonniev commented 9 years ago

Same thing:

==> vb-tt-dev: NoMethodError
==> vb-tt-dev: -------------
==> vb-tt-dev: No resource or method named `default_or_user_path' for `Chef::Provider::SshKnownHosts ""'
==> vb-tt-dev: 
==> vb-tt-dev: Cookbook Trace:
==> vb-tt-dev: ---------------
==> vb-tt-dev: /tmp/vagrant-chef-2/chef-solo-1/cookbooks/ssh/providers/known_hosts.rb:6:in `block in class_from_file'
==> vb-tt-dev: 

There is no call to use_inline_resources in the known_hosts.rb file either locally or on the remote.

lonniev commented 9 years ago

The master branch version at 8cd907f01b31c6277e8b1e5272c1a0257a30d2b8 also lacks what you expect. Did you fail to push your commit?

tejaycar commented 9 years ago

Oh boy. Yea, something went very wrong with the merge. I'll see what I can do. Meanwhile, you may try pulling it from the supermarket (which should be correct)

lonniev commented 9 years ago

It has that smell. Ok, I'll drop the :github qualifier from the Cheffile and see what comes fresh from the supermarket. Good luck.

tejaycar commented 9 years ago

@lonniev Ok, I just re-released v0.10.0 on github to agree with what is in the supermarket. I'm not sure how I missed all of that when I pushed, but it should be clean now.

lonniev commented 9 years ago

np. The use of the supermarket variant worked fine and so I am back to other issues. Thanks for the attention here.

tejaycar commented 9 years ago

anytime.

On Mon, Dec 15, 2014 at 1:04 PM, Lonnie VanZandt notifications@github.com wrote:

np. The use of the supermarket variant worked fine and so I am back to other issues. Thanks for the attention here.

— Reply to this email directly or view it on GitHub https://github.com/markolson/chef-ssh/issues/32#issuecomment-67056006.