voxpupuli / puppet-jenkins

Puppet module for Jenkins
http://forge.puppetlabs.com/puppet/jenkins
Apache License 2.0
275 stars 565 forks source link

PLUGIN: upgrade doesn't work for some reason #731

Open v1v opened 7 years ago

v1v commented 7 years ago

Hi there,

I'm trying to upgrade a particular existing plugin within the plugin dsl but for some reason if that file already exists it doesn't download it, it used to work when using vesion 1.3.0 but with the latest one (1.7.0) it doesn't work as expected. See the below details about the setup, and what's the output of the puppet run:

Current setup:

Puppet code:

  jenkins::plugin { 'build-failure-analyzer' : version => '1.17.2' }

Current jenkins configuration:

root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# cat  build-failure-analyzer/META-INF/MANIFEST.MF  | grep -i plugin-version
Plugin-Version: 1.13.0

Current puppet log output with some verbose

Debug: Facter: fact "jenkins_plugins" has resolved to "Exclusion 0.10, WebSVN2 0.9, ace-editor 1.1, active-directory 1.38, analysis-collector 1.41, analysis-core 1.79, ansicolor 0.4.2, ant 1.2, antexec 1.10, antisamy-markup-formatter 1.2, artifactory 2.2.4, audit-trail 2.0, avatar 1.2, aws-credentials 1.11, aws-java-sdk 1.11.68, backup 1.6.1, bouncycastle-api 2.16.0, branch-api 1.11.1, build-blocker-plugin 1.7.3, build-failure-analyzer 1.13.0, build-flow-plugin 0.12, build-keeper-plugin 1.3, build-monitor-plugin 1.6+build.150, build-name-setter 1.3, build-pipeline-plugin 1.4.4, build-publisher 1.21, build-timeout 1.14.1, build-user-vars-plugin 1.4, build-with-parameters 1.1, buildgraph-view 1.1.1, buildtriggerbadge 1.2, categorized-view 1.8, changes-since-last-success 0.5, checkstyle 3.39, chucknorris 0.5, ci-game 1.20, claim 2.3, clang-scanbuild-plugin 1.4, clone-workspace-scm 0.6, cloudbees-folder 5.13, cobertura 1.9.8, compact-columns 1.10, conditional-buildstep 1.3.3, config-file-provider 2.10.0, configurationslicing 1.38.3, configure-job-column-plugin 1.0, confluence-publisher 1.8, console-column-plugin 1.5, copyartifact 1.31, cors-filter 1.0, cppcheck 1.20, credentials 2.1.11, cron_column 1.4, cucumber-testresult-plugin 0.9.7, custom-tools-plugin 0.4.4, cvs 2.12, dashboard-view 2.9.10, database 1.3, database-mysql 1.0, delivery-pipeline-plugin 0.8.2, description-setter 1.9, disable-failed-job 1.11, display-url-api 0.5, doclinks 0.6, doxygen 0.16, durable-task 1.13, dynamicparameter 0.2.0, ec2 1.36, email-ext 2.38.2, embeddable-build-status 1.9, envfile 1.2, envinject 1.90, extended-choice-parameter 0.34, external-monitor-job 1.6, extreme-notification 1.3, feature-branch-notifier 1.4, findbugs 4.62, fstrigger 0.39, ghprb 1.29.7, git 2.4.1, git-client 2.2.1, git-parameter 0.4.0, git-server 1.7, github 1.25.1, github-api 1.84, global-build-stats 1.3, gradle 1.24, grails 1.7, gravatar 2.1, greenballs 1.14, groovy 1.29, groovy-postbuild 1.10, handlebars 1.1.1, hipchat 0.2.0, htmlpublisher 1.5, hudson-wsclean-plugin 1.0.4, hue-light 1.2.0, instant-messaging 1.29, ios-device-connector 1.2, iphoneview 0.2, ircbot 2.25, ivy 1.26, ivytrigger 0.32, jabber 1.25, jackson2-api 2.5.4, jacoco 1.0.16, javadoc 1.1, jenkins-jira-issue-updater 1.7, jenkins-multijob-plugin 1.20, jira 2.2.1, job-dsl 1.48, job-import-plugin 1.2, job-restrictions 0.5, jobConfigHistory 2.14, join 1.15, jquery 1.11.2-0, jquery-detached 1.2.1, jquery-ui 1.0.2, junit 1.18, ldap 1.10.2, locale 1.2, locks-and-latches 0.6, log-parser 1.0.8, logstash 0.8.0, mailer 1.16, managed-scripts 1.2.1, mapdb-api 1.0.1.0, matrix-auth 1.2, matrix-project 1.6, maven-info 0.2.0, maven-plugin 2.9, mercurial 1.50, metrics 3.1.2, momentjs 1.1.1, monitoring 1.56.0, msbuild 1.23, multi-slave-config-plugin 1.2.0, multiple-scms 0.3, node-iterator-api 1.5, nodejs 0.2.1, nodelabelparameter 1.5.1, notification 1.10, ownership 0.9.0, pam-auth 1.1, parameterized-trigger 2.25, percentage-du-node-column 0.1.0, periodicbackup 1.3, pipeline-build-step 2.4, pipeline-graph-analysis 1.3, pipeline-input-step 2.5, pipeline-milestone-step 1.3, pipeline-rest-api 2.4, pipeline-stage-step 2.2, pipeline-stage-view 2.4, plain-credentials 1.1, plot 1.9, pmd 3.38, port-allocator 1.8, postbuildscript 0.17, preSCMbuildstep 0.3, promoted-builds 2.28, publish-over-ssh 1.11, rebuild 1.22, run-condition 1.0, scm-api 1.3, script-security 1.25, scriptler 2.7, secret 1.7, secure-requester-whitelist 1.0, shiningpanda 0.22, simple-theme-plugin 0.3, sonar 2.1, splunk-devops 1.4.2, ssh-agent 1.7, ssh-credentials 1.12, ssh-slaves 1.9, structs 1.5, subversion 2.4.5, svnpublisher 0.1, testng-plugin 1.14, text-finder 1.10, throttle-concurrents 1.8.3, timestamper 1.8.7, token-macro 1.12.1, translation 1.11, unity3d-plugin 0.6, uno-choice 1.2, urltrigger 0.38, versionnumber 1.6, view-job-filters 1.27, viewVC 1.7, violations 0.7.11, warnings 4.56, whitesource 1.7.2, windows-slaves 1.0, workflow-aggregator 2.4, workflow-api 2.8, workflow-basic-steps 2.3, workflow-cps 2.24, workflow-cps-global-lib 2.5, workflow-durable-task-step 2.8, workflow-job 2.9, workflow-multibranch 2.9.2, workflow-scm-step 2.2, workflow-step-api 2.7, workflow-support 2.12, ws-cleanup 0.26, xcode-plugin 1.4.2, xunit 1.89, xvfb 1.1.3, xvnc 1.17".
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi]/before: subscribes to Archive[build-failure-analyzer.hpi]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.disabled]/before: subscribes to Archive[build-failure-analyzer.hpi]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.pinned]/before: subscribes to Archive[build-failure-analyzer.hpi]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]/require: subscribes to Archive[build-failure-analyzer.hpi]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]/notify: subscribes to Service[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]/require: subscribes to Archive[build-failure-analyzer.hpi]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]/notify: subscribes to Service[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/Archive[build-failure-analyzer.hpi]/require: subscribes to File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/Archive[build-failure-analyzer.hpi]/notify: subscribes to Service[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]/before: subscribes to Service[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.disabled]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.pinned]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]: Adding autorequire relationship with User[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]: Adding autorequire relationship with Group[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]: Adding autorequire relationship with User[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]: Adding autorequire relationship with Group[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]: Adding autorequire relationship with File[/var/lib/jenkins/plugins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]: Adding autorequire relationship with User[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]: Adding autorequire relationship with Group[jenkins]
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.disabled]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.jpi.pinned]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.disabled]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi.pinned]: Nothing to manage: no ensure and the resource doesn't exist

