IllegalStateException: ProjectLock scanning with CommunityEdition using Gradle, Maven or Scanner


(Tad Yeager) #1

I’ve tried using gradle, maven and scanner, with the latest docker image of the community edition of Sonarqube. I’m having the same issue on multiple projects using gradle, maven, scanner.

sonar-scanner --version

INFO: Scanner configuration file: /Users/xxx/Applications/SonarQubeScanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/xxx/src/cv/someName/sonar-project.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Mac OS X 10.14.3 x86_64

Plugins:
11:30:55.255 INFO: Load/download plugins (done) | time=100ms
11:30:55.321 DEBUG: Plugins:
11:30:55.322 DEBUG: * Dependency-Check 1.1.1 (dependencycheck)
11:30:55.322 DEBUG: * GitHub 1.5.0.1403 (github)
11:30:55.322 DEBUG: * SonarPython 1.11.0.2361 (python)
11:30:55.322 DEBUG: * SonarGo 1.2.0.1735 (go)
11:30:55.322 DEBUG: * OpenID Connect Authentication for SonarQube 1.0.4 (authoidc)
11:30:55.322 DEBUG: * Svn 1.9.0.1310 (scmsvn)
11:30:55.322 DEBUG: * SonarJS 5.1.0.6994 (javascript)
11:30:55.323 DEBUG: * Findbugs 3.8.0 (findbugs)
11:30:55.323 DEBUG: * SonarC# 7.8.0.7429 (csharp)
11:30:55.323 DEBUG: * SonarJava 5.10.0.16419 (java)
11:30:55.323 DEBUG: * LDAP 2.2.0.689 (ldap)
11:30:55.323 DEBUG: * Git 1.6.0.1363 (scmgit)
11:30:55.323 DEBUG: * SonarXML 1.6.0.1637 (xml)
11:30:55.323 DEBUG: * Pitest 0.9.1 (pitest)
11:30:55.323 DEBUG: * SoftVis3D Sonar plugin 1.0.1 (softvis3d)
11:30:55.323 DEBUG: * SonarPHP 2.16.0.4074 (php)
11:30:55.324 DEBUG: * GitLab 3.0.2 (gitlab)
11:30:55.324 DEBUG: * SonarTS 1.9.0.3398 (typescript)

I’ve had a look at most of the issues here:
https://community.sonarsource.com/search?q=org.sonar.scanner.scan.ProjectLock
This looked similar to what’s going on with me except I’m on master branch:

Here’s my command line:
sonar-scanner -X -Dsonar.branch.name=master -Dsonar.login=03b2b66baab7bec9c90d04ea63e23a0fe9dadbc9 -Dsonar.projectKey=cv.someName -Dsonar.ProjectName=SomeName -Dsonar.sources=./src

Top of the exception callstack:
11:30:56.093 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

Top of the bottom of the ‘caused by’ portion of the callstack:
Caused by: org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException: com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder has unsatisfied dependency ‘class com.talanlabs.sonar.plugins.gitlab.CommitFacade’ for constructor ‘public com.talanlabs.sonar.plugins.gitlab.CommitProjectBuilder(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade)’ from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@30b19518:247<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@7ba8c737:9<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@58670130:50<|

I’ve also tried running scanner against maven and gradle example projects and get the same ProjectLock issue.

Any ideas?
Thanks


(Tad Yeager) #2

The community edition I was using was started from docker image.
Switching to downloaded image, no error or problem.