Sonarqube 从数据库恢复,使数据库处于不一致状态

Sonarqube 从数据库恢复,使数据库处于不一致状态,sonarqube,sonar-runner,sonarqube5.1,Sonarqube,Sonar Runner,Sonarqube5.1,由于内存不足,Sonar maven插件运行失败。我试着在一个模块上运行它来调试一些东西 [INFO] [16:16:07.709] Execute PMD 5.4.0 done: 10861 ms [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------

由于内存不足,Sonar maven插件运行失败。我试着在一个模块上运行它来调试一些东西

[INFO] [16:16:07.709] Execute PMD 5.4.0 done: 10861 ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:07 min
[INFO] Finished at: 2015-12-30T16:16:08+01:00
[INFO] Final Memory: 76M/953M
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
constituent[0]: file:/usr/share/maven3/lib/wagon-http-2.6-shaded.jar
[SNIP...]
constituent[39]: file:/usr/share/maven3/conf/logging/
---------------------------------------------------
Exception in thread "main" 
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
现在,当我尝试在所有模块上运行sonar时,它告诉我:
项目'foo:module1'已经在SonarQube中定义,但不是作为项目'foo:aggregator'的模块。

但当我谈到声纳时:

  • 所有项目列表中没有项目
    foo:module1
  • 当我打开
    http://sonar.example/dashboard/index/foo:module1
    它将
    模块1
    显示为
    foo:aggregator
  • 我看到“项目权限”视图中列出了模块1
我尝试运行分析直到完成,希望它能添加项目,以便稍后删除它,但我得到:

[INFO] [17:17:17.805] Execute decorators...
[WARN] [17:17:33.408] Too many components under resource 'module1'. DSM will not be displayed.
[INFO] [17:17:33.526] Store results in database
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:19 min
[INFO] Finished at: 2015-12-30T17:17:33+01:00
[INFO] Final Memory: 57M/1044M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project module1: Unable to save file sources:
[ERROR] ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '34503e95-81ac-40bb-a73c-60325a11088c' for key 'file_sources_file_uuid_uniq'
[ERROR] ### The error may involve org.sonar.core.source.db.FileSourceMapper.insert-Inline
[ERROR] ### The error occurred while setting parameters
[ERROR] ### SQL: INSERT INTO file_sources (project_uuid, file_uuid, created_at, updated_at, binary_data, line_hashes, data_hash, src_hash)     VALUES (?, ?, ?,     ?, ?, ?,     ?, ?)
[ERROR] ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '34503e95-81ac-40bb-a73c-60325a11088c' for key 'file_sources_file_uuid_uniq'

如何从sonar中“删除”
foo:module1
,以便对
foo:aggregator

进行分析我能做的最好的事情是使用批量删除来删除
module1
这带走了所有模块的数据

很明显,你可以通过在maven子模块上执行runner来传输声纳数据。干得好