java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Jenkins JIRA | Kendall Libby | 7 months ago
  1. 0

    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)

    Jenkins JIRA | 7 months ago | Kendall Libby
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  2. 0

    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)

    Jenkins JIRA | 7 months ago | Kendall Libby
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  3. 0

    [JIRA] [multiple-scms-plugin] (JENKINS-34766) String index out of range in MultiSCMRevisionState.keyFor

    Google Groups | 7 months ago | fubar+...@mozilla.com (JIRA)
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The exception was thrown when an amount of files had been pulled. The version of Multiple SCMs plugin is 0.3 ..... Getting AssemblyInfo.cs Getting Resources.Designer.cs Getting Resources.resx Getting Settings.Designer.cs Getting Settings.settings [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" history $/Shared/Source -recursive -stopafter:1 -noprompt -version:D2014-02-13T01:27:49Z -format:brief ******** -server:XXXXXXX Changeset User Date Comment --------- ----------------- ---------- ---------------------------------------- XXX XXX XXX XXXX FATAL: String index out of range: -14 java.lang.StringIndexOutOfBoundsException: String index out of range: -14 at java.lang.String.substring(Unknown Source) at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.keyFor(MultiSCMRevisionState.java:35) at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.add(MultiSCMRevisionState.java:21) at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:124) at hudson.model.AbstractProject.checkout(AbstractProject.java:1411) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:560) at hudson.model.Run.execute(Run.java:1670) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)

    Jenkins JIRA | 3 years ago | Wei Zhang
    java.lang.StringIndexOutOfBoundsException: String index out of range: -14
  6. 0

    The exception was thrown when an amount of files had been pulled. The version of Multiple SCMs plugin is 0.3 ..... Getting AssemblyInfo.cs Getting Resources.Designer.cs Getting Resources.resx Getting Settings.Designer.cs Getting Settings.settings [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" history $/Shared/Source -recursive -stopafter:1 -noprompt -version:D2014-02-13T01:27:49Z -format:brief ******** -server:XXXXXXX Changeset User Date Comment --------- ----------------- ---------- ---------------------------------------- XXX XXX XXX XXXX FATAL: String index out of range: -14 java.lang.StringIndexOutOfBoundsException: String index out of range: -14 at java.lang.String.substring(Unknown Source) at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.keyFor(MultiSCMRevisionState.java:35) at org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.add(MultiSCMRevisionState.java:21) at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:124) at hudson.model.AbstractProject.checkout(AbstractProject.java:1411) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:560) at hudson.model.Run.execute(Run.java:1670) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)

    Jenkins JIRA | 3 years ago | Wei Zhang
    java.lang.StringIndexOutOfBoundsException: String index out of range: -14

  1. richard77 2 times, last 2 days ago
  2. kjhdofjosvs 2 times, last 6 days ago
  3. archenroot 17 times, last 2 weeks ago
  4. Alexandru Popa 2 times, last 3 weeks ago
  5. poroszd 3 times, last 1 month ago
18 more registered users
58 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    String index out of range: -1

    at java.lang.String.substring()
  2. Java RT
    String.substring
    1. java.lang.String.substring(String.java:1931)
    1 frame
  3. org.jenkinsci.plugins
    MultiSCM.checkout
    1. org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.keyFor(MultiSCMRevisionState.java:41)
    2. org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState.get(MultiSCMRevisionState.java:30)
    3. org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:141)
    3 frames
  4. Hudson
    AbstractBuild$AbstractBuildExecution.defaultCheckout
    1. hudson.scm.SCM.checkout(SCM.java:485)
    2. hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
    3. hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    3 frames
  5. jenkins.scm
    SCMCheckoutStrategy.checkout
    1. jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    1 frame
  6. Hudson
    Executor.run
    1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    2. hudson.model.Run.execute(Run.java:1738)
    3. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    4. hudson.model.ResourceController.execute(ResourceController.java:98)
    5. hudson.model.Executor.run(Executor.java:410)
    5 frames