【问题标题】:Recover from sonarrunner leaving DB in inconsistent state从 sonarrunner 中恢复,使数据库处于不一致状态
【发布时间】:2016-04-04 14:46:03
【问题描述】:

由于内存不足,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"

现在,当我尝试在所有模块上运行声纳时,它告诉我:The project 'foo:module1' is already defined in SonarQube but not as a module of project 'foo:aggregator'

但是当我使用声纳时:

  • 所有项目列表中没有项目foo:module1
  • 当我打开http://sonar.example/dashboard/index/foo:module1 时,它会将module1 显示为foo:aggregator 的一个组件
  • 我看到module1 列在“项目权限”视图中

我尝试运行分析以完成,希望它会添加项目,以便我以后可以将其删除,但我得到了:

[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'

如何从声纳中“删除”foo:module1,以便对foo:aggregator 运行分析

【问题讨论】:

    标签: sonarqube sonar-runner sonarqube5.1


    【解决方案1】:

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

    显然,您只需在 maven 子模块上执行 runner 即可处理您的 Sonar 数据。好样的!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多