1

从 SonarQube 5.3 升级到 Sonaeqube 5.6.2 后,我无法成功运行扫描。

请注意,我正在使用 5.6.2 的略微修改版本来解决此处描述的问题:IllegalStateException when migration databases from SonarQube 5.3 to 5.6.2 (and 5.5),但我相当有信心与此无关问题。完全不同的部分代码。

我正在使用 2.1 版的 gradle 插件。我安装了以下声纳插件:

sonar-android-plugin-1.1.jar
sonar-build-breaker-plugin-2.1.jar
sonar-cobertura-plugin-1.7.jar
sonar-findbugs-plugin-3.4.4.jar
sonar-generic-coverage-plugin-1.2.jar
sonar-groovy-plugin-1.4.jar
sonar-java-plugin-4.2.jar
sonar-javascript-plugin-2.16.0.2922.jar
sonar-pitest-plugin-0.6.jar
sonar-piwik-plugin-1.0.jar
sonar-python-plugin-1.6.jar
sonar-timeline-plugin-1.5.jar
sonar-xml-plugin-1.4.1.jar

Gradle 抛出“IllegalStateException:报告处理未成功完成:FAILED”。并且服务器上的后台任务正在抛出“IllegalStateException: Fail to read ISSUES.LOCATIONS [KEE=AVYt-LEmlODHqmsVS6V8]”。完整的堆栈跟踪可以在下面找到。

我检查了 MySQL 中的数据,可以确认该行确实存在:

# id, kee, rule_id, severity, manual_severity, message, line, gap, status, resolution, checksum, reporter, assignee, author_login, action_plan_key, issue_attributes, effort, created_at, updated_at, issue_creation_date, issue_update_date, issue_close_date, tags, component_uuid, project_uuid, locations, issue_type
'1357', 'AVYt-LEmlODHqmsVS6V8', '1223', 'MINOR', '0', 'Define a constant instead of duplicating this literal \"Item \" 4 times.', '258', '4.00000000000000000000', 'OPEN', NULL, '1296deed4ac6511ff2f9516a1f25f984', NULL, NULL, NULL, NULL, '', '10', '1469650091279', '1474887211270', '1469650055000', '1469650055000', NULL, 'design', 'AVYt-KA3lODHqmsVS6VG', 'AVYt-GJ8lODHqmsVS6U5', ?, '1'

并且位置列包含一个带有以下内容的 BLOB(作为文本):

ÂÂ$ +
ÂÂ$ +Duplication
ÂÂ$ +Duplication
½½& -Duplication
ÃÃ* 1Duplication

如果有人能对这种情况有所了解,我将不胜感激。

干杯!

罗伯特

