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

String index out of range in MultiSCMRevisionState.keyFor

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: multiple-scms-plugin
    • Labels:
      None
    • Environment:
      Jenkins >= 1.649, multiple-scm plugin >= 0.4, git plugin >= 2.4.0, mercurial plugin 1.54
    • Similar Issues:

      Description

      I have a job that polls a bunch of git and mercurial repos and indexes them for code cross referencing site. Ever since upgrading Jenkins to 1.650 for a security issue, it's been failing with the below error. I've tried juggling various versions of the plugins around; I am unwilling to roll back the Jenkins version for security concerns.

      It's not repo specific. For example, if the list is repo1, repo2, and repo3 and it bombs on repo2 I can remove repo2 and it'll now bomb on repo1, which didn't have an issue on the first try. It's also not mercurial specific, as it'll do the same on a git repo.

      a mercurial example:
      13:49:45 pulling from https://hg.mozilla.org/build/buildbot
      13:49:45 no changes found
      13:49:45 [buildbot] $ hg update --clean --rev default
      13:49:45 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
      13:49:45 [buildbot] $ hg log --rev . --template

      {node}

      13:49:45 [buildbot] $ hg log --rev . --template

      {rev}

      13:49:45 FATAL: String index out of range: -1
      13:49:45 java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      13:49:45 at java.lang.String.substring(String.java:1931)
      13:49:45 at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.keyFor(MultiSCMRevisionState.java:41)
      13:49:45 at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.get(MultiSCMRevisionState.java:30)
      13:49:45 at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:141)
      13:49:45 at hudson.scm.SCM.checkout(SCM.java:485)
      13:49:45 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
      13:49:45 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
      13:49:45 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      13:49:45 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
      13:49:45 at hudson.model.Run.execute(Run.java:1738)
      13:49:45 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      13:49:45 at hudson.model.ResourceController.execute(ResourceController.java:98)
      13:49:45 at hudson.model.Executor.run(Executor.java:410)

      and for a git repo:
      14:56:25 Cloning repository https://github.com/mozilla/build-cloud-tools
      14:56:25 > git init /data/dxr_data/build/cloud-tools # timeout=10
      14:56:25 Fetching upstream changes from https://github.com/mozilla/build-cloud-tools
      14:56:25 > git --version # timeout=10
      14:56:25 > git -c core.askpass=true fetch --tags --progress https://github.com/mozilla/build-cloud-tools +refs/heads/:refs/remotes/origin/
      14:56:27 > git config remote.origin.url https://github.com/mozilla/build-cloud-tools # timeout=10
      14:56:27 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
      14:56:27 > git config remote.origin.url https://github.com/mozilla/build-cloud-tools # timeout=10
      14:56:27 Fetching upstream changes from https://github.com/mozilla/build-cloud-tools
      14:56:27 > git -c core.askpass=true fetch --tags --progress https://github.com/mozilla/build-cloud-tools +refs/heads/:refs/remotes/origin/
      14:56:27 Seen branch in repository origin/ami-udaprews050916
      14:56:27 Seen branch in repository origin/ami-update
      14:56:27 Seen branch in repository origin/bz1267913
      14:56:27 Seen branch in repository origin/master
      14:56:27 Seen 4 remote branches
      14:56:27 Checking out Revision f608764128705acea53ff8c6a42482f09038c6b2 (origin/master)
      14:56:27 > git config core.sparsecheckout # timeout=10
      14:56:27 > git checkout -f f608764128705acea53ff8c6a42482f09038c6b2
      14:56:28 > git rev-list ce85bd66ca6fb1c7eae4ddbca4a3a9d0305a60d2 # timeout=10
      14:56:28 FATAL: String index out of range: -1
      14:56:28 java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      14:56:28 at java.lang.String.substring(String.java:1931)
      14:56:28 at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.keyFor(MultiSCMRevisionState.java:41)
      14:56:28 at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.get(MultiSCMRevisionState.java:30)
      14:56:28 at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:141)
      14:56:28 at hudson.scm.SCM.checkout(SCM.java:485)
      14:56:28 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
      14:56:28 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
      14:56:28 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      14:56:28 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
      14:56:28 at hudson.model.Run.execute(Run.java:1738)
      14:56:28 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      14:56:28 at hudson.model.ResourceController.execute(ResourceController.java:98)
      14:56:28 at hudson.model.Executor.run(Executor.java:410)

        Attachments

          Activity

          Hide
          rodrigc Craig Rodrigues added a comment -

          Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms
          https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

          Show
          rodrigc Craig Rodrigues added a comment - Suggest that you migrate to Pipeline plugin, which offers a supported way of checking out from multiple scms https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

            People

            • Assignee:
              kbell Kevin Bell
              Reporter:
              fubar Kendall Libby
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: