SonarScanner not failing because of "not enough space on disk"; potentially resulting in closed issues and many issues of rule "Java parser failure"


our SonarScanner had some problems on the last run; cause: “not enough space on disk”. Also some (I think consecutive) errors occurred in the logfile after running out of disk space. Especially “ERROR: ECJ: Unable to parse file; java.lang.IllegalStateException: invalid environment settings”.
But the complete job has not failed. (It analysed about a fifth of the files correctly.)This resulted in:

  • 100k issues closed
  • 25k issues of rule “Java parser failure” created
    This means, if we fix the problem, many new issues are created.

-> In my opinion this is not the best error handling.

  1. Why not failing the job on “out of disk space”
  2. Why not failing the job on “Java parser failure”

SonarQube Scanner
SonarQube Server 7.9.1
SonarJava 6.1 (build 20866

not enough disk space exception: potential root cause.txt (4.8 KB)
ERROR: ECJ: Unable to parse file: invalid environment settings.txt (3.5 KB)
not a valid line offset for pointer.txt (14.3 KB)

first part of whole log: firstPartOfFullLog.txt (3.8 MB)

Depending when the errors happen, they might be isolated so that the scanner can continue if some of the analyzer’s rules fail for whatever reason.
If you’d like to fail the scan if any error is logged, I’d try to check for output to stderr and fail the job if there is anything.

I agree; not each Error should lead to an aborted scanner run.
But in this case it was not just the error of just one isolated rule. The whole environment was no longer in a functional mode because of not enough space on disk. Furthermore this led to closing many existing issues.

Yes; we could scan for “Caused by: There is not enough space on the disk” but that feels like a workaround :).