Successful Analysis and Post Processing Step but there is empty project on sonar qube

I have C# project for which I am using sonar scanner from jenkins file, when I am running the Pre processing, msbuild and Post processing commands from my terminal. Then Its showing me the project with the issues, code smells , line of code.
But when I running the same commands from jenkins file using jenkins job then after successfully running all the above mentioned steps it shows empty project on sonar.

Hi,

Welcome to the community!

There’s not a lot to go on here. Maybe we could start with a screenshot of the empty project homepage?

 
Ann

Please find the screenshots attached of the project, measure and activity:

Following are the steps from jenkins file and terminal:

Steps from Jenkins:

  1. sh “mono SonarScanner.MSBuild.exe begin /k:{sonarProjectKey} /d:sonar.host.url={sonarHostUrl}”
  2. sh “msbuild {WORKSPACE}/Unity/Unity.sln /p:Configuration=Debug /p:Platform={platformForBuild} /t:Rebuild”
  3. sh “mono SonarScanner.MSBuild.exe end”

Steps from terminal

  1. mono SonarScanner.MSBuild.exe begin /k:“projectKey” /d:sonar.host.url=“sonarUrl”
  2. msbuild Unity.sln /t:Rebuild
  3. SonarScanner.MSBuild.exe end

Also, in Background tasks everything is a success there are no failed tasks.

Hi,

Thanks for the screenshots. I guess you’re analyzing the same code into the same SonarQube project (i.e. same SonarQube URL & project key) from 2 different locations?

Sorry to keep sending you back to the well, but could you also now post the 2 different analysis logs?

 
Ann

@ganncamp : I didnt get you ?

I’m looking for the output - to the console and/or Jenkins job log - of the commands you listed earlier.

 
Ann

@ganncamp: I need to seek permission to share the logs, but just one query before that, are you saying if I push into sonar qube project from console first and then from jenkins then it behaves like this?
Do we need separate projects for jenkins and console push ?

No, not at all. Just trying to correlate what I see in your activity graph with what you’re relating to us.

 
Ann

@ganncamp: Can I mail you the logs on your email id? If yes, please give me your email Id.

Hi,

Can’t you just redact them? It’s better to have them posted here in some form because I’m giving myself a 60% chance of having to pass this one to someone with more specialized knowledge. (And that person / persons will want the logs too.)

 
Ann

Jenkins_logs.zip (15.4 KB)

Please find the jenkins logs zip attached

Hi,

I’m only seeing one log here. I was hoping to compare a log from an ‘empty’ and non-empty analysis…

 
Ann

@ganncamp: This from the empty analysis that is from jenkins if we are running the commands.
My server is not working, will be sharing the logs from the server ASAP.
Thanks.

@ganncamp : Please find the server terminal logs attached.Server_Console_Logs.zip (8.2 KB)

@ganncamp : Please let me know if anything else is required from my side. Thanks for the help, waiting on you. I am stuck at this problem.

Hi,

Sorry for the delay in responding. It’s been a bit busy. Looking at your logs, I see this:

Console

INFO: Indexing files...
...
INFO: 2569 files indexed
INFO: 207 files ignored because of inclusion/exclusion patterns

Jenkins:

20:02:18  20:02:17.182 INFO: Indexing files...
...
20:02:18  20:02:17.466 INFO: 938 files indexed
20:02:18  20:02:17.466 INFO: 1838 files ignored because of inclusion/exclusion patterns

So far this is what jumps out. The question is why the inclusion/exclusion patterns are different. The first step is probably to find out what patterns are being applied at analysis. Here the sonar.scanner.dumpToFile=[name of file] analysis property can help. Add it, please, to analysis from both places and then compare the output.

 
Ann

@ganncamp : Please find the dump files generated:
File generated from Jenkins: “jenkinsdumpFile2.txt“
File generated from terminal: “terminal_dump_file.txt“Dump files.zip (50.9 KB)

@ganncamp : Hi, it will be really helpful if you can let me know the changes in dump file, I have added the dump files generated using sonar.scanner.dumpToFile. Please let me know if anything else is required. I am stuck at this its been a month. Please if you can look into it.