Not a patch revision id error when opening a review

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

atlassian-fisheye.log に次のメッセージが表示される。

javax.servlet.ServletException - javax.el.ELException: java.lang.IllegalArgumentException: Not a patch revision id: 0:T


    javax.el.ELException: java.lang.IllegalArgumentException: Not a patch revision id: 0:T

    java.lang.IllegalArgumentException: Not a patch revision id: 0:T

    Not a patch revision id: 0:T

原因

This may happen after an upgrade from Fisheye/Crucible 2.x to 3.x, if the database schema was already upgraded and a review was created with the old version, because the format of the column cru_revision in the table cru_revision has changed for patches from 0:F to 0:0:F.

This may relates with org.hibernate.PropertyAccessException when opening a review.

ソリューション

  • Check the affected records with the following command:

    SELECT * 
    FROM cru_revision
    WHERE cru_source_name like 'PATCH:%' and cru_revision NOT LIKE '%:%:%';
    
  • Run the following query to adjust the records:

    • For MySQL:

      update cru_revision
      set cru_revision = concat(substr(cru_source_name, 7), ':', cru_revision)
      where cru_source_name like 'PATCH:%' and cru_revision NOT LIKE '%:%:%';
      
    • For Oracle:

      update cru_revision
      set cru_revision = substr(cru_source_name, 7)||':'||cru_revision
      where cru_source_name like 'PATCH:%' and cru_revision NOT LIKE '%:%:%';
      
    • For SQL Server 2005/2008:

      update cru_revision
      set cru_revision = substring(cru_source_name, 7, len(cru_source_name)) + ':' + cru_revision
      where cru_source_name like 'PATCH:%' and cru_revision NOT LIKE '%:%:%';
      
最終更新日 2018 年 7 月 31 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.