Issues deleting JIRA issues

Simdea October 6, 2017

This is the exception I'm getting.

Best Regards and thank you in advance,
Simdea

com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException: Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=10005]
com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException: Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=10005]
at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.getMaximumMarkerRowAndPreviousRow(LexoRankDaoImpl.java:369) [?:?]
at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.rankInitially(LexoRankOperation.java:177) [?:?]
at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.execute(LexoRankOperation.java:116) [?:?]
at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.performRankOperation(LexoRankManagerImpl.java:300) [?:?]
at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.getRankOrRankInitially(LexoRankManagerImpl.java:86) [?:?]
at com.atlassian.greenhopper.customfield.lexorank.LexoRankCFType.getValueFromIssue(LexoRankCFType.java:121) [?:?]
at com.atlassian.greenhopper.customfield.lexorank.LexoRankCFType.getValueFromIssue(LexoRankCFType.java:29) [?:?]
at com.atlassian.jira.issue.fields.ImmutableCustomField.getValue(ImmutableCustomField.java:349) [classes/:?]
at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper$DeletedIssueEventData.collectCustomFieldValues(DefaultIssueDeleteHelper.java:288) [classes/:?]
at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper$DeletedIssueEventData.<init>(DefaultIssueDeleteHelper.java:275) [classes/:?]
at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper.deleteIssue(DefaultIssueDeleteHelper.java:120) [classes/:?]
at com.atlassian.jira.issue.managers.DefaultIssueManager.deleteIssue(DefaultIssueManager.java:719) [classes/:?]
at com.atlassian.jira.issue.managers.RequestCachingIssueManager.deleteIssue(RequestCachingIssueManager.java:232) [classes/:?]
at com.atlassian.jira.bc.issue.DefaultIssueService.delete(DefaultIssueService.java:402) [classes/:?]
at com.atlassian.jira.bc.issue.DefaultIssueService.delete(DefaultIssueService.java:378) [classes/:?]
at com.atlassian.jira.web.action.issue.DeleteIssue.doExecute(DeleteIssue.java:23) 

1 answer

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2017

Hi Simdea,

The lines to focus on currently are the following:

Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=10005]
com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException: Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=10005]

Take a look at Several actions such as issue ranking, move, export are failing:

Run the following Query in the DB:

SELECT "FIELD_ID", "ID", "ISSUE_ID", "LOCK_HASH", "LOCK_TIME", "RANK",
       "TYPE"
  FROM "AO_60DB71_LEXORANK"
  WHERE "FIELD_ID" = 10005 AND "TYPE" IN (0, 2);

With the above Query you should see Exactly 2 rows as displayed here:

FIELD_ID | ID |       ISSUE_ID       | LOCK_HASH | LOCK_TIME |   RANK    | TYPE 
----------+----+----------------------+-----------+-----------+-----------+------
    10005 |  7 | -9223372036854775808 |           |           | 0|000000: |    0
    10005 |  8 |  9223372036854775807 |           |           | 0|zzzzzz: |    2
(2 rows)

If the above does hold true in your instance do the following:

  1. Stop JIRA
  2. Run the following statements in the database:

    1. insert into AO_60DB71_LEXORANK values
      (DEFAULT,10005,7,-9223372036854775808,NULL,NULL,'0|000000:',0);
      
      insert into AO_60DB71_LEXORANK values
      (DEFAULT,10005,1,9223372036854775807,NULL,NULL,'0|zzzzzz:',2);
  3. Start JIRA

  4. Re-index JIRA

If that does not work let us know and we'll go from there.

Cheers,

Branden

Simdea October 11, 2017

Hello Branden and thanks for your fast response. Unfortunately, the query returned no results. Any more ideas, I just tried to clone an issue and also did not had any luck.

Best Regards and thank you in advance again,
Simdea

Carolina Dill October 26, 2017

I actually had the same issue as Simdea.   So as Branden suggested I :

1) Stopped Jira service
2) Ran the below statements in the database

insert into AO_60DB71_LEXORANK values(DEFAULT,10005,7,-9223372036854775808,NULL,NULL,'0|000000:',0);

insert into AO_60DB71_LEXORANK values(DEFAULT,10005,1,9223372036854775807,NULL,NULL,'0|zzzzzz:',2);
3) Ran the below statement to validate that the table now had the 2 rows:
select * from AO_60DB71_LEXORANK;
4) Started Jira service
5) Ran an integrity check
6) Re-indexed the database

And the issue was solved.  Thank you Branden.

Barys Harbacheuski December 2, 2021

Works well, thanks.

However, if you experience the issue, make sure that you use correct FIELD_ID value which is id of the Rank field. For example on my instance Rank had the id 25700, not 10005.

Suggest an answer

Log in or Sign up to answer