Ranking is not possible due to internal server error
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
The customer is unable to rank issues on active sprint. When trying to move an issue up in the active sprint, Receives an internal error.
- Balance all fields option on the site Lexorank Management page and it shows balancing is at 100%:
- The integrity checks are passed successfully.
Environment
Jira cloud
Diagnosis
ec2: { [-]
az: eu-west-1a
hn: ip-10-83-58-134
id: i-0a6ca49795af93c55
ip: 10.83.58.134
sn: jira-prod-eu-29--prod-euwest--2021-12-17-11-33-53-958670-2021-12-17-ac--2021-12-20-00-12-utc--os3ja8l0ldi68fin
}
env: prod-euwest-safe
env_suffix: safe
err: { [-]
class: [ [-]
cloud.atlassian.logmon.laas.api.PrivacySafeException
]
msg: Privacy-safe boxing of a com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException
stack: cloud.atlassian.logmon.laas.api.PrivacySafeException: Privacy-safe boxing of a com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.findByFieldAndIssueId(LexoRankDaoImpl.java:197) at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.getOrInitialiseLexoRankRow(LexoRankOperation.java:533) at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.rankRelativeToOtherIssue(LexoRankOperation.java:235) at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.execute(LexoRankOperation.java:93) at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.performRankOperation(LexoRankManagerImpl.java:313) at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.rankAfter(LexoRankManagerImpl.java:201) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl.doRankAfter(InternalRankServiceImpl.java:257) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl.doRankAfter(InternalRankServiceImpl.java:266) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl.access$300(InternalRankServiceImpl.java:44) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl$4.apply(InternalRankServiceImpl.java:122) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl$4.apply(InternalRankServiceImpl.java:119) at com.atlassian.greenhopper.service.ServiceOutcomes.flatMap(ServiceOutcomes.java:44) at com.atlassian.greenhopper.service.rank.InternalRankServiceImpl.rankAfter(InternalRankServiceImpl.java:119) at com.atlassian.greenhopper.web.rank.InternalRankHelper.rankIssuesAfter(InternalRankHelper.java:181) at com.atlassian.greenhopper.web.rank.InternalRankHelper.rank(InternalRankHelper.java:101) at com.atlassian.greenhopper.web.rank.RankResource$1.call(RankResource.java:82)
Cause
Duplicate entries in the rank field.
Solution
Search for Duplicate entries :
select ( p.pkey || '-' || i.issuenum ) as "issuekey" , t.count as "number_of_duplicates", t.field_id, cf.cfname as "customfield_name" from jiraissue i join project p on i.project = p.id join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) t on t.issue_id = i.id join customfield cf on cf.id = t.field_id;
Take a backup of the Rank
DELETE FROM "AO_60DB71_LEXORANK" where "ID" in (select r."ID" from "AO_60DB71_LEXORANK" r join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) r2 on r."ISSUE_ID" = r2.issue_id and r."FIELD_ID" = r2.field_id) and "ID" not in (select min(r."ID") from "AO_60DB71_LEXORANK" r join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) r2 on r."ISSUE_ID" = r2.issue_id and r."FIELD_ID" = r2.field_id group by r2.issue_id, r2.field_id) returning *
Delete the duplicates from the backend using the query :
DELETE FROM "AO_60DB71_LEXORANK" where "ID" in (select r."ID" from "AO_60DB71_LEXORANK" r join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) r2 on r."ISSUE_ID" = r2.issue_id and r."FIELD_ID" = r2.field_id) and "ID" not in (select min(r."ID") from "AO_60DB71_LEXORANK" r join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) r2 on r."ISSUE_ID" = r2.issue_id and r."FIELD_ID" = r2.field_id group by r2.issue_id, r2.field_id) returning *
Verify if no more duplicates are found :
select ( p.pkey || '-' || i.issuenum ) as "issuekey" , t.count as "number_of_duplicates", t.field_id, cf.cfname as "customfield_name" from jiraissue i join project p on i.project = p.id join (select "FIELD_ID" as "field_id", "ISSUE_ID" as "issue_id", count(*) from "AO_60DB71_LEXORANK" group by "FIELD_ID", "ISSUE_ID" having count(*) > 1) t on t.issue_id = i.id join customfield cf on cf.id = t.field_id;
Last modified on Jul 20, 2022
Powered by Confluence and Scroll Viewport.