Sonar scanner stuck at user cache

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Github
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI)
    Manual
  • Scanner command used when applicable (private details masked)
    sonar-scanner
  • Languages of the repository
    C and assembly
  • Only if the SonarCloud project is public, the URL
    https://sonarcloud.io/project/configuration?id=VisorFolks_cyancore
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
    Sonar Project properties:
sonar.organization=cyancore
sonar.projectKey=VisorFolks_cyancore
sonar.sources=src/
sonar.cfamily.build-wrapper-output=toolchain/bw-output
sonar.host.url=https://sonarcloud.io

Log:

INFO: Scanner configuration file: /home/pranjal-chanda/Git/cyancore/toolchain/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/pranjal-chanda/Git/cyancore/sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 5.11.0-44-generic amd64
INFO: User cache: /home/pranjal-chanda/.sonar/cache

Verbose:

INFO: Scanner configuration file: /home/pranjal-chanda/Git/cyancore/toolchain/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/pranjal-chanda/Git/cyancore/sonar-project.properties
17:49:05.527 INFO: SonarScanner 4.4.0.2170
17:49:05.528 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
17:49:05.528 INFO: Linux 5.11.0-44-generic amd64
17:49:05.641 DEBUG: keyStore is : 
17:49:05.642 DEBUG: keyStore type is : pkcs12
17:49:05.642 DEBUG: keyStore provider is : 
17:49:05.642 DEBUG: init keystore
17:49:05.642 DEBUG: init keymanager of type SunX509
17:49:05.735 DEBUG: Create: /home/pranjal-chanda/.sonar/cache
17:49:05.735 INFO: User cache: /home/pranjal-chanda/.sonar/cache
17:49:05.735 DEBUG: Create: /home/pranjal-chanda/.sonar/cache/_tmp
17:49:05.737 DEBUG: Extract sonar-scanner-api-batch in temp...
17:49:05.740 DEBUG: Get bootstrap index...
17:49:05.740 DEBUG: Download: https://sonarcloud.io/batch/index
17:49:13.670 DEBUG: Get bootstrap completed
17:49:13.673 DEBUG: Download https://sonarcloud.io/batch/file?name=scanner-sonarcloud-8.0.0.25934-all.jar to /home/pranjal-chanda/.sonar/cache/_tmp/fileCache2650235340717410128.tmp

Hey there.

This can often happen on local machines when anti-virus software gettings in the way (trying to inspect .jar or .zip files). Could that be happening here? What happens if you manually call https://sonarcloud.io/batch/file?name=scanner-sonarcloud-8.0.0.25934-all.jar from a browser (or curl it to your local machine?)

I am able to download the file. Moreover I am using dedicated Ubuntu machine with no antivirus installed. Any workaround possible to locally fetch the .jar file without downloading every time? If that solves the issue. And adding to that the jar file takes lots of time to download as well.

How long does it take to download the file on this machine? The file is 20 MB.

About 30 mins. My network connection is working well with other servers/sites. No VPN(s) are up as well.

Majorly getting 30-40KBps speed.

As mentioned: Any workaround possible along with the downloaded file.

Some Progress after waiting like 30 mins:

INFO: Scanner configuration file: /home/pranjal-chanda/Git/cyancore/toolchain/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/pranjal-chanda/Git/cyancore/sonar-project.properties
23:45:40.590 INFO: SonarScanner 4.4.0.2170
23:45:40.591 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
23:45:40.591 INFO: Linux 5.11.0-44-generic amd64
23:45:40.684 DEBUG: keyStore is : 
23:45:40.684 DEBUG: keyStore type is : pkcs12
23:45:40.684 DEBUG: keyStore provider is : 
23:45:40.684 DEBUG: init keystore
23:45:40.685 DEBUG: init keymanager of type SunX509
23:45:40.772 DEBUG: Create: /home/pranjal-chanda/.sonar/cache
23:45:40.772 INFO: User cache: /home/pranjal-chanda/.sonar/cache
23:45:40.772 DEBUG: Create: /home/pranjal-chanda/.sonar/cache/_tmp
23:45:40.774 DEBUG: Extract sonar-scanner-api-batch in temp...
23:45:40.777 DEBUG: Get bootstrap index...
23:45:40.777 DEBUG: Download: https://sonarcloud.io/batch/index
23:45:42.703 DEBUG: Get bootstrap completed
23:45:42.708 DEBUG: Create isolated classloader...
23:45:42.717 DEBUG: Start temp cleaning...
23:45:42.719 DEBUG: Temp cleaning done
23:45:42.720 INFO: Scanner configuration file: /home/pranjal-chanda/Git/cyancore/toolchain/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
23:45:42.720 INFO: Project root configuration file: /home/pranjal-chanda/Git/cyancore/sonar-project.properties
23:45:42.721 INFO: Analyzing on SonarCloud
23:45:42.721 INFO: Default locale: "en_GB", source code encoding: "UTF-8" (analysis is platform dependent)
23:45:42.722 DEBUG: Work directory: /home/pranjal-chanda/Git/cyancore/.scannerwork
23:45:42.723 DEBUG: Execution execute
23:45:42.878 DEBUG: SonarCloud 9.0.1.46107
23:45:43.023 INFO: Load global settings
23:45:44.853 DEBUG: GET 200 https://sonarcloud.io/api/settings/values.protobuf | time=1826ms
23:45:44.859 INFO: Load global settings (done) | time=1837ms
23:45:44.864 INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
23:45:44.873 INFO: User cache: /home/pranjal-chanda/.sonar/cache
23:45:44.876 INFO: Load/download plugins
23:45:44.877 INFO: Load plugins index
23:45:45.195 DEBUG: GET 200 https://sonarcloud.io/api/plugins/installed | time=318ms
23:45:45.226 INFO: Load plugins index (done) | time=350ms
23:45:45.313 DEBUG: Download plugin 'javascript' to '/home/pranjal-chanda/.sonar/_tmp/fileCache3774498076814356459.tmp'
23:45:45.659 DEBUG: GET 200 https://sonarcloud.io/api/plugins/download?plugin=javascript&acceptCompressions=pack200 | time=346ms

Now again it got stuck.

I think this issue is due to server bandwidth. I was able to finish the scan after a long time. Post that the scanner runs smooth.