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

jenkins_plugin emits unhelpful error message when plugin does not exist #612

Open
jayhendren opened this issue May 11, 2017 · 1 comment

Comments

@jayhendren
Copy link

jayhendren commented May 11, 2017

It took me a little while to figure out that the following occurs when the plugin being installed does not exist. At first, I inferred from this error message that there was a bug in jenkins_plugin, not that the plugin does not exist.

Recipe: cub_jenkins::master
  * jenkins_plugin[foobar] action install
  Recipe: <Dynamically Defined Resource>
    * remote_file[/tmp/kitchen/cache/update-center.json] action create (up to date) 
    * file[/tmp/kitchen/cache/extracted-update-center.json] action create (up to date) 
    
    ================================================================================
    Error executing action `install` on resource 'jenkins_plugin[foobar]'
    ================================================================================
    
    NoMethodError
    -------------
    undefined method `[]' for nil:NilClass
    
    Cookbook Trace:
    ---------------
    /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:267:in `install_plugin_from_update_center'
    /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:124:in `block (2 levels) in <class:JenkinsPlugin>'
    /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:154:in `block in <class:JenkinsPlugin>'
    
    Resource Declaration:
    ---------------------
    # In /tmp/kitchen/cache/cookbooks/cub_jenkins/recipes/master.rb
    
      5: node['cub_jenkins']['plugins'].each { |p| jenkins_plugin p }
      6: 
    
    Compiled Resource:
    ------------------
    # Declared in /tmp/kitchen/cache/cookbooks/cub_jenkins/recipes/master.rb:5:in `block in from_file'
    
    jenkins_plugin("foobar") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :jenkins_plugin
      cookbook_name "cub_jenkins"
      recipe_name "master"
    end
    
    Platform:  
    ---------
    x86_64-linux
@iennae
Copy link
Contributor

iennae commented May 11, 2017

We discussed this last week in our issue triage. We know about it, and when we rewrite this resource will resolve this issue. With ChefConf coming up shortly, this will be completed most likely post-ChefConf.

Thanks for reporting.

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

4 participants