java.util.NoSuchElementException

Jenkins JIRA | Maurice van der Pot | 3 years ago
  1. 0

    We're experiencing failures in all our builds with the below error in console output. I've been looking at the source code of both Jenkins and Treemap itself and I can't explain how Treemap.putAll would ever generate a NoSuchElementException. For some reason this problem is 100% reproducible and dependent on (at least) the content of our junitResult.xml files in the build directories of our jobs. At the end of my debugging session I could modify the <className> element of one test case of one build of one job and make the problem either occur or go away. However I doubt that it has anything to do with the className element per se.I think that in this case it just happened to be the classname element of this particular build and job. I'm more inclined to believe it has to do with unsynchronized access from multiple threads. Otherwise I can't explain the exception that is thrown. We first ran into this problem with Jenkins 1.517, but we just upgraded to 1.522 and it still occurs. Am I correct in my understanding that Treemap.putAll should never generate this exception? Is this a bug? FATAL: null java.util.NoSuchElementException at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1098) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131) at java.util.TreeMap.buildFromSorted(TreeMap.java:2372) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2322) at java.util.TreeMap.putAll(TreeMap.java:296) at hudson.EnvVars.<init>(EnvVars.java:82) at hudson.EnvVars$GetEnvVars.call(EnvVars.java:217) at hudson.EnvVars$GetEnvVars.call(EnvVars.java:215) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at hudson.EnvVars.getRemote(EnvVars.java:212) at hudson.model.Computer.getEnvironment(Computer.java:907) at jenkins.model.CoreEnvironmentContributor.buildEnvironmentFor(CoreEnvironmentContributor.java:28) at hudson.model.Run.getEnvironment(Run.java:2046) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:933) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:84) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1576) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:241)

    Jenkins JIRA | 3 years ago | Maurice van der Pot
    java.util.NoSuchElementException
  2. 0

    We're experiencing failures in all our builds with the below error in console output. I've been looking at the source code of both Jenkins and Treemap itself and I can't explain how Treemap.putAll would ever generate a NoSuchElementException. For some reason this problem is 100% reproducible and dependent on (at least) the content of our junitResult.xml files in the build directories of our jobs. At the end of my debugging session I could modify the <className> element of one test case of one build of one job and make the problem either occur or go away. However I doubt that it has anything to do with the className element per se.I think that in this case it just happened to be the classname element of this particular build and job. I'm more inclined to believe it has to do with unsynchronized access from multiple threads. Otherwise I can't explain the exception that is thrown. We first ran into this problem with Jenkins 1.517, but we just upgraded to 1.522 and it still occurs. Am I correct in my understanding that Treemap.putAll should never generate this exception? Is this a bug? FATAL: null java.util.NoSuchElementException at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1098) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1136) at java.util.TreeMap$EntryIterator.next(TreeMap.java:1131) at java.util.TreeMap.buildFromSorted(TreeMap.java:2372) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2396) at java.util.TreeMap.buildFromSorted(TreeMap.java:2322) at java.util.TreeMap.putAll(TreeMap.java:296) at hudson.EnvVars.<init>(EnvVars.java:82) at hudson.EnvVars$GetEnvVars.call(EnvVars.java:217) at hudson.EnvVars$GetEnvVars.call(EnvVars.java:215) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at hudson.EnvVars.getRemote(EnvVars.java:212) at hudson.model.Computer.getEnvironment(Computer.java:907) at jenkins.model.CoreEnvironmentContributor.buildEnvironmentFor(CoreEnvironmentContributor.java:28) at hudson.model.Run.getEnvironment(Run.java:2046) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:933) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:84) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1576) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:241)

    Jenkins JIRA | 3 years ago | Maurice van der Pot
    java.util.NoSuchElementException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    All Hudson jobs suddenly failed due to NoSuchElementException

    Stack Overflow | 2 years ago
    java.util.NoSuchElementException
  5. 0

    How to run command in windows batch Command in jenkins

    Stack Overflow | 5 years ago | mannu singh
    java.util.NoSuchElementException

    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.util.NoSuchElementException

      No message provided

      at java.util.TreeMap$PrivateEntryIterator.nextEntry()
    2. Java RT
      TreeMap.putAll
      1. java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1098)
      2. java.util.TreeMap$EntryIterator.next(TreeMap.java:1136)
      3. java.util.TreeMap$EntryIterator.next(TreeMap.java:1131)
      4. java.util.TreeMap.buildFromSorted(TreeMap.java:2372)
      5. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      6. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      7. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      8. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      9. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      10. java.util.TreeMap.buildFromSorted(TreeMap.java:2396)
      11. java.util.TreeMap.buildFromSorted(TreeMap.java:2322)
      12. java.util.TreeMap.putAll(TreeMap.java:296)
      12 frames
    3. Hudson
      EnvVars$GetEnvVars.call
      1. hudson.EnvVars.<init>(EnvVars.java:82)
      2. hudson.EnvVars$GetEnvVars.call(EnvVars.java:217)
      3. hudson.EnvVars$GetEnvVars.call(EnvVars.java:215)
      3 frames
    4. Hudson :: Remoting Layer
      LocalChannel.call
      1. hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      1 frame
    5. Hudson
      Computer.getEnvironment
      1. hudson.EnvVars.getRemote(EnvVars.java:212)
      2. hudson.model.Computer.getEnvironment(Computer.java:907)
      2 frames
    6. jenkins.model
      CoreEnvironmentContributor.buildEnvironmentFor
      1. jenkins.model.CoreEnvironmentContributor.buildEnvironmentFor(CoreEnvironmentContributor.java:28)
      1 frame
    7. Hudson
      Executor.run
      1. hudson.model.Run.getEnvironment(Run.java:2046)
      2. hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:933)
      3. hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:84)
      4. hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:60)
      5. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      6. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      7. hudson.model.Build$BuildExecution.build(Build.java:199)
      8. hudson.model.Build$BuildExecution.doRun(Build.java:160)
      9. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
      10. hudson.model.Run.execute(Run.java:1576)
      11. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      12. hudson.model.ResourceController.execute(ResourceController.java:88)
      13. hudson.model.Executor.run(Executor.java:241)
      13 frames