Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analysis successfull, but failing on reading scanner report #11

Closed
maapteh opened this issue Jan 23, 2018 · 7 comments
Closed

Analysis successfull, but failing on reading scanner report #11

maapteh opened this issue Jan 23, 2018 · 7 comments

Comments

@maapteh
Copy link

maapteh commented Jan 23, 2018

I run a standard build on a JavaScript project which results into an error state, while the report is being sent to SonarQube.

log output:

09:59:08 INFO: ANALYSIS SUCCESSFUL, you can browse https://sonar.FOOBAR.com/dashboard/index/com.foo.bar:shizzle
09:59:08 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
09:59:08 INFO: More about the report processing at https://sonar.FOOBAR.com/api/ce/task?id=JadaJada
09:59:08 INFO: Executing post-job org.sonar.plugins.buildbreaker.AlertBreaker
09:59:08 INFO: Executing post-job org.sonar.plugins.buildbreaker.ForbiddenConfigurationBreaker
09:59:08 INFO: ------------------------------------------------------------------------
09:59:08 INFO: EXECUTION SUCCESS
09:59:08 INFO: ------------------------------------------------------------------------
09:59:08 INFO: Total time: 17.114s
09:59:08 INFO: Final Memory: 66M/685M
09:59:08 INFO: ------------------------------------------------------------------------
09:59:08 Reading SonarQube scanner report (./.scannerwork/report-task.txt)...
09:59:08 /opt/resource/out: line 166: serverVersion: parameter null or not set

If i login to that container i can see this report-task.txt

projectKey=com.foo.bar:shizzle
serverUrl=https://sonar.fOOBAR.com
dashboardUrl=https://sonar.FOOBAR.com/dashboard/index/com.foo.bar:shizzle
ceTaskId=JadaJada
ceTaskUrl=https://sonar.FOOBAR.com/api/ce/task?id=JadaJada

I have no clue why the concourse task of this analysis is failing. The call to https://sonar.FOOBAR.com/api/server/version gives me 5.6.6

@headcr4sh
Copy link
Member

headcr4sh commented Jan 23, 2018

Oh dear. Looks like older SonarQube servers don't report a version...
... probably the "out" script needs to be adjusted.

I think changing the implementation would be trivial:
if serverVersion cannot be found in report-task.txt, we'll simply fetch the server version via the REST API of the server.

Alternative option:
If serverVersion cannot be found in sonar-report.txt, we'll avoid emmitting the serverVersion metadata or set it to "undefined"

@maapteh
Copy link
Author

maapteh commented Jan 23, 2018

Thanks for looking into this, alternative option looks good to me :) Nice work btw!

@headcr4sh
Copy link
Member

Please give v0.0.31 of the resource a try and let me know if your problem has been solved.

@maapteh
Copy link
Author

maapteh commented Jan 24, 2018

nope:

Reading SonarQube scanner report (./.scannerwork/report-task.txt)...
ERROR in /opt/resource/out : line 165 with exit code 6

When i run that line code locally:

loginPUBLISHkey: https://sonar.DOOBAR.com/ 5.6.6

But in the container it gives an exit 6 >> CURLE_COULDNT_RESOLVE_HOST

@headcr4sh headcr4sh reopened this Jan 24, 2018
@headcr4sh
Copy link
Member

That error seems pretty strange.
Especially the fact that "curl" complains, that it cannot find the remote SonarQube host, even though that doesn't really makes sense,... the host could be found in the previous step(s).

I'll have to think about that a bit....

@maapteh
Copy link
Author

maapteh commented Jan 30, 2018

Is it ok for now to keep it undefined? Else i can ask ops to upgrade sonar :)

@headcr4sh
Copy link
Member

I think undefined is an option. Didn't have the time though, to provide another patch. Will try to deliver one until the end of the week.

strimber pushed a commit to strimber/concourse-sonarqube-resource that referenced this issue Mar 19, 2018
Older versions of SonarQube don't put a serverVersion property
into sonar-report.txt. It is possible, to fetch the server version
by using the REST API, though.

Fixes cathive#11
strimber pushed a commit to strimber/concourse-sonarqube-resource that referenced this issue Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants