We found the following error that sometimes causes a timeout in the scanner:
[INFO] SonarQube version: 8.0.0.41390
...
> Task :sonarqube
...
Error while executing the command uname -m Cannot run program "/bin/bash": error=2, No such file or directory
...
ERROR: Timed out waiting for Sonar analysis to complete
However, it seems to happen only when a newer version of SonarQube is pulled down (.41390) versus .41269.
Could you point us to release notes where bash was added as a required dependency?
We are using GitHub Actions to run Sonar in a Docker alpine image against a Java repo built using Gradle. Our workaround has been to install bash into the container.
It would otherwise be benign except that it does fail the GitHub Actions run, and not something the dev teams can address, since it’s not their code changes that caused the failure. Since we’re looking to enforce PRs with Quality Gate, we can’t have false errors otherwise.
On our end, installing bash is a fine workaround, but it’s perceived as a random change; we need a little more details since it would impact all repos.
It’s not clear what’s happening in the logs when you get this error. Can you find out by adding at least (--info level logs. If it’s not clear, then --debug).
I didn’t find much difference using --info or --debug; one noticeable thing versus original log is that the error message appears before> Task :sonarqube, if that helps.
Here are the snippets from both flags:
--info
CPD Executor CPD calculation finished (done) | time=21ms
Error while executing the command uname -m Cannot run program "/bin/bash": error=2, No such file or directory
> Task :sonarqube
...
--debug
2023-05-25T14:41:04.9693460Z 2023-05-25T14:41:04.917+0000 [LIFECYCLE] [org.sonarqube.gradle.SonarQubeTask]
2023-05-25T14:41:04.9694262Z 2023-05-25T14:41:04.917+0000 [INFO] [org.sonarqube.gradle.SonarQubeTask] CPD Executor CPD calculation finished (done) | time=61ms
2023-05-25T14:41:05.7474554Z 2023-05-25T14:41:05.684+0000 [DEBUG] [jdk.internal.httpclient.debug] [HttpClient-1-SelectorManager] [51s 69ms] HttpClientImpl(1) next timeout: 0
2023-05-25T14:41:05.7480719Z 2023-05-25T14:41:05.684+0000 [DEBUG] [jdk.internal.httpclient.debug] [HttpClient-1-SelectorManager] [51s 69ms] HttpClientImpl(1) next expired: 0
2023-05-25T14:41:05.7485832Z 2023-05-25T14:41:05.684+0000 [DEBUG] [jdk.internal.httpclient.debug] [HttpClient-1-SelectorManager] [51s 69ms] HttpClientImpl(1) Next deadline is 3000
2023-05-25T14:41:05.9480744Z 2023-05-25T14:41:05.878+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 starting : OkHttp ConnectionPool
2023-05-25T14:41:05.9482145Z 2023-05-25T14:41:05.878+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 run again after 300 s : OkHttp ConnectionPool
2023-05-25T14:41:05.9482932Z 2023-05-25T14:41:05.878+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 finished run in 759 µs: OkHttp ConnectionPool
2023-05-25T14:41:06.8474756Z 2023-05-25T14:41:06.756+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 starting : OkHttp ConnectionPool
2023-05-25T14:41:06.8475917Z 2023-05-25T14:41:06.756+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 run again after 300 s : OkHttp ConnectionPool
2023-05-25T14:41:06.8501883Z 2023-05-25T14:41:05.036+0000 [ERROR] [org.sonarqube.gradle.SonarQubeTask] Error while executing the command uname -m Cannot run program "/bin/bash": error=2, No such file or directory
2023-05-25T14:41:06.8502665Z 2023-05-25T14:41:06.756+0000 [DEBUG] [okhttp3.internal.concurrent.TaskRunner] Q10058 finished run in 229 µs: OkHttp ConnectionPool
2023-05-25T14:41:06.8503582Z 2023-05-25T14:41:04.845+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2023-05-25T14:41:06.8504202Z 2023-05-25T14:41:04.845+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :sonarqube
We are using org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3 in the sonar-init.gradle file.
Do these help; what additional information should I provide?
If available, would I be able to see a diff between release 8.0.0.41269 and 8.0.0.41390?
In fact… there should not have been any change. We have called uname -m for a long time to collect analytics information like the architecture being used.
Is this a self-hosted runner? A specific docker image you’re using as your base (maybe something got updated on that layer?)