[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Nick Jones commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Simple repro: pipeline { agent none options { skipDefaultCheckout(true) } stages { stage('Prepare') { steps { echo 'Preparing...' } } } post { always { cleanWs deleteDirs: true } } } This was deliberately designed without a pipeline-level agent – it is the skeleton of an implementation I'm working on that will have stage-level agents instead – and the cleanWs failed. It seems this should be more defensively coded so that cleanWs can cleanly exit (at most with a warning) if there simply isn't a workspace to be cleaned. I'll probably end up putting cleanWs in the post blocks for stages that do use agents (which would be a better place for that command anyway), but again, I'd still expect the above to be a no-op (with possibly a warning) rather than throwing an uncaught exception. Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Oliver Gondža commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Thanks for the report. The hypothesis of "failing in case the workspace have not been allocated yet as the build has failed before it did" sounds quite plausible. Are the any cases that cannot be explained by this? Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.6418.1576154820578%40Atlassian.JIRA.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Nick Jones commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Aha – in my case the answer was that an error was being thrown by the build before it got into the pipeline stages, specifically by a credentials('SOME_ID') command being used in a root-level environment block, for a credential ID that didn't exist. This failed the build immediately, but because cleanWS() was in an always block, it tried to execute it, and the agent node hadn't actually been (fully?) allocated yet, hence this error. The error obscured the true root cause, and arguably cleanWs() could have been more tolerant of these conditions rather than throwing, but at least I have an explanation now. Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.4482.1576008960496%40Atlassian.JIRA.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Nick Jones commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Same issue here, under Jenkins 2.190.3 LTS and Workspace Cleanup 0.37, on a Windows Server agent. These are the first builds of a multibranch pipeline on this particular Jenkins instance, filtered to build only a specific PR, and that same PR (thus with the same Jenkinsfile) has been building successfully on a separate Jenkins instance running all the same versions of plugins, etc. A workspace is actually being allocated on the expected node, but cleanWS() still throws this no matter how many times I restart the job. Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.4469.1576008240500%40Atlassian.JIRA.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Pat O'Shea edited a comment on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Same issue here:Jenkins version - 2.164.3Workspace cleanup plugin - 0.37 Windows agent/slave Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.24536.1560177780421%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Pat O'Shea commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Same issue here: Jenkins version - 2.164.3 Workspace cleanup plugin - 0.37 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.24520.1560176340596%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Elad Kollender commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Having the same issue. Jenkins version - 2.164.3 Workspace cleanup plugin - 0.37 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.194924.1540578037000.9130.1558539060323%40Atlassian.JIRA. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Matt Dee commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Having the exact same problem, seems completely random when it happens. Cannot reliably reproduce. Very annoying. Jenkins ver. 2.150.3 ws-cleanup 0.37 Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Timothy Harris commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage I am also experiencing this problem. With the same symptoms. User starts build. Pipeline executes. cleanWs() is the last step in a post–>always block failure with workspace cannot be delete Replay the last stage and the deletion works Got the failure with ws-cleanup-plugin version 0.36 installed. Downgraded to 0.35 and still got the failure. Info about system Jenkins 2.138.2 ws-cleanup-plugin - 0.35 and 0.36 Agent is a windows machine Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Lewis Russell commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Had a very similar issue. Restarting my slaves fixed it for me. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Michael Forstner commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Upgraded all plugins in my latest LTS Jenkins instance (2.138.2) and now my issue disappeared, so most likely it was not caused by the cleanWs() plugin. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Will Freeman commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage If I upgrade to 0.36, yes, similar situation although I can occasionally get this to fire by running a build not triggered by SCM changes as well.. Keeping it at 0.35 I cannot reproduce. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Michael Forstner commented on JENKINS-54278 Re: Pipeline builds fail when cleanWs() in post stage Is your issue reproducible? I have a similar one - the Build fails with the same error message above if the Pipeline was triggered by Jenkins (cron, SCM push, etc.). But if the Build is started by an user or the failed build is replayed (with unchanged pipeline) the build succeeds. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-54278) Pipeline builds fail when cleanWs() in post stage
Title: Message Title Will Freeman created an issue Jenkins / JENKINS-54278 Pipeline builds fail when cleanWs() in post stage Issue Type: Bug Assignee: Oliver Gondža Components: ws-cleanup-plugin Created: 2018-10-26 18:20 Environment: Plugin version 0.36 Priority: Blocker Reporter: Will Freeman Pipeline builds fail when cleanWs() in post stage. Reverting to 0.35 works. Error reported: Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node Error when executing cleanup post condition: java.lang.IllegalArgumentException: Failed to prepare cleanWs step at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:401) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:181) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.jav