Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30525

P4 plugin doesn't detect failure and can then cause other plugins to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None

      Sore error conditions are not detected and then puts the job in a certain state that causes other plugins that don't have good error checking to fail.
      (This is related to JENKINS-30466)

      e.g.
      P4 Task: syncing files at change: 142720
      ... p4 sync c:\jenkins\workspace__atf_int_mlb_0/...@142720
      +
      duration: (519ms)

      P4 Task: unshelve review: 142711
      ... p4 unshelve -f -s142711 -cdefault
      +
      ... p4 revert -k c:\jenkins\workspace__atf_int_mlb_0/...
      +
      ... duration: (35ms)
      P4 Task: saving built changes.
      ... p4 client -o __atf_int_mlb_0_jenkins_p4_2_mlb-TEST-gb-mlb-dt-018 +
      ... p4 change -o 142711 +
      Unable to get changes: com.perforce.p4java.exception.RequestException: Change 142711 unknown.

      ... p4 client -o __atf_int_mlb_0_jenkins_p4_2_mlb-TEST-gb-mlb-dt-018 +
      ... p4 change -o 142711 +
      Unable to get changes: com.perforce.p4java.exception.RequestException: Change 142711 unknown.

      ... done

      Maybe the user has deleted the shelved changes or even deleted the cl, or if the shelved cl is on a stream where it can't be handled.

      Anyway, the plugin is not in a bad state, it doesn't inform the job so the normal builds steps go.

      When the plugin is in this state the job fails at the end with the following:
      FATAL: null
      java.lang.NullPointerException
      Collecting metadata...
      Metadata collection done.
      Finished: FAILURE

      The Jenkins log show the following:
      Sep 16, 2015 9:43:32 AM org.apache.commons.jelly.expression.jexl.JexlExpression evaluate
      WARNING: Caught exception evaluating: cs.affectedFiles. Reason: java.lang.reflect.InvocationTargetException
      java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor688.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
      at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
      at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
      at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
      at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
      at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
      at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
      at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
      at org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:69)
      at org.apache.commons.jelly.expression.jexl.JexlExpressionFactory$ExpressionSupportLocal.evaluate(JexlExpressionFactory.java:122)
      at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
      at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsIterator(ExpressionSupport.java:94)
      at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:89)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65)
      at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:124)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65)
      at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:124)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      at hudson.plugins.emailext.plugins.content.JellyScriptContent.convert(JellyScriptContent.java:158)
      at hudson.plugins.emailext.plugins.content.JellyScriptContent.renderContent(JellyScriptContent.java:149)
      at hudson.plugins.emailext.plugins.content.JellyScriptContent.evaluate(JellyScriptContent.java:58)
      at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:189)
      at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:182)
      at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:233)
      at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:72)
      at hudson.plugins.emailext.ExtendedEmailPublisher.getContent(ExtendedEmailPublisher.java:659)
      at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:538)
      at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:306)
      at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:297)
      at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:244)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
      at org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:183)
      at org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:116)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
      at hudson.model.Run.execute(Run.java:1783)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Caused by: java.lang.UnsupportedOperationException: getAffectedFiles() is not implemented by this SCM
      at hudson.scm.ChangeLogSet$Entry.getAffectedFiles(ChangeLogSet.java:242)
      ... 59 more

      I think the email plugin is trying to get the list of users and this is null (and it doesn't do very good checking?)

      The Jenkins summary page shows:
      Summary Of Changes - View Detail
      No connection to Perforce.

            p4paul Paul Allen
            mornejoubert Morne Joubert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: