SCM jgit: Failed to find all committed files

  • SonarQube
  • SonarScanner

Similar issue as:

But the CI platform is Bamboo, so the TeamCity workaround can’t be used.

A git repack before scanning does work around the issue.

 INFO: SCM Publisher SCM provider for this project is: git
 INFO: SCM Publisher 22 source files to be analyzed
 INFO: This git repository references another local repository which is not well supported. SCM information might be missing for some files. You can avoid borrow objects from another local repository by not using --reference or --shared when cloning it.
 INFO: SCM Publisher 0/22 source files have been analyzed (done) | time=138ms
 ERROR: Error during SonarScanner execution
 java.lang.IllegalStateException: Failed to find all committed files
        at org.sonar.scm.git.CompositeBlameCommand.collectAllCommittedFiles(
        at org.sonar.scm.git.CompositeBlameCommand.blame(
        at org.sonar.scanner.scm.ScmPublisher.publish(
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(
        at org.sonar.core.platform.SpringComponentContainer.startComponents(
        at org.sonar.core.platform.SpringComponentContainer.execute(
        at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(
        at org.sonar.core.platform.SpringComponentContainer.startComponents(
        at org.sonar.core.platform.SpringComponentContainer.execute(
        at org.sonar.batch.bootstrapper.Batch.doExecute(
        at org.sonar.batch.bootstrapper.Batch.execute(
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.base/java.lang.reflect.Method.invoke(
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(
        at org.sonarsource.scanner.cli.Main.execute(
        at org.sonarsource.scanner.cli.Main.execute(
        at org.sonarsource.scanner.cli.Main.main(
 Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 6af7d2a9d537a4720ecba336a4d3c8798bfdbce1
        at org.eclipse.jgit.revwalk.RevWalk.parseAny( 
        at org.eclipse.jgit.revwalk.RevWalk.parseCommit( 
        at org.sonar.scm.git.CompositeBlameCommand.collectAllCommittedFiles(
        ... 22 more
 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

The commit shows up in the log:

$ git log | head -2
6af7d2a9d537a4720ecba336a4d3c8798bfdbce1 -  (HEAD -> trunk, origin/trunk) INFRA-1214 : generate Key ID using method from rfc7638 (2022-09-02 11:28:28 +0200) <gert@work>
62f1ead72e5cfaa87e069f119b125920c7081d79 -  Release 0.9.1 (2022-06-30 08:22:52 +0200) <gert@work>


Welcome to the community!

I see this in your log:

Can you share how you check out? Do you use --reference or --shared?


Like I said in the opening post, we’re using Atlassian Bamboo as our CI system.

We did not see this issue with:

  • SonarQube server 9.3.0
  • SonarScanner

A permanent solution would be nice, but I mainly opened this Topic to share our workaround in case other users run into the same problem.

The git clones are made using a Bamboo internal plugin where there are very limited options on how the clone is made.

The only options are:

And we select as much as possible the options that limit the clone.

1 Like