Hello First time poster and very new to SonarQube. I’m running into an issue with the initial configuration for the integration with a privately hosted gitlab.
Issue:
When I attempt to integrate SonarQube with Gitlab I receive the following error in the GUI: Could not validate Gitlab url. Got an unexpected answer.
When I press the check configuration button this error is returned immediately. Checking the logs there is an end of stream error.
Version:
Version: 2025.1.0.102418
Date: 2025-04-28
Deployed: Docker
Relevant Logs:
[From Web.log] (the server_fqdn is 25 characters and is of the form: servername.domainpart1.domainpart2)
025.04.28 13:05:03 DEBUG web[7b558d3e-e8eb-446e-adb7-2fc9befee46a][o.s.a.c.g.GitlabApplicationClient] get projects : [https://<server_fqdn>/api/v4/projects]
2025.04.28 13:05:03 DEBUG web[7b558d3e-e8eb-446e-adb7-2fc9befee46a][o.s.w.c.OkHttpClientBuilder] --> GET https://<server_fqdn>/api/v4/projects
2025.04.28 13:05:03 DEBUG web[7b558d3e-e8eb-446e-adb7-2fc9befee46a][o.s.w.c.OkHttpClientBuilder] <-- HTTP FAILED: java.net.ProtocolException: unexpected end of stream
2025.04.28 13:05:03 INFO web[7b558d3e-e8eb-446e-adb7-2fc9befee46a][o.s.a.c.g.GitlabApplicationClient] Gitlab API call to [https://<server_fqdn>/api/v4/projects] failed with error message : [unexpected end of stream]
java.net.ProtocolException: unexpected end of stream
Stack trace has been omitted to make this post more readable, but I can include it
What I have Tried:
Have tried going to the above URL from the web browser on the SonarQube server and it works as expected.
Have logged into the gitlab server and used tcpdump with a source address of the servers IP to inspect the traffic. When I use the check configuration button no traffic is detected through tcpdump, where if I hit the same URL from the SonarQube host with a web browser I see the expected HTTPS traffic.
Have tried multiple personal access tokens without success.
Opened web debugging, looking at the headers, and have found that I am receiving a 400 Bad Request from the SonarQube API from the /api/alm_settings/validate function, not sure if this is a red herring or not but I’m thinking it’s not.
I’m assuming that the error is due to an issue with the formatting or length of the header but I’m not entirely sure.