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

Plugins added to the Security Advisory have non-descriptive errors #600

Open
sherzberg opened this issue Apr 22, 2017 · 0 comments
Open

Comments

@sherzberg
Copy link

Cookbook version

5.0.0

Chef-client version

13.0.118

Platform Details

Ubuntu 16.04

Scenario:

Installing a plugin that has been removed from the update center json throws a non-descriptive error. This issue was noticed during a chef run with plugins that now have been added to this security advisory (https://jenkins.io/security/advisory/2017-04-10/) which are have been removed from the update center json file used to install plugins.

Steps to Reproduce:

Use this as the recipe on server without the artifactdeployer plugin already installed:

include_recipe 'jenkins::master'

jenkins_plugin 'artifactdeployer' do
  version '0.33'
end

Expected Result:

Maybe a more descriptive error about the security advisory? I'm not sure what the best way to handle this is. The removed plugins are listed in the update center json as a security advisory, so maybe look there if the plugin cannot be installed and give the user warning message?

Actual Result:

A non-descriptive error:

stacktrace ``` * 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[artifactdeployer]'
       ================================================================================
       
       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/cookbook-jenkins-playground/recipes/default.rb
       
         3: jenkins_plugin 'artifactdeployer' do
         4:   version '0.33'
         5: end
       
       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/cookbook-jenkins-playground/recipes/default.rb:3:in `from_file'
       
       jenkins_plugin("artifactdeployer") do
         action [:install]
         default_guard_interpreter :default
         declared_type :jenkins_plugin
         cookbook_name "cookbook-jenkins-playground"
         recipe_name "default"
         version "0.33"
       end
       
       System Info:
       ------------
       chef_version=13.0.118
       platform=ubuntu
       platform_version=16.04
       ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
       program_name=chef-client worker: ppid=3066;start=13:20:00;
       executable=/opt/chef/bin/chef-client
       
   
   Running handlers:
   [2017-04-22T13:21:35+00:00] ERROR: Running exception handlers
   [2017-04-22T13:21:35+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2017-04-22T13:21:35+00:00] ERROR: Exception handlers complete
   [2017-04-22T13:21:35+00:00] ERROR: Exception handlers complete
   Chef Client failed. 12 resources updated in 01 minutes 34 seconds
   [2017-04-22T13:21:35+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-04-22T13:21:35+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-04-22T13:21:35+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-04-22T13:21:35+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-04-22T13:21:35+00:00] ERROR: jenkins_plugin[artifactdeployer] (cookbook-jenkins-playground::default line 3) had an error: NoMethodError: undefined method `[]' for nil:NilClass
   [2017-04-22T13:21:35+00:00] ERROR: jenkins_plugin[artifactdeployer] (cookbook-jenkins-playground::default line 3) had an error: NoMethodError: undefined method `[]' for nil:NilClass
   [2017-04-22T13:21:35+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
   [2017-04-22T13:21:35+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
</details>
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

3 participants