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

JGit ArithmeticException: long overflow on exotic file systems

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Controller/Agent Jenkins 2.255
      NonStop TNS/E and TNS/X platforms
    • Similar Issues:
    • Released As:
      git client plugin 3.6.0 that includes JGit 5.10.0

      Description

      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.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          If others encounter the problem, they will benefit from knowing the version of git client plugin that you're using.

          Show
          markewaite Mark Waite added a comment - If others encounter the problem, they will benefit from knowing the version of git client plugin that you're using.
          Hide
          rsbeckerca Randall Becker added a comment -

          My bad. Git Client is 3.5.1, Git Plugin is 4.4.4, and we're on Git 2.28.0 on the exotic platform - I like that term, btw.

          Show
          rsbeckerca Randall Becker added a comment - My bad. Git Client is 3.5.1, Git Plugin is 4.4.4, and we're on Git 2.28.0 on the exotic platform - I like that term, btw.
          Hide
          markewaite Mark Waite added a comment -
          Show
          markewaite Mark Waite added a comment - See git client plugin 3.5.0 release notes (included JGit 5.9.0) and git client plugin 3.6.0 release notes .

            People

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

              Dates

              Created:
              Updated:
              Resolved: