We found the following error that sometimes causes a timeout in the scanner:
[INFO] SonarQube version: 184.108.40.206390
> 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.
Thank-you, @Colin. I’m still looking into this, although I’m running out of ideas.
I saw that gradlew calls uname twice, but not uname -m.
We have called uname -m for a long time to collect analytics
Could you point me to where that happens, if possible?
Does it happen in the org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3 .jar?
Although I understand it’s not the cause of this issue, since it has been around for some time (and our Sonar scripts have worked for over a year otherwise).
One hindrance to just installing bash in the Alpine container is that we use docker run --rm ..., which deletes itself between invocations. So we can’t cache it, and–for our purposes–precious seconds count on the self-hosted runners, to avoid blocking multiple teams’ builds.
For the same reason, we may not be able to switch to a non-Alpine image, since installing bash there takes, for example, increases the GitHub Actions workflow by a minute.
Similar post, but resolution was just to install bash
We are working on a fix which should solve the problem for you. It solved the issue in our tests and using the reproducer you provided.
I will let you know as soon as it is released, and after please have a try.
We applied a quick fix and we might make a hardening on the space that caused the issue. Unfortunately, I cannot share implementation details on our private source code.
Please let me know if any problem arises with the feature.