Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-5915

Cryptic error when using invalid project key

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5.1
    • Fix Version/s: 5.0
    • Component/s: Scanner
    • Labels:
      None

      Description

      The project key is used to retrieve project referentials before the actual validation that check if key is valid. It leads to cryptic message like:

      14:23:09.613 INFO  - Load project referentials done: 0 ms
      INFO: ------------------------------------------------------------------------
      INFO: EXECUTION FAILURE
      INFO: ------------------------------------------------------------------------
      Total time: 3.259s
      Final Memory: 36M/348M
      INFO: ------------------------------------------------------------------------
      ERROR: Error during Sonar runner execution
      org.sonar.runner.impl.RunnerException: Unable to execute Sonar
      	at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
      	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
      	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
      	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
      	at org.sonar.runner.api.Runner.execute(Runner.java:100)
      	at org.sonar.runner.Main.executeTask(Main.java:70)
      	at org.sonar.runner.Main.execute(Main.java:59)
      	at org.sonar.runner.Main.main(Main.java:53)
      Caused by: java.lang.IllegalArgumentException: Illegal character in query at index 43: http://localhost:44892/batch/project?key=ar g$l:&profile=one-issue-per-line&preview=false
      	at java.net.URI.create(URI.java:859)
      	at org.sonar.batch.bootstrap.ServerClient.doRequest(ServerClient.java:110)
      	at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:96)
      	at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:92)
      	at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:80)
      	at org.sonar.batch.referential.DefaultProjectReferentialsLoader.load(DefaultProjectReferentialsLoader.java:84)
      

      We should escape URL parameters to be safe with all characters.

        Attachments

          Activity

            People

            Assignee:
            henryju OLD - Julien HENRY
            Reporter:
            henryju OLD - Julien HENRY
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: