-
Notifications
You must be signed in to change notification settings - Fork 24
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
NullPointerException when running SonarScanner #28
Comments
Seems like config issue - one of projecId or refName is empty. Check $CI_COMMIT_REF_NAME or $CI_PROJECT_PATH value if it is correctly set. |
Thanks for replying! :) I added a couple of echoes before the sonar-scanner, it does have values.
|
hmmm, so I manually set it to the value in the config file:
And also tried setting it with -D Looks like I'm getting the same error still
btw, I copied using the proejct path for the id from the readme.md: https://github.com/javamachr/sonar-gitlab-plugin/blob/master/README.md#gitlab-ci |
It seems that it fails to find the project via API. This -Dsonar.gitlab.url=https:/mygitlab.com seems like a wrong value - could you please double check that it is correctly pointed to your GL instance? This part of code should not be broken - must be config related I'd say. |
Hi! Settings:
Log:
|
It is checking gitlab API using sonar.gitlab.url=https://git/ and projectId and it obviously fails since https://git/ seems to be wrong value and no gitlab server is running there I assume. |
Thanks for your reply. The URL is correct, the standard SonarQube mechanism sends its comments perfectly. |
Hmm can you try to call the API from sonar machine/container via CURL? It should give you some hints. For some reason sonarqube is unable to reach gitlab api calls. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://git/api/v4/projects/410/repository/commits" And see if it returns something or fails. |
It is ok. There is windows server.
|
Hmm then it might be related to JAVA not working with that URL. |
I have the same issue. Have any of you solved the problem? Thanks |
Having same issue. here as well. GitLab 15.11 Since this is a null exception I reckon there are not enough checks to provide user with a meaningful error message. Any tips trying to resolve it? |
I solved it by using sonarqube admin token. The project token wasn't enough.. |
Anyone facing this issue please make sure first that your technical user gitlab access token is valid by performing the following curl operation: I have discovered that the access token I was trying to use was returning 403 response code, when updated the token everything worked. |
I get this crash on the sonar-scanner.
I did try all sorts of tokens and it hasn't seemed to make a difference.
Is there perhaps something I can do to do more debugging?
Run settings:
There's also a
sonar-project.properties
with:Version: 5.2.1
Sonarqube version: Version 9.5 (build 56709)
The text was updated successfully, but these errors were encountered: