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

JGit ArithmeticException: long overflow on exotic file systems

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Critical Critical
    • git-plugin
    • None
    • Controller/Agent Jenkins 2.255
      NonStop TNS/E and TNS/X platforms
    • git client plugin 3.6.0 that includes JGit 5.10.0

      When a Pipeline job is defined with a repository-based Jenkinsfile, the second time the job runs, the following exception is thrown, failing the job. This is the complete job output.

      ```

      Started by an SCM change
      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:491)
      at org.eclipse.jgit.internal.storage.file.FileSnapshot.isRacyClean(FileSnapshot.java:476)
      at org.eclipse.jgit.internal.storage.file.FileSnapshot.isModified(FileSnapshot.java:520)
      at org.eclipse.jgit.internal.storage.file.FileSnapshot.isModified(FileSnapshot.java:325)
      at org.eclipse.jgit.internal.storage.file.ObjectDirectory.searchPacksAgain(ObjectDirectory.java:741)
      at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedObject(ObjectDirectory.java:469)
      at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedFromSelfOrAlternate(ObjectDirectory.java:413)
      at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:404)
      at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:132)
      at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:203)
      at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:917)
      at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:827)
      at jenkins.plugins.git.GitSCMFile.lambda$content$2(GitSCMFile.java:160)
      at jenkins.plugins.git.GitSCMFile$$Lambda$320/549732770.invoke(Unknown Source)
      at jenkins.plugins.git.GitSCMFileSystem.lambda$invoke$e8567d7e$1(GitSCMFileSystem.java:182)
      at jenkins.plugins.git.GitSCMFileSystem$$Lambda$319/1938149657.invoke(Unknown Source)
      at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:84)
      at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:182)
      at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:158)
      at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:335)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:69)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:428)
      Finished: FAILURE

      ```

      The workaround is to manually delete the `git-*` entry in `.jenkins/caches`, which allows the job to run only once before a recurrence of this issue. This looks like a similar issue to JENKINS-62710.

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

              Created:
              Updated:
              Resolved: