Not a patch revision id error when opening a review
Symptoms
The following appears in the 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
Cause
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.
Resolution
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 '%:%:%';