So, basically If I remove that particular file then it gets downloaded accordingly:

1) Running puppet

root@jenkins-bcnsharedstudio:/tmp# puppet agent -t --environment jenkins_module_plugins
Info: Using configured environment 'jenkins_module_plugins'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for jenkins-bcnsharedstudio
Info: Applying configuration version '1487594071'
Notice: /Stage[main]/Profile::Defaults::Os::Linux/Package[rubygems]/ensure: created
Notice: Applied catalog in 4.46 seconds

2) Current plugin version

root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# cat  build-failure-analyzer/META-INF/MANIFEST.MF  | grep -i plugin-version
Plugin-Version: 1.13.0
root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# ls -l build-failure-analyzer*
-rw-r--r-- 1 jenkins jenkins 3276364 Apr 19  2016 build-failure-analyzer.hpi

build-failure-analyzer:
total 20
drwxr-xr-x 2 jenkins jenkins 4096 Feb  8 08:15 help
drwxr-xr-x 7 jenkins jenkins 4096 Feb  8 08:15 images
drwxr-xr-x 2 jenkins jenkins 4096 Apr 10  2015 js
drwxr-xr-x 3 jenkins jenkins 4096 Apr 10  2015 META-INF
drwxr-xr-x 3 jenkins jenkins 4096 Apr 10  2015 WEB-INF

