Gitlab CI sonar-scanner fails to process submodule

I have created a SonarCloud project for a Python project that contains git submodules. sonar-scanner fails to handle git submodule when Checking cache for sonarcloud-check….

I have only configured the parent project, XYZ, for SonarCloud. Do I need to configure the submodule project as well? I’m a bit lost as to what I am missing in our configuration.

  • ALM used GitLab
  • CI system used GitLab
  • Scanner command used when applicable (private details masked)

# debug 
  • Languages of the repository

  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

Getting source from Git repository
Fetching changes...
Initialized empty Git repository in /builds/ABC/XYZ/.git/
Created fresh repository.
Checking out 2622c362 as development...
Updating/initializing submodules recursively...
Submodule 'batch/common' (https://gitlab-ci-token:[MASKED]***/common.git) registered for path 'batch/common'
Cloning into '/builds/ABC/XYZ/batch/common'...
Submodule path 'batch/common': checked out '8f4..32a'
Entering 'batch/common'
Restoring cache
Checking cache for sonarcloud-check...
FATAL: file does not exist                        
Failed to extract cache

Welcome to the community!

It seems your post got overlooked, sorry for the late response.

From the output you included, it seems to me the scanner wasn’t reached. That is, the failure seems to happen while GitLab is initializing the working tree. I noticed a recent similar thread that had experienced the same symptoms, and the cause of the problem was a misconfiguration of the build scripts. Can you please check on that?