2016.09.26 22:41:32 INFO  [o.s.s.c.s.ComputationStepExecutor] Compute test measures | time=6ms
2016.09.26 22:41:32 INFO  [o.s.s.c.s.ComputationStepExecutor] Compute complexity measures | time=52ms
2016.09.26 22:41:32 INFO  [o.s.s.c.s.ComputationStepExecutor] Load measure computers | time=2ms
2016.09.26 22:41:32 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVdoqQI3n6cQT_03NFYE
org.sonar.server.computation.component.VisitException: Visit of Component {key=:md049gateway:src/main/java/com/nike/caps/md049gateway/application/impl/JobServiceImpl.java,type=FILE} failed
    at org.sonar.server.computation.component.VisitException.rethrowOrWrap(VisitException.java:44) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:64) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:100) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:87) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:50) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.6.3-SNAPSHOT.jar:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_101]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.IllegalStateException: Fail to process issues of component ':md049gateway:src/main/java/com/nike/caps/md049gateway/application/impl/JobServiceImpl.java'
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:74) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:59) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:82) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:107) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:90) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.component.VisitorsCrawler.visit(VisitorsCrawler.java:62) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    ... 21 common frames omitted
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.IllegalStateException: Fail to read ISSUES.LOCATIONS [KEE=AVYt-LEmlODHqmsVS6V8]
### The error may exist in org.sonar.db.issue.IssueMapper
### The error may involve org.sonar.db.issue.IssueMapper.selectNonClosedByComponentUuid-Inline
### The error occurred while setting parameters
### SQL: select           i.id,     i.kee as kee,     i.rule_id as ruleId,     i.severity as severity,     i.manual_severity as manualSeverity,     i.message as message,     i.line as line,     i.locations as locations,     i.gap as gap,     i.effort as effort,     i.status as status,     i.resolution as resolution,     i.checksum as checksum,     i.assignee as assignee,     i.author_login as authorLogin,     i.tags as tagsString,     i.issue_attributes as issueAttributes,     i.issue_creation_date as issueCreationTime,     i.issue_update_date as issueUpdateTime,     i.issue_close_date as issueCloseTime,     i.created_at as createdAt,     i.updated_at as updatedAt,     r.plugin_rule_key as ruleKey,     r.plugin_name as ruleRepo,     r.language as language,     p.kee as componentKey,     i.component_uuid as componentUuid,     p.module_uuid as moduleUuid,     p.module_uuid_path as moduleUuidPath,     p.path as filePath,     root.kee as projectKey,     i.project_uuid as projectUuid,     i.issue_type as type         from issues i     inner join rules r on r.id=i.rule_id     inner join projects p on p.uuid=i.component_uuid     inner join projects root on root.uuid=i.project_uuid     where     i.component_uuid=? and     i.status <> 'CLOSED'
### Cause: java.lang.IllegalStateException: Fail to read ISSUES.LOCATIONS [KEE=AVYt-LEmlODHqmsVS6V8]
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:130) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:118) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.binding.MapperMethod.executeWithResultHandler(MapperMethod.java:108) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:60) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.2.7.jar:3.2.7]
    at com.sun.proxy.$Proxy52.selectNonClosedByComponentUuid(Unknown Source) ~[na:na]
    at org.sonar.server.computation.issue.BaseIssuesLoader.loadForComponentUuid(BaseIssuesLoader.java:61) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.issue.TrackerBaseInputFactory$BaseLazyInput.loadIssues(TrackerBaseInputFactory.java:78) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.core.issue.tracking.LazyInput.getIssues(LazyInput.java:50) ~[sonar-core-5.6.2.jar:na]
    at org.sonar.core.issue.tracking.Tracking.<init>(Tracking.java:58) ~[sonar-core-5.6.2.jar:na]
    at org.sonar.core.issue.tracking.Tracker.track(Tracker.java:37) ~[sonar-core-5.6.2.jar:na]
    at org.sonar.server.computation.issue.TrackerExecution.track(TrackerExecution.java:41) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.sonar.server.computation.issue.IntegrateIssuesVisitor.processIssues(IntegrateIssuesVisitor.java:67) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    ... 26 common frames omitted
Caused by: java.lang.IllegalStateException: Fail to read ISSUES.LOCATIONS [KEE=AVYt-LEmlODHqmsVS6V8]
    at org.sonar.db.issue.IssueDto.parseLocations(IssueDto.java:655) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.issue.IssueDto.toDefaultIssue(IssueDto.java:724) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.server.computation.issue.BaseIssuesLoader$1.handleResult(BaseIssuesLoader.java:64) ~[sonar-server-5.6.3-SNAPSHOT.jar:na]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.callResultHandler(DefaultResultSetHandler.java:306) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.storeObject(DefaultResultSetHandler.java:300) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:292) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:266) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:239) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:150) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:60) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:57) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:128) ~[mybatis-3.2.7.jar:3.2.7]
    ... 38 common frames omitted
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.
    at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:70) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.CodedInputStream.readRawBytesSlowPath(CodedInputStream.java:1179) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.CodedInputStream.readBytes(CodedInputStream.java:517) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Location.<init>(DbIssues.java:1674) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Location.<init>(DbIssues.java:1614) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Location$1.parsePartialFrom(DbIssues.java:2407) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Location$1.parsePartialFrom(DbIssues.java:2401) ~[sonar-db-5.6.2.jar:na]
    at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Flow.<init>(DbIssues.java:954) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Flow.<init>(DbIssues.java:910) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Flow$1.parsePartialFrom(DbIssues.java:1527) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Flow$1.parsePartialFrom(DbIssues.java:1521) ~[sonar-db-5.6.2.jar:na]
    at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Locations.<init>(DbIssues.java:112) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Locations.<init>(DbIssues.java:55) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Locations$1.parsePartialFrom(DbIssues.java:852) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Locations$1.parsePartialFrom(DbIssues.java:846) ~[sonar-db-5.6.2.jar:na]
    at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:137) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:169) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:180) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:185) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49) ~[protobuf-java-3.0.0-beta-2.jar:na]
    at org.sonar.db.protobuf.DbIssues$Locations.parseFrom(DbIssues.java:253) ~[sonar-db-5.6.2.jar:na]
    at org.sonar.db.issue.IssueDto.parseLocations(IssueDto.java:653) ~[sonar-db-5.6.2.jar:na]
    ... 54 common frames omitted
2016.09.26 22:41:32 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=:md049gateway | type=REPORT | id=AVdoqQI3n6cQT_03NFYE | time=1642ms
4

1 回答 1

0

这似乎是由于我们的数据库中存在某种损坏。希望 5.6.3 中所做的更改(请参阅链接的问题)将使我们能够追踪问题。

于 2016-09-27T16:38:55.233 回答