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

Exception thrown when trying to extract date from current build change set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • git-plugin
    • None

      Version 1.6.3 .
      Using Force polling using workspace

      Date parsing fails when trying to access date field in groovy:

      Code used:

      def thr = Thread.currentThread();
      def currentBuild = thr?.executable;
      def changes = currentBuild.getChangeSet();
      changes.getItems().each {
      	ChangeLogSet.Entry lastChange = (ChangeLogSet.Entry)it;
          lastChange.getTimestamp();
      }
      

      Exception:

      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NumberFormatException: For input string: "1970-01-17T05:02:10+0200 +0200"
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      	at java.lang.Long.parseLong(Long.java:441)
      	at java.lang.Long.parseLong(Long.java:483)
      	at hudson.plugins.git.GitChangeSet.getTimestamp(GitChangeSet.java:194)
      	at hudson.plugins.git.GitChangeSet$getTimestamp.call(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
      	at Script1$_run_closure1.doCall(Script1.groovy:23)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
      	at groovy.lang.Closure.call(Closure.java:415)
      	at groovy.lang.Closure.call(Closure.java:428)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
      	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1351)
      	at org.codehaus.groovy.runtime.dgm$170.invoke(Unknown Source)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      	at Script1.run(Script1.groovy:20)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:650)
      	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:636)
      	at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:82)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:899)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:666)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:565)
      	at hudson.model.Run.execute(Run.java:1670)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      

            ndeloof Nicolas De Loof
            mooshben Moosh Ben
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: