Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Help: java.lang.IllegalStateException: Unable to blame file #117

Closed
seancheong opened this issue Feb 16, 2017 · 3 comments
Closed

Help: java.lang.IllegalStateException: Unable to blame file #117

seancheong opened this issue Feb 16, 2017 · 3 comments

Comments

@seancheong
Copy link

I have followed the instructions listed in README.md

However, I keep getting the errors below when I run sonar-scanner:

`17:01:12.654 INFO: Option -e/--errors is no longer supported and will be ignored
17:01:12.663 INFO: Scanner configuration file: /Users/cheongz/Workspace/sonarqube/sonar-scanner-2.8/conf/sonar-scanner.properties
17:01:12.664 INFO: Project root configuration file: /Users/cheongz/Documents/project/gene-edit-manager/gene-edit-ui/sonar-project.properties
17:01:12.675 INFO: SonarQube Scanner 2.8
17:01:12.675 INFO: Java 1.8.0_102-ea Oracle Corporation (64-bit)
17:01:12.675 INFO: Mac OS X 10.10.5 x86_64
17:01:12.781 DEBUG: keyStore is :
17:01:12.781 DEBUG: keyStore type is : jks
17:01:12.781 DEBUG: keyStore provider is :
17:01:12.781 DEBUG: init keystore
17:01:12.781 DEBUG: init keymanager of type SunX509
17:01:12.799 INFO: User cache: /Users/cheongz/.sonar/cache
17:01:12.799 DEBUG: Extract sonar-scanner-api-batch in temp...
17:01:12.806 DEBUG: Get bootstrap index...
17:01:12.806 DEBUG: Download: http://localhost:9000/batch_bootstrap/index
17:01:12.859 DEBUG: Get bootstrap completed
17:01:12.860 DEBUG: Create isolated classloader...
17:01:12.866 DEBUG: Start temp cleaning...
17:01:12.874 DEBUG: Temp cleaning done
17:01:12.874 DEBUG: Execution getVersion
17:01:12.878 DEBUG: Execution start
17:01:13.033 DEBUG: Publish global mode
17:01:13.112 INFO: Load global repositories
17:01:13.150 DEBUG: GET 200 http://localhost:9000/batch/global | time=34ms
17:01:13.192 INFO: Load global repositories (done) | time=81ms
17:01:13.203 INFO: User cache: /Users/cheongz/.sonar/cache
17:01:13.391 INFO: Load plugins index
17:01:13.395 DEBUG: GET 200 http://localhost:9000/deploy/plugins/index.txt | time=4ms
17:01:13.395 INFO: Load plugins index (done) | time=4ms
17:01:13.396 DEBUG: Load plugins
17:01:13.404 DEBUG: Load plugins (done) | time=8ms
17:01:13.412 DEBUG: API compatibility mode is enabled on plugin Git [scmgit] (built with API lower than 5.2)
17:01:13.412 DEBUG: API compatibility mode is enabled on plugin SVN [scmsvn] (built with API lower than 5.2)
17:01:13.475 DEBUG: Plugins:
17:01:13.475 DEBUG: * C# 5.5.1.522 (csharp)
17:01:13.475 DEBUG: * Java 4.3.0.7717 (java)
17:01:13.475 DEBUG: * Git 1.2 (scmgit)
17:01:13.475 DEBUG: * SonarTsPlugin 1.0.0 (typescript)
17:01:13.475 DEBUG: * SVN 1.3 (scmsvn)
17:01:13.475 DEBUG: * JavaScript 2.18.0.3454 (javascript)
17:01:13.489 DEBUG: Execution getVersion
17:01:13.490 INFO: SonarQube server 6.2
17:01:13.490 INFO: Default locale: "en_US", source code encoding: "UTF-8"
17:01:13.490 DEBUG: Work directory: /Users/cheongz/Documents/project/gene-edit-manager/gene-edit-ui/.sonar
17:01:13.490 DEBUG: Execution getVersion
17:01:13.491 DEBUG: Execution execute
17:01:13.705 INFO: Process project properties
17:01:13.707 DEBUG: Process project properties (done) | time=2ms
17:01:13.777 INFO: Load project repositories
17:01:13.788 DEBUG: GET 200 http://localhost:9000/batch/project.protobuf?key=com.thermofisher%3Agene-edit-ui | time=10ms
17:01:13.830 INFO: Load project repositories (done) | time=53ms
17:01:13.901 DEBUG: Available languages:
17:01:13.901 DEBUG: * C# => "cs"
17:01:13.901 DEBUG: * Java => "java"
17:01:13.901 DEBUG: * TypeScript => "ts"
17:01:13.901 DEBUG: * JavaScript => "js"
17:01:13.904 INFO: Load quality profiles
17:01:13.920 DEBUG: GET 200 http://localhost:9000/api/qualityprofiles/search.protobuf?projectKey=com.thermofisher%3Agene-edit-ui | time=16ms
17:01:13.923 INFO: Load quality profiles (done) | time=19ms
17:01:13.927 INFO: Load active rules
17:01:13.953 DEBUG: GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=cs-sonar-way-21460&p=1&ps=500 | time=25ms
17:01:14.055 DEBUG: GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=java-sonar-way-46348&p=1&ps=500 | time=74ms
17:01:14.110 DEBUG: GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=js-sonar-way-77284&p=1&ps=500 | time=28ms
17:01:14.138 DEBUG: GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=ts-tslint-88282&p=1&ps=500 | time=26ms
17:01:14.149 INFO: Load active rules (done) | time=223ms
17:01:14.174 INFO: Publish mode
17:01:14.174 DEBUG: Start recursive analysis of project modules
17:01:14.175 INFO: ------------- Scan gene-edit-ui
17:01:14.239 INFO: Language is forced to ts
17:01:14.240 INFO: Load server rules
17:01:14.288 DEBUG: GET 200 http://localhost:9000/api/rules/list.protobuf | time=48ms
17:01:14.295 INFO: Load server rules (done) | time=55ms
17:01:14.349 DEBUG: Initializers : GenericCoverageSensor
17:01:14.349 INFO: Initializer GenericCoverageSensor
17:01:14.350 INFO: Initializer GenericCoverageSensor (done) | time=1ms
17:01:14.350 INFO: Base dir: /Users/cheongz/Documents/project/gene-edit-manager/gene-edit-ui
17:01:14.350 INFO: Working dir: /Users/cheongz/Documents/project/gene-edit-manager/gene-edit-ui/.sonar
17:01:14.351 INFO: Source paths: src
17:01:14.351 INFO: Source encoding: UTF-8, default locale: en_US
17:01:14.351 INFO: Index files
17:01:14.356 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : /.cs
17:01:14.356 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/
.java,
/.jav
17:01:14.356 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/
.ts,**/.tsx
17:01:14.356 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/
.js
17:01:14.362 DEBUG: Language of file 'src/main/script/app.ts' is detected to be 'ts'
17:01:14.363 DEBUG: Language of file 'src/main/script/common/data.ts' is detected to be 'ts'
17:01:14.363 DEBUG: Language of file 'src/main/script/common/model.ts' is detected to be 'ts'
17:01:14.363 DEBUG: Language of file 'src/main/script/eula/eula.ts' is detected to be 'ts'
17:01:14.364 DEBUG: Language of file 'src/main/script/footer-view/footer-view.ts' is detected to be 'ts'
17:01:14.364 DEBUG: Language of file 'src/main/script/header-view/nav-header.ts' is detected to be 'ts'
17:01:14.364 DEBUG: Language of file 'src/main/script/helper/helper.ts' is detected to be 'ts'
17:01:14.375 DEBUG: Language of file 'src/main/script/home/home.ts' is detected to be 'ts'
17:01:14.375 DEBUG: Language of file 'src/main/script/main-view/main-view.ts' is detected to be 'ts'
17:01:14.375 DEBUG: Language of file 'src/main/script/persistence/persistence.ts' is detected to be 'ts'
17:01:14.375 DEBUG: Language of file 'src/main/script/helper/omni-helper.ts' is detected to be 'ts'
17:01:14.376 DEBUG: Language of file 'src/main/script/project/project.ts' is detected to be 'ts'
17:01:14.376 DEBUG: Language of file 'src/main/script/selection/selection.ts' is detected to be 'ts'
17:01:14.376 DEBUG: Language of file 'src/test/eula.spec.ts' is detected to be 'ts'
17:01:14.376 DEBUG: Language of file 'src/test/helper.spec.ts' is detected to be 'ts'
17:01:14.379 DEBUG: Language of file 'src/test/home.spec.ts' is detected to be 'ts'
17:01:14.379 DEBUG: Language of file 'src/test/modules.ts' is detected to be 'ts'
17:01:14.379 DEBUG: Language of file 'src/test/project.spec.ts' is detected to be 'ts'
17:01:14.380 DEBUG: Language of file 'src/test/selection.spec.ts' is detected to be 'ts'
17:01:14.386 INFO: 19 files indexed
17:01:14.392 INFO: Quality profile for ts: TsLint
17:01:14.395 DEBUG: Code colorizer, supported languages:
17:01:14.733 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
17:01:14.734 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
17:01:14.737 DEBUG: 'C#' skipped because there is no related file in current project
17:01:14.737 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
17:01:14.737 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
17:01:14.738 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
17:01:14.738 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
17:01:14.738 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
17:01:14.739 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
17:01:14.743 DEBUG: Sensors : Lines Sensor -> SCM Sensor -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> XmlFileSensor -> Linting sensor for TypeScript files -> Combined LCOV and LOC sensor -> Zero Coverage Sensor -> Code Colorizer Sensor -> CPD Block Indexer
17:01:14.743 INFO: Sensor Lines Sensor
17:01:14.751 INFO: Sensor Lines Sensor (done) | time=8ms
17:01:14.751 INFO: Sensor SCM Sensor
17:01:14.751 INFO: SCM provider for this project is: git
17:01:14.755 INFO: 19 files to be analyzed
17:01:14.772 DEBUG: readpipe [git, --version],/usr/local/bin
17:01:14.780 DEBUG: readpipe may return 'git version 2.6.4'
17:01:14.780 DEBUG: remaining output:

17:01:14.781 DEBUG: readpipe [git, config, --system, --edit],/usr/local/bin
17:01:14.787 DEBUG: readpipe may return '/usr/local/git/etc/gitconfig'
17:01:14.787 DEBUG: remaining output:

17:01:14.809 DEBUG: Blame file src/main/script/app.ts
17:01:14.809 DEBUG: Blame file src/main/script/eula/eula.ts
17:01:14.809 DEBUG: Blame file src/main/script/common/model.ts
17:01:14.809 DEBUG: Blame file src/main/script/footer-view/footer-view.ts
17:01:14.809 DEBUG: Blame file src/main/script/common/data.ts
17:01:14.809 DEBUG: Blame file src/main/script/header-view/nav-header.ts
17:01:14.810 DEBUG: Blame file src/main/script/helper/helper.ts
17:01:14.810 DEBUG: Blame file src/main/script/helper/omni-helper.ts
17:01:14.855 DEBUG: Blame file src/main/script/selection/selection.ts
17:01:14.855 DEBUG: Blame file src/main/script/home/home.ts
17:01:14.855 DEBUG: Blame file src/main/script/project/project.ts
17:01:14.855 DEBUG: Blame file src/test/eula.spec.ts
17:01:14.855 DEBUG: Blame file src/main/script/main-view/main-view.ts
17:01:14.856 DEBUG: Blame file src/test/home.spec.ts
17:01:14.856 DEBUG: Blame file src/test/modules.ts
17:01:14.856 DEBUG: Blame file src/main/script/persistence/persistence.ts
17:01:14.857 DEBUG: Blame file src/test/selection.spec.ts
17:01:14.855 DEBUG: Blame file src/test/helper.spec.ts
17:01:14.856 DEBUG: Blame file src/test/project.spec.ts
17:01:14.858 INFO: 0/19 files analyzed
17:01:14.862 INFO: ------------------------------------------------------------------------
17:01:14.862 INFO: EXECUTION FAILURE
17:01:14.862 INFO: ------------------------------------------------------------------------
17:01:14.863 INFO: Total time: 2.204s
17:01:14.952 INFO: Final Memory: 50M/289M
17:01:14.953 INFO: ------------------------------------------------------------------------
17:01:14.953 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to blame file src/main/script/app.ts
at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:128)
at org.sonarsource.scm.git.JGitBlameCommand.access$000(JGitBlameCommand.java:44)
at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:112)
at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:109)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.index(UnpackedObjectCache.java:146)
at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.contains(UnpackedObjectCache.java:109)
at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache.isUnpacked(UnpackedObjectCache.java:64)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:376)
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:142)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:226)
at org.eclipse.jgit.blame.BlameGenerator.push(BlameGenerator.java:317)
at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:216)
at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:126)
... 7 more`

@Pablissimo
Copy link
Owner

The SonarTsPlugin doesn't do any git blame stuff - that's a separate plugin that appears to be having an issue. Unclear why though, but think it's a defect for them.

@Pablissimo
Copy link
Owner

Pablissimo commented Feb 16, 2017

There appear to be diagnostic steps you might be able to follow here:

https://docs.sonarqube.org/display/PLUG/Git+Plugin

Also this issue may be related, if you've got a brand new local Git repo with no commits?

https://jira.sonarsource.com/browse/SONARSCGIT-14

@Pablissimo
Copy link
Owner

Closing, doesn't appear to be an issue with the plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants