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

InfluxDB plugin throws java.lang.StringIndexOutOfBoundsException if Sonar project name contains /

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: influxdb-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.89.4
      InfluxDB plugin 1.14
    • Similar Issues:

      Description

      Parsing of the Jenkins log fails if a Sonar project name contains a slash. The method getSonarProjectName just takes everything after the last slash, so it returns an incorrect project name to setSonarDetails.

       

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      	at java.lang.String.substring(String.java:1967)
      	at jenkinsci.plugins.influxdb.generators.SonarQubePointGenerator.setSonarDetails(SonarQubePointGenerator.java:79)
      	at jenkinsci.plugins.influxdb.generators.SonarQubePointGenerator.hasReport(SonarQubePointGenerator.java:66)
      	at jenkinsci.plugins.influxdb.InfluxDbPublisher.perform(InfluxDbPublisher.java:273)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
      	at hudson.security.ACL.impersonate(ACL.java:260)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
      	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:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

       

        Attachments

          Activity

          Hide
          aleksisimell Aleksi Simell added a comment -
          Show
          aleksisimell Aleksi Simell added a comment - Fixed by pull request 30.  https://github.com/jenkinsci/influxdb-plugin/pull/30

            People

            • Assignee:
              aleksisimell Aleksi Simell
              Reporter:
              jl68 Jonas Lindström
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: