Jump to content
Olaf Kober

TeamCity: StringIndexOutOfBoundsException when using newest version of Plastic and TeamCity

Recommended Posts

Hi!

 

I tried to upgrade our build infrastructure to the newest versions of TeamCity (9.1.3), Plastic SCM (5.4.16.692) and Plastic SCM plugin for Teamcity (SNAPSHOT-201504131654 which was the latest version I found on the download page today). After upgrading the first builds run fine, but then when I commited a change the next time TeamCity determines the change differences I got following error:

Error collecting changes for VCS repository '"DarwinVCS" {instance id=2, parent internal id=1, parent id=Darwin_DarwinVCS, description: "repository "Darwin.Backbone@localhost:8087"
path "/"
branch "/main"
checkout "/main""}'
jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33

with stack trace:

jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.buildTriggers.vcs.ConnectionStateReporterImpl.reportConnectionFailed(ConnectionStateReporterImpl.java:12)
at jetbrains.buildServer.buildTriggers.vcs.ConnectionStateReporterImpl.reportConnectionFailed(ConnectionStateReporterImpl.java:0)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader$RunLoadChanges.run(VcsRootChangesLoader.java:68)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader.loadChanges(VcsRootChangesLoader.java:20)
at jetbrains.buildServer.vcs.impl.VcsChangesFetcher$LoadChangesForRoot.run(VcsChangesFetcher.java:8)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl$ImmediateFutureExecService$1.call(VcsChangesLoaderImpl.java)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:59)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:68)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.waitForTaskToComplete(PeriodicChangesLoader.java:13)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.loadChanges(PeriodicChangesLoader.java:11)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl.tryLoadChanges(VcsChangesLoaderImpl.java:24)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction$1.run(VcsModificationChecker.java:0)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction.run(VcsModificationChecker.java:2)
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)
Caused by: jetbrains.buildServer.vcs.VcsException: jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:23)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesForCheckoutRules(LoadChanges.java:49)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesByCombinedRule(LoadChanges.java:11)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChanges(LoadChanges.java:34)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader$RunLoadChanges.run(VcsRootChangesLoader.java:39)
... 17 more
Caused by: jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:29)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:26)
... 21 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at java.lang.String.substring(String.java:1931)
at com.codicesoftware.plugins.teamcity.PlasticVcsSupport$1.collectChanges(PlasticVcsSupport.java:284)
at jetbrains.buildServer.vcs.utils.VcsPluginUtil.collectBuildChanges(VcsPluginUtil.java:63)
at jetbrains.vcs.api.services.collectChanges.CollectRepositoryChangesPolicyFactory$8.collectChanges(CollectRepositoryChangesPolicyFactory.java:2)
at jetbrains.vcs.api.services.collectChanges.SingleVersionCollectChangesCommand.collectChanges(SingleVersionCollectChangesCommand.java:1)
at jetbrains.vcs.api.services.collectChanges.CollectChangesServiceProvider$1.collectChanges(CollectChangesServiceProvider.java:4)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:12)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:8)
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:27)
... 22 more
jetbrains.buildServer.vcs.VcsException: jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:23)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesForCheckoutRules(LoadChanges.java:49)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesByCombinedRule(LoadChanges.java:11)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChanges(LoadChanges.java:34)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader$RunLoadChanges.run(VcsRootChangesLoader.java:39)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader.loadChanges(VcsRootChangesLoader.java:20)
at jetbrains.buildServer.vcs.impl.VcsChangesFetcher$LoadChangesForRoot.run(VcsChangesFetcher.java:8)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl$ImmediateFutureExecService$1.call(VcsChangesLoaderImpl.java)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:59)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:68)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.waitForTaskToComplete(PeriodicChangesLoader.java:13)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.loadChanges(PeriodicChangesLoader.java:11)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl.tryLoadChanges(VcsChangesLoaderImpl.java:24)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction$1.run(VcsModificationChecker.java:0)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction.run(VcsModificationChecker.java:2)
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)
Caused by: jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:29)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:26)
... 21 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at java.lang.String.substring(String.java:1931)
at com.codicesoftware.plugins.teamcity.PlasticVcsSupport$1.collectChanges(PlasticVcsSupport.java:284)
at jetbrains.buildServer.vcs.utils.VcsPluginUtil.collectBuildChanges(VcsPluginUtil.java:63)
at jetbrains.vcs.api.services.collectChanges.CollectRepositoryChangesPolicyFactory$8.collectChanges(CollectRepositoryChangesPolicyFactory.java:2)
at jetbrains.vcs.api.services.collectChanges.SingleVersionCollectChangesCommand.collectChanges(SingleVersionCollectChangesCommand.java:1)
at jetbrains.vcs.api.services.collectChanges.CollectChangesServiceProvider$1.collectChanges(CollectChangesServiceProvider.java:4)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:12)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:8)
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:27)
... 22 more
jetbrains.buildServer.vcs.VcsOperationProgressRunner$VcsOperationException: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:29)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:26)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesForCheckoutRules(LoadChanges.java:49)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesByCombinedRule(LoadChanges.java:11)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChanges(LoadChanges.java:34)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader$RunLoadChanges.run(VcsRootChangesLoader.java:39)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader.loadChanges(VcsRootChangesLoader.java:20)
at jetbrains.buildServer.vcs.impl.VcsChangesFetcher$LoadChangesForRoot.run(VcsChangesFetcher.java:8)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl$ImmediateFutureExecService$1.call(VcsChangesLoaderImpl.java)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:59)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:68)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.waitForTaskToComplete(PeriodicChangesLoader.java:13)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.loadChanges(PeriodicChangesLoader.java:11)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl.tryLoadChanges(VcsChangesLoaderImpl.java:24)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction$1.run(VcsModificationChecker.java:0)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction.run(VcsModificationChecker.java:2)
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)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at java.lang.String.substring(String.java:1931)
at com.codicesoftware.plugins.teamcity.PlasticVcsSupport$1.collectChanges(PlasticVcsSupport.java:284)
at jetbrains.buildServer.vcs.utils.VcsPluginUtil.collectBuildChanges(VcsPluginUtil.java:63)
at jetbrains.vcs.api.services.collectChanges.CollectRepositoryChangesPolicyFactory$8.collectChanges(CollectRepositoryChangesPolicyFactory.java:2)
at jetbrains.vcs.api.services.collectChanges.SingleVersionCollectChangesCommand.collectChanges(SingleVersionCollectChangesCommand.java:1)
at jetbrains.vcs.api.services.collectChanges.CollectChangesServiceProvider$1.collectChanges(CollectChangesServiceProvider.java:4)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:12)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:8)
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:27)
... 22 more
java.lang.StringIndexOutOfBoundsException: String index out of range: -33
at java.lang.String.substring(String.java:1931)
at com.codicesoftware.plugins.teamcity.PlasticVcsSupport$1.collectChanges(PlasticVcsSupport.java:284)
at jetbrains.buildServer.vcs.utils.VcsPluginUtil.collectBuildChanges(VcsPluginUtil.java:63)
at jetbrains.vcs.api.services.collectChanges.CollectRepositoryChangesPolicyFactory$8.collectChanges(CollectRepositoryChangesPolicyFactory.java:2)
at jetbrains.vcs.api.services.collectChanges.SingleVersionCollectChangesCommand.collectChanges(SingleVersionCollectChangesCommand.java:1)
at jetbrains.vcs.api.services.collectChanges.CollectChangesServiceProvider$1.collectChanges(CollectChangesServiceProvider.java:4)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:12)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges$CollectChangesForCheckoutRules.call(LoadChanges.java:8)
at jetbrains.buildServer.vcs.VcsOperationProgressProviderImpl.runWithProgress(VcsOperationProgressProviderImpl.java:27)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesWithProgress(LoadChanges.java:26)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesForCheckoutRules(LoadChanges.java:49)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChangesByCombinedRule(LoadChanges.java:11)
at jetbrains.buildServer.buildTriggers.vcs.LoadChanges.collectChanges(LoadChanges.java:34)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader$RunLoadChanges.run(VcsRootChangesLoader.java:39)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.buildTriggers.vcs.VcsRootChangesLoader.loadChanges(VcsRootChangesLoader.java:20)
at jetbrains.buildServer.vcs.impl.VcsChangesFetcher$LoadChangesForRoot.run(VcsChangesFetcher.java:8)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl$ImmediateFutureExecService$1.call(VcsChangesLoaderImpl.java)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:59)
at jetbrains.buildServer.serverSide.impl.ImmediateFuture.get(ImmediateFuture.java:68)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.waitForTaskToComplete(PeriodicChangesLoader.java:13)
at jetbrains.buildServer.vcs.impl.PeriodicChangesLoader.loadChanges(PeriodicChangesLoader.java:11)
at jetbrains.buildServer.vcs.impl.VcsChangesLoaderImpl.tryLoadChanges(VcsChangesLoaderImpl.java:24)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction$1.run(VcsModificationChecker.java:0)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:89)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$CollectChangesAction.run(VcsModificationChecker.java:2)
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)

