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

java.lang.ArithmeticException: long overflow after git checkout

    Details

    • Similar Issues:
    • Released As:
      Git plugin 4.3.0 - June 19, 2020

      Description

      Pipelines are now failing after a trivial checkout after installing Jenkins 2.240. This is occurring after the first step of our pipelines, starting with:

      node {
        stage('checkout') {
          checkout([$class: 'GitSCM',
                    branches: [[name: '*/ituglib_release']],
                    extensions: [
                                 [$class: 'CleanBeforeCheckout']],
                    userRemoteConfigs: [[url: '/home/git/zlib']]])
         }
         stage('config') { ...
      ...
      
      java.lang.ArithmeticException: long overflow
       at java.lang.Math.multiplyExact(Math.java:1052)
       at java.time.Duration.toNanos(Duration.java:1186)
       at org.eclipse.jgit.internal.storage.file.FileSnapshot.getEffectiveRacyThreshold(FileSnapshot.java:524)
       at org.eclipse.jgit.internal.storage.file.FileSnapshot.isRacyClean(FileSnapshot.java:509)
       at org.eclipse.jgit.internal.storage.file.FileSnapshot.isModified(FileSnapshot.java:553)
       at org.eclipse.jgit.internal.storage.file.FileSnapshot.isModified(FileSnapshot.java:358)
       at org.eclipse.jgit.internal.storage.file.ObjectDirectory.searchPacksAgain(ObjectDirectory.java:775)
       at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedObject(ObjectDirectory.java:502)
       at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedFromSelfOrAlternate(ObjectDirectory.java:446)
       at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:437)
       at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:165)
       at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:236)
       at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:941)
       at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:851)
       at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
       at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
       at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:81)
       at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1252)
       at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1225)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$$Lambda$280/2135930507.run(Unknown Source)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          I've uploaded a proposal as git.jpi that hides the ArithmeticException. I'd love to have you test it, since I'm expecting to release a new version of the git plugin within the next few days and would prefer to have more hands helping verify the pre-release build.

          Show
          markewaite Mark Waite added a comment - - edited I've uploaded a proposal as git.jpi that hides the ArithmeticException. I'd love to have you test it, since I'm expecting to release a new version of the git plugin within the next few days and would prefer to have more hands helping verify the pre-release build.
          Hide
          rsbeckerca Randall Becker added a comment -

          I could install it if you can supply a GitSCM.hpi as long as I can undo that. This is happening on a non-development box and I don't have one that I can use to build a pre-release myself, at least not that would represent exactly what you would be shipping. I could test as early as tomorrow. Would this be possible?

          Show
          rsbeckerca Randall Becker added a comment - I could install it if you can supply a GitSCM.hpi as long as I can undo that. This is happening on a non-development box and I don't have one that I can use to build a pre-release myself, at least not that would represent exactly what you would be shipping. I could test as early as tomorrow. Would this be possible?
          Hide
          markewaite Mark Waite added a comment -

          The git.jpi that I provided is a pre-release build of the plugin. If you prefer the hpi suffix, you can rename the file after you download it. If you use the Jenkins plugin manager to upload the jpi file (or renamed to hpi file), the plugin manager will create a backup of the installed plugin version before it inserts the new plugin version into the plugins directory. After the upload, restart the Jenkins process and it will use the new plugin build.

          When you want to revert to the previous version (git plugin 4.2.2), open the plugin manager "Installed" page, navigate to the git plugin, and press the "Downgrade to 4.2.2" button on that row.

          Show
          markewaite Mark Waite added a comment - The git.jpi that I provided is a pre-release build of the plugin. If you prefer the hpi suffix, you can rename the file after you download it. If you use the Jenkins plugin manager to upload the jpi file (or renamed to hpi file), the plugin manager will create a backup of the installed plugin version before it inserts the new plugin version into the plugins directory. After the upload, restart the Jenkins process and it will use the new plugin build. When you want to revert to the previous version (git plugin 4.2.2), open the plugin manager "Installed" page, navigate to the git plugin, and press the "Downgrade to 4.2.2" button on that row.
          Hide
          rsbeckerca Randall Becker added a comment -

          Looks good. I ran the three tests that caused issues previously. We're going to keep it until there is a replacement. Thank you for your quick response.

          Show
          rsbeckerca Randall Becker added a comment - Looks good. I ran the three tests that caused issues previously. We're going to keep it until there is a replacement. Thank you for your quick response.
          Hide
          rsbeckerca Randall Becker added a comment - - edited

          The situation has popped up in other parts of Jenkins operations with regards to JGit use. I have reported it to the JGit team as [565707|https://bugs.eclipse.org/bugs/show_bug.cgi?id=565707].

          The exception looks like this:

          java.lang.ArithmeticException: long overflow
          {{ at java.lang.Math.multiplyExact(Math.java:1052)}}
          {{ at java.time.Duration.toNanos(Duration.java:1186)}}
          {{ at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$1(FS.java:363)}}
          {{ at org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$245/120256761.get(Unknown Source)}}
          {{ at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1582)}}
          Caused: java.util.concurrent.CompletionException
          {{ at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)}}
          {{ at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)}}
          {{ at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1584)}}
          {{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)}}
          {{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)}}
          {{ at java.lang.Thread.run(Thread.java:745)}}

          Show
          rsbeckerca Randall Becker added a comment - - edited The situation has popped up in other parts of Jenkins operations with regards to JGit use. I have reported it to the JGit team as [565707| https://bugs.eclipse.org/bugs/show_bug.cgi?id=565707 ]. The exception looks like this: java.lang.ArithmeticException: long overflow {{ at java.lang.Math.multiplyExact(Math.java:1052)}} {{ at java.time.Duration.toNanos(Duration.java:1186)}} {{ at org.eclipse.jgit.util.FS$FileStoreAttributes.lambda$1(FS.java:363)}} {{ at org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$245/120256761.get(Unknown Source)}} {{ at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1582)}} Caused: java.util.concurrent.CompletionException {{ at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)}} {{ at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)}} {{ at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1584)}} {{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)}} {{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)}} {{ at java.lang.Thread.run(Thread.java:745)}}

            People

            • Assignee:
              Unassigned
              Reporter:
              rsbeckerca Randall Becker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: