First time user - CVS/Root does not exist

I’m trying to do my first scan of our java source stored in CVS. I’m using SonarQube version 7.2.1, and Sonar Scanner version I set up my sonar-project file in the root folder. When I run the scanner, it detects that I’m using CVS but fails because it can’t find a folder / file CVS\Root inside my source directory. I don’t have this file. There is a folder called CVS but it only contains an XML file called fileattr. Is there a workaround for this? Here’s my output:

D:\JavaSource\FC> sonar-scanner
INFO: Scanner configuration file: C:\sonar-scanner\bin\..\conf\
INFO: Project root configuration file: D:\JavaSource\FC\
INFO: SonarQube Scanner
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Windows Server 2008 R2 6.1 amd64
INFO: User cache: C:\Users\task_user\.sonar\cache
INFO: SonarQube server 7.2.1
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=203ms
INFO: Server id: AWVDSxQYg1XcpJ3BbPNO
INFO: User cache: C:\Users\task_user\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=93ms
INFO: Load/download plugins (done) | time=187ms
INFO: Loaded core extensions:
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=374ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=47ms
INFO: Load active rules
INFO: Load active rules (done) | time=593ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=47ms
INFO: Project key: fmic:FremontComplete
INFO: Project base dir: D:\JavaSource\FC
INFO: -------------  Scan Fremont Complete
INFO: Load server rules
INFO: Load server rules (done) | time=203ms
INFO: Base dir: D:\JavaSource\FC
INFO: Working dir: D:\JavaSource\FC\.scannerwork
INFO: Source paths: .
INFO: Source encoding: windows-1252, default locale: en_US
INFO: Index files
INFO: 9587 files indexed...  (last one was js/yui3-gallery/build/gallery-bulkedit/gallery-bulkedit-min.js,v)
INFO: 15335 files indexed
INFO: Quality profile for xml: Sonar way
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: 2641 source files to be analyzed
INFO: 2631/2641 files analyzed, current file: D:\JavaSource\FC\work\org\apache\jsp\CVS\fileattr.xml
INFO: 2641/2641 source files have been analyzed
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=10530ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=125ms
INFO: Sensor XML Sensor [xml]
INFO: Sensor XML Sensor [xml] (done) | time=28844ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=1701ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=15ms
INFO: SCM provider for this project is: cvs
INFO: 2641 files to be analyzed
INFO: 0/2641 files analyzed
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:11.355s
INFO: Final Memory: 22M/808M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Can't read D:\JavaSource\FC\CVS\Root
ERROR: Caused by: File 'D:\JavaSource\FC\CVS\Root' does not exist
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.


I have absolutely no knowledge of how CVS operates nor what CVS Root represents, but seems like CVS integration does let you deal with specific cases where you would have to override default behaviour: CVS Plugin offers a sonar.cvs.cvsRoot parameter. I guess poking around with that could overcome your issue here. (you need to find out what your CVSRoot string is, no clue how to approach that).

Thanks Nicolas. I have a /Javasource folder, which I believe is my CVS/root. It has a folder called CVSROOT along with a folder for each of the projects being managed by CVS. My sonar-properties is in the underlying folder for the project I’m trying to scan, and that it also where I’m calling the scanner from. I pointed my sonar.cvs.cvsRoot at the /Javasource folder. This is now giving me a different error -

09:04:51.965 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to connect
        at org.sonarqube.scm.cvs.CvsBlameCommand.blame(
        at org.sonar.scanner.scm.ScmPublisher.publish(
        at org.sonar.scanner.phases.PublishPhaseExecutor.afterSensors(
        at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
        at org.sonar.core.platform.ComponentContainer.startComponents(
        at org.sonar.core.platform.ComponentContainer.execute(
        at org.sonar.scanner.scan.ProjectScanContainer.scan(
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(

I guess I’m just not exactly clear on how the CVS plugin works - there are parameters listed in the documentation about users and passwords, and I’m not sure what needs to be entered and what doesn’t. If anyone is aware of some clear documentation on what needs to be done to get the CVS plugin to work I would appreciate it. As it is, I know I’m missing stuff because it looks like it’s only picking up on the fileattr.xml files, which are not what I need to scan.

CVS being a community plugin, I’m not aware of any formal documentation other than the repository itself . Based on that latest error it does seem like you need to poke around with the password/passphrase parameters.

Thanks Nico. I’ve tried to play around a little bit, but I’m getting nowhere. I’m not even sure if I’m putting the properties into the correct file - there’s the properties file on the Sonar server, and there’s also the properties file on the source code server. When I run the scanner, it says “unable to connect”, but I can’t tell where it’s trying to connect to. I get the same error with or without the user / password. I’m not really sure where to turn, if there aren’t any users out there with knowledge of the CVS plugin.

One thing for sure is that the CVS plugin related properties would have to be set on the scanner side, where the plugin kicks in to collect blame information. The appropriate values then can only depend on your setup. If issues remain then looks like you’ll have to dig debug logs and understand how cvs blame info is collected.