I was able to reproduce it by

  • installing a fresh version of the above mentioned software packages
  • creating a new empty plastic scm repository
  • creating a new TeamCity project with a VCS root that uses the newly created plastic repository
  • creating a build configuration that uses the new VCS root
  • run that build configuration -> TC should check for pending changes, do a server-side checkout, run your build
  • now, add a new file to your repository, checkin the change
  • re-run your teamcity build configuration => StringIndexOutOfBoundsException

 

Seems to me like a bug introduced somewhere after 5.4.16.686, because downgrading Plastic SCM to 5.4.16.686 fixed that issue for me.

 

Kind regards,

Olaf

Share this post


Link to post
Share on other sites
  • installing a fresh version of the above mentioned software packages
  • creating a new empty plastic scm repository
  • creating a new TeamCity project with a VCS root that uses the newly created plastic repository
  • creating a build configuration that uses the new VCS root
  • run that build configuration -> TC should check for pending changes, do a server-side checkout, run your build
  • now, add a new file to your repository, checkin the change
  • re-run your teamcity build configuration => StringIndexOutOfBoundsException

 

So far I can't reproduce it. I'll keep testing it.

Share this post


Link to post
Share on other sites

Hello Olaf,

 

I noticed that the web current plugin version is: 

VCS support: Plastic SCM	SNAPSHOT-201509221250

That's the one it's working for me, it's weird because the plugin was uploaded on Monday so maybe the plugin you are running is still the old one. Please use the new one. I'm attaching it here: com.codicesoftware.plugins.teamcity.PlasticSCM.zip

 

On the other hand, I'm going to test with the SNAPSHOT-201504131654 one.

Share this post


Link to post
Share on other sites

Now, this is really strange.

 

I downloaded the TeamCity plugin yesterday to be sure that I use the latest version and got the version SNAPSHOT-201504131654.

 

Today I get the correct version, the same you attached. Will try this one...

Share this post


Link to post
Share on other sites

Everything fine!!

 

Using the newest Plugin SNAPSHOT-201509221250 the problem goes away.

 

So, the real problem was that I downloaded the wrong version, however that happened.

 

Thanks Manu and sorry for the trouble!

Share this post


Link to post
Share on other sites

StringIndexOutOfBoundsException error is realted to Java substring and it means you are attempting to access a character which would come after the end of the string. If a String is only 4 characters long, attempting to get the substring from index 0 - 8, will throw this exception. substring(beginIndex, endInded) throws IndexOutOfBoundsException if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...