{"action":"closed","issue":{"url":"https://api.github.com/repos/chef-cookbooks/jenkins/issues/614","repository_url":"https://api.github.com/repos/chef-cookbooks/jenkins","labels_url":"https://api.github.com/repos/chef-cookbooks/jenkins/issues/614/labels{/name}","comments_url":"https://api.github.com/repos/chef-cookbooks/jenkins/issues/614/comments","events_url":"https://api.github.com/repos/chef-cookbooks/jenkins/issues/614/events","html_url":"https://github.com/chef-cookbooks/jenkins/issues/614","id":228288550,"number":614,"title":"Plugin installation fails via jenkins_plugin action","user":{"login":"isuftin","id":928288,"avatar_url":"https://avatars0.githubusercontent.com/u/928288?v=3","gravatar_id":"","url":"https://api.github.com/users/isuftin","html_url":"https://github.com/isuftin","followers_url":"https://api.github.com/users/isuftin/followers","following_url":"https://api.github.com/users/isuftin/following{/other_user}","gists_url":"https://api.github.com/users/isuftin/gists{/gist_id}","starred_url":"https://api.github.com/users/isuftin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isuftin/subscriptions","organizations_url":"https://api.github.com/users/isuftin/orgs","repos_url":"https://api.github.com/users/isuftin/repos","events_url":"https://api.github.com/users/isuftin/events{/privacy}","received_events_url":"https://api.github.com/users/isuftin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-12T13:14:57Z","updated_at":"2017-07-04T19:32:39Z","closed_at":"2017-07-04T19:32:39Z","body":"When using the jenkins_plugin action with a named plugin, Jenkins CLI fails to install the plugin seemingly because of an inability to read the file path URI as a valid path.\r\n\r\nSee output at bottom.\r\n\r\nI am also able to log into the VM and manually run the failing command:\r\n```\r\n\"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api\r\nMay 12, 2017 1:13:48 PM org.apache.sshd.common.util.SecurityUtils register\r\nINFO: BouncyCastle not registered, using the default JCE provider\r\nMay 12, 2017 1:13:49 PM hudson.cli.SSHCLI$1 verifyServerKey\r\nWARNING: Unknown host key for localhost/127.0.0.1:46881\r\n/tmp/kitchen/cache/display-url-api-2.0.plugin is neither a valid file, URL, nor a plugin artifact name in the update center\r\n\r\nERROR: Error occurred, see previous output.\r\n```\r\n\r\nHowever, if I add `file://` to the beginning of the path to the plugin on the VM, it works:\r\n```\r\n\"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin file:///tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api\r\nMay 12, 2017 1:14:01 PM org.apache.sshd.common.util.SecurityUtils register\r\nINFO: BouncyCastle not registered, using the default JCE provider\r\nMay 12, 2017 1:14:01 PM org.apache.sshd.client.keyverifier.DefaultKnownHostsServerKeyVerifier reloadKnownHosts\r\nWARNING: reloadKnownHosts(/home/vagrant/.ssh/known_hosts) invalid file permissions: Permissions violation (GROUP_WRITE)\r\nMay 12, 2017 1:14:01 PM hudson.cli.SSHCLI$1 verifyServerKey\r\nWARNING: Unknown host key for localhost/127.0.0.1:46881\r\nInstalling a plugin from file:/tmp/kitchen/cache/display-url-api-2.0.plugin\r\n```\r\n\r\n### Cookbook version\r\n5.0.1\r\n\r\n### Chef-client version\r\n13.0.118\r\n\r\n### Platform Details\r\nCentOS 6.8 VM in VirtualBox. Running on MacOS 10.10.x\r\n\r\n### Scenario:\r\nRunning Jenkins server created via the Jenkins cookbook. SSHd service is running (though this fails via http protocol as well). \r\n\r\n### Steps to Reproduce:\r\nRun action:\r\n```\r\njenkins_plugin 'display-url-api' do\r\n    version '2.0'\r\n    install_deps true\r\n    notifies :restart, 'service[jenkins]', :delayed\r\n  end\r\n```\r\n\r\n### Expected Result:\r\nPlugin is installed \r\n\r\n### Actual Result:\r\n```\r\n           ================================================================================\r\n           Error executing action `install` on resource 'jenkins_plugin[display-url-api]'\r\n           ================================================================================\r\n\r\n           Mixlib::ShellOut::ShellCommandFailed\r\n           ------------------------------------\r\n           Expected process to exit with [0], but received '5'\r\n           ---- Begin output of \"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api  ----\r\n           STDOUT: /tmp/kitchen/cache/display-url-api-2.0.plugin is neither a valid file, URL, nor a plugin artifact name in the update center\r\n           STDERR: May 12, 2017 1:06:29 PM org.apache.sshd.common.util.SecurityUtils register\r\n           INFO: BouncyCastle not registered, using the default JCE provider\r\n           May 12, 2017 1:06:29 PM hudson.cli.SSHCLI$1 verifyServerKey\r\n           WARNING: Unknown host key for localhost/127.0.0.1:46881\r\n\r\n           ERROR: Error occurred, see previous output.\r\n           ---- End output of \"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api  ----\r\n           Ran \"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api  returned 5\r\n\r\n           Cookbook Trace:\r\n           ---------------\r\n           /tmp/kitchen/cache/cookbooks/jenkins/libraries/_executor.rb:87:in `execute!'\r\n           /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:317:in `install_plugin_from_url'\r\n           /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:289:in `install_plugin_from_update_center'\r\n           /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:124:in `block (2 levels) in <class:JenkinsPlugin>'\r\n           /tmp/kitchen/cache/cookbooks/jenkins/libraries/plugin.rb:154:in `block in <class:JenkinsPlugin>'\r\n\r\n           Resource Declaration:\r\n           ---------------------\r\n           # In /tmp/kitchen/cache/cookbooks/owi_jenkins/recipes/plugins.rb\r\n\r\n            15:   jenkins_plugin plugin do\r\n            16:     version version if version\r\n            17:     install_deps true\r\n            18:     notifies :restart, 'service[jenkins]', :delayed\r\n            19:   end\r\n            20: end\r\n\r\n           Resource Declaration:\r\n           ---------------------\r\n           # In /tmp/kitchen/cache/cookbooks/owi_jenkins/recipes/plugins.rb\r\n\r\n            15:   jenkins_plugin plugin do\r\n            16:     version version if version\r\n            17:     install_deps true\r\n            18:     notifies :restart, 'service[jenkins]', :delayed\r\n            19:   end\r\n            20: end\r\n\r\n           Compiled Resource:\r\n           ------------------\r\n           # Declared in /tmp/kitchen/cache/cookbooks/owi_jenkins/recipes/plugins.rb:15:in `block in from_file'\r\n\r\n           jenkins_plugin(\"display-url-api\") do\r\n             action [:install]\r\n             default_guard_interpreter :default\r\n             declared_type :jenkins_plugin\r\n             cookbook_name \"owi_jenkins\"\r\n             recipe_name \"plugins\"\r\n             version \"2.0\"\r\n             install_deps true\r\n           end\r\n\r\n           System Info:\r\n           ------------\r\n           chef_version=13.0.118\r\n           platform=centos\r\n           platform_version=6.8\r\n           ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]\r\n           program_name=chef-client worker: ppid=10770;start=13:06:20;\r\n           executable=/opt/chef/bin/chef-client\r\n\r\n       ---- Begin output of \"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api  ----\r\n       STDOUT: /tmp/kitchen/cache/display-url-api-2.0.plugin is neither a valid file, URL, nor a plugin artifact name in the update center\r\n       STDERR: May 12, 2017 1:06:29 PM org.apache.sshd.common.util.SecurityUtils register\r\n       INFO: BouncyCastle not registered, using the default JCE provider\r\n       May 12, 2017 1:06:29 PM hudson.cli.SSHCLI$1 verifyServerKey\r\n       WARNING: Unknown host key for localhost/127.0.0.1:46881\r\n\r\n       ERROR: Error occurred, see previous output.\r\n       ---- End output of \"/usr/lib/jvm/java/bin/java\" -jar \"/tmp/kitchen/cache/jenkins-cli.jar\" -s http://localhost:8080 -\"ssh\" -user \"jenkins\" install-plugin /tmp/kitchen/cache/display-url-api-2.0.plugin -name display-url-api  ----\r\n```\r\n"}}
{"actor":{"display_login":"tas50"}}