3) Removing files manually

root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# rm -rf  build-failure-analyzer*
root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# ls -l build-failure-analyzer*
ls: cannot access build-failure-analyzer*: No such file or directory

4) Running puppet again

root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# puppet agent -t --environment jenkins_module_plugins
Info: Using configured environment 'jenkins_module_plugins'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for jenkins-bcnsharedstudio
Info: Applying configuration version '1487594485'
Notice: /Stage[main]/Profile::Defaults::Os::Linux/Package[rubygems]/ensure: created
Notice: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/Archive[build-failure-analyzer.hpi]/ensure: download archive from https://updates.jenkins-ci.org/download/plugins/build-failure-analyzer/1.17.2/build-failure-analyzer.hpi to /var/lib/jenkins/plugins/build-failure-analyzer.hpi  without cleanup
Info: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/Archive[build-failure-analyzer.hpi]: Scheduling refresh of Service[jenkins]
Notice: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]/owner: owner changed 'root' to 'jenkins'
Notice: /Stage[main]/King_jenkins::Plugin_baseline/Jenkins::Plugin[build-failure-analyzer]/File[/var/lib/jenkins/plugins/build-failure-analyzer.hpi]/group: group changed 'root' to 'jenkins'
Notice: /Stage[main]/Jenkins::Service/Service[jenkins]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]/returns: executed successfully
Info: /Stage[main]/Jenkins/Jenkins::Cli::Exec[set_num_executors]/Exec[set_num_executors]: Scheduling refresh of Class[Jenkins::Cli::Reload]
Info: Class[Jenkins::Cli::Reload]: Scheduling refresh of Exec[reload-jenkins]
Notice: /Stage[main]/Jenkins::Cli::Reload/Exec[reload-jenkins]: Triggered 'refresh' from 1 events
Notice: Applied catalog in 39.34 seconds

5) Current plugin version

root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# ls -l build-failure-analyzer*
-rw-r--r-- 1 jenkins jenkins 3452956 Oct 25 17:01 build-failure-analyzer.hpi

build-failure-analyzer:
total 16
drwxr-xr-x 3 jenkins jenkins 4096 Feb 20 04:51 help
drwxr-xr-x 7 jenkins jenkins 4096 Feb 20 04:51 images
drwxr-xr-x 3 jenkins jenkins 4096 Oct 21 11:54 META-INF
drwxr-xr-x 3 jenkins jenkins 4096 Oct 21 11:54 WEB-INF
root@jenkins-bcnsharedstudio:/var/lib/jenkins/plugins# cat  build-failure-analyzer/META-INF/MANIFEST.MF  | grep -i plugin-version
Plugin-Version: 1.17.2

I was guessing maybe the archive resource was somehow caching that file, but the creates flag is not enabled:

Any ideas?

Cheers

uwehdaub commented 7 years ago

Sorry, No ideas. But I have the same problem on

robinbowes commented 7 years ago

I'm seeing the same problem with commit 23df7764d58aed80b573621b102f82a702217a7a

Magisus commented 6 years ago

I think I am also seeing this, same commit as @robinbowes. I am also able to make this work by manually deleting the plugin and running puppet again.