SonarQube Enterprise: "Visit failed for component", "IllegalArgumentException"

Configured SonarQube Enterprise edition for the first use. I’m unable to get a successful scan from my C# solution. Instead I get an error. Stack trace begins with:

org.sonar.ce.task.projectanalysis.component.VisitException: Visit failed for Component {key=…:,type=DIRECTORY} located … …(type=PROJECT)

later in the stack:

Caused by: java.lang.IllegalArgumentException: Component key length (414) is longer than the maximum authorized (400). ‘…’

The project name referenced is 14 characters long.

Any suggestions?

hi @SidCS and welcome to our community forum

some initial questions:

  • what is the version of SQ?
  • what is the version of the SQ Scanner for MSBuild you are using?
  • can you please attach the full logs of the BEGIN step?

Hi Andrei. The answers to your questions are below:

  • SonarQube Enterprise 8.2.0.32929 (I had the developer edition installed previously)

  • sonar-scanner-msbuild-4.7.1.2311-net46 (Windows 10 64-bit)

  • log of the SonarScanner begin step attached.

Thank you for your help.

-Sid

(Attachment step1.log is missing)

Trying to attach log file again. You’ll find attached step1.zip.

-Sid

(Attachment step1.zip is missing)

Third try….

step1.txt (531 Bytes)

ok… maybe I am missing something - it doesn’t fail in the BEGIN step, but in the end step?

my bad then, please attach the DEBUG logs for the END step.

to get the debug verbose logs, you need to use the sonar.verbose property in the begin step (e.g. SonarScanner.MSBuild.exe begin /k:"My_Project" /d:sonar.verbose=true ...) and please attach the output of END step

Sending again, without screenshot

image001.jpg

Log attached.

image001.jpg

(Attachment endLog.txt is missing)

Hi Andrei,

My previous messages would not go through; either it was rejected because of a screenshot or because the size of the attachment (log file) was too large.

The last time I ran the SonarScanner I got the following error:

It generated the following error:

11:11:36.941 ERROR: Failed to parse file [AccountSwitch/Content/freshUI/js/main.js] at line 498: Unexpected token

11:11:59.179 ERROR: Cannot find module ‘typescript’

Require stack:

  • C:\git\ClickSwitch\AccountSwitch.sonarqube\out.sonar.sonartmp\eslint-bridge-bundle\package\lib\tsconfig.js

  • C:\git\ClickSwitch\AccountSwitch.sonarqube\out.sonar.sonartmp\eslint-bridge-bundle\package\lib\server.js

  • C:\git\ClickSwitch\AccountSwitch.sonarqube\out.sonar.sonartmp\eslint-bridge-bundle\package\bin\server

11:11:59.179 ERROR: TypeScript dependency was not found and it is required for analysis.

11:11:59.179 ERROR: Install TypeScript in the project directory or use NODE_PATH env. variable to set TypeScript location, if it’s located outside of project directory.

11:11:59.181 ERROR: Missing TypeScript dependency

org.sonar.plugins.javascript.eslint.MissingTypeScriptException: Missing TypeScript dependency

at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.loadTsConfig(EslintBridgeServerImpl.java:270)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)

(remaining stack omitted)

I’ll also mention that things appeared differently when I logged into Windows this morning. The first thing I noticed is that the Admin password I had set yesterday was no longer valid. Next I found references to the developer edition,
which led me to check the server id – this also was different than I had expected.

The info shown on my “system information“ tells me that the server is not pointing at my latest enterprise edition installation but instead the developer edition.
Perhaps you could guide me on how to correct my installation?

-Sid

image001.jpg

Hey there –

We seem to be switching between a lot of different issues

  • Processing of the analysis report
Caused by: java.lang.IllegalArgumentException: Component key length (414) is longer than the maximum authorized (400). ‘…’
  • Analyzing Typescript code
11:11:59.179 ERROR: TypeScript dependency was not found and it is required for analysis.

11:11:59.179 ERROR: Install TypeScript in the project directory or use NODE_PATH env. variable to set TypeScript location, if it’s located outside of project directory.

11:11:59.181 ERROR: Missing TypeScript dependency
  • Something related to your installation

We can only really focus on one at a time, and it’s really important that you stick to trying to solve one issue!

The last issue seems to be an issue with your environment – does somebody else have access to the machine and is messing around with SonarQube as well? Do you have one version installed as a service and the server got rebooted?

I would try and get this in order before focusing on analysis issues.

Hi Colin, thanks for you response.

I agree, lets stick to one issue. Can you please guide me on how to uninstall SonarQube on Windows? I’d like to start over again.

I was unable to find any uninstallation instructions so I decided to poke around on my own. I was able to locate the SonarQube service in the Windows services console. I saw that it was referencing the developer edition installation instead of the enterprise edition. I manually stopped the service then found a batch file in my local developer installation named “UninstallNTService.bat” and ran this. I then re-ran the installation steps for installing the enterprise edition.

did you fix your problem @SidCS?

The problem is that the wrong key was being passed into the SonarScanner.

The text shown on the installed web dashboard reads,

Running a SonarQube analysis is straighforward (sic). You just need to execute the following commands at the root of your solution.

However the next command is shown with the incorrect key parameter.

Do you mean in the documentation? Can you provide more details about this (screen shot or relative URL)?