java.lang.RuntimeException: Could not find suitable distance for rank.
Asked by Sue Webber:

Has anyone had this error when trying to create a Portfolio plan ?


Answers:
author: Fazila Ashraf
body: Hi [@Sue Webber](/t5/user/viewprofilepage/user-id/3763114)

Would recommend you to check on the lexorank - <https://confluence.atlassian.com/jirakb/understand-the-lexorank-managment-page-in-jira-server-779159218.html>

comments: author: Sue Webber
body: Thanks Fazila.


author: Sue Webber
body: The linked documentation is not very helpful.

I am still battling with this. Attached is view of the log and the errors we get when trying to open Roadmaps

```
2021-01-18 18:58:02,547 lexorank-executor-thread-0 INFO      [service.lexorank.balance.LexoRankBalancer] Balancing 1 fields2021-01-18 18:58:02,553 lexorank-executor-thread-0 INFO      [service.lexorank.balance.LexoRankBalancerProgressLogger] Balancing rank field with id[-859340285902835] - 1 out of 4 rows (25%) complete.2021-01-18 18:58:12,559 lexorank-executor-thread-0 INFO      [service.lexorank.balance.LexoRankBalancer] Balancing of 1 fields completed with 1 errors2021-01-18 18:58:12,559 LexoRankReindexer:thread-1 ERROR      [service.lexorank.balance.LexoRankBalancer] Indexing for LexoRank re-balancing was interrupted.2021-01-18 18:58:12,560 lexorank-executor-thread-0 WARN      [service.lexorank.balance.LexoRankScheduledBalanceHandler] Balance for fieldId=-859340285902835 returned errors: Errors: -859340285902835Error Messages: [Jira Software cannot execute the rank operation at this time. Other users may be ranking the issues that you are trying to rank. Please try again later.]2021-01-18 18:58:39,933 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] MarkerRowsPresentCheck { "minMs": 199, "avgMs": 283, "maxMs": 527, "cnt": 5, "currMs": 253 }2021-01-18 18:58:39,933 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 11% complete.2021-01-18 18:58:40,185 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] MarkerRowsCorrectCheck { "minMs": 200, "avgMs": 226, "maxMs": 258, "cnt": 5, "currMs": 252 }2021-01-18 18:58:40,185 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 22% complete.2021-01-18 18:58:40,425 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] MarkerRowsBucketCheck { "minMs": 197, "avgMs": 218, "maxMs": 243, "cnt": 5, "currMs": 240 }2021-01-18 18:58:40,425 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 33% complete.2021-01-18 18:58:40,679 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] RankOutOfBoundaryCheck { "minMs": 254, "avgMs": 411, "maxMs": 586, "cnt": 5, "currMs": 254 }2021-01-18 18:58:40,680 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 44% complete.2021-01-18 18:58:40,682 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 56% complete.2021-01-18 18:58:41,023 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] IssueRowsBucketCheck { "minMs": 283, "avgMs": 311, "maxMs": 352, "cnt": 5, "currMs": 341 }2021-01-18 18:58:41,024 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 67% complete.2021-01-18 18:58:41,265 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] BalanceEntryCheck { "minMs": 191, "avgMs": 222, "maxMs": 246, "cnt": 5, "currMs": 241 }2021-01-18 18:58:41,265 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 78% complete.2021-01-18 18:58:41,358 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 89% complete.2021-01-18 18:58:42,155 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [com.atlassian.greenhopper.performance] DuplicateRanksCheck { "minMs": 441, "avgMs": 595, "maxMs": 810, "cnt": 5, "currMs": 796 }2021-01-18 18:58:42,155 http-nio-8080-exec-39 INFO suwebber1 1138x63232x1 4419mh 196.30.243.148,10.25.17.3 /rest/greenhopper/1.0/lexorank/integrity [service.lexorank.integrity.LexoRankIntegrityCheckerImpl] Checking LexoRank integrity for rank field [id=10000, name=Rank] 100% complete.
```


author: Sue Webber
body: ```
Caused by: java.lang.RuntimeException: Could not find suitable distance for rank. at com.atlassian.greenhopper.model.lexorank.LexoRank.findSpacing(LexoRank.java:217) at com.atlassian.greenhopper.model.lexorank.LexoRank.between(LexoRank.java:185) at com.atlassian.greenhopper.model.lexorank.LexoRank.between(LexoRank.java:146) at com.atlassian.greenhopper.model.lexorank.LexoRank.genNext(LexoRank.java:108) at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.rankInitially(LexoRankOperation.java:216) 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.service.rank.JpoRankOperationPreparer.prepareRankOperation(JpoRankOperationPreparer.java:62) at com.atlassian.greenhopper.service.rank.RecursiveRankOperations.rankLast(RecursiveRankOperations.java:93) at com.atlassian.greenhopper.service.rank.JpoRankServiceImpl.rankLast(JpoRankServiceImpl.java:63) at com.atlassian.rm.common.bridges.agile.InternalAgileRankService$2.perform(InternalAgileRankService.java:82) at com.atlassian.rm.common.bridges.agile.InternalAgileRankService$2.perform(InternalAgileRankService.java:77) at com.atlassian.rm.common.bridges.api.plugins.access.DefaultUnsafeBundleServiceAccessor.perform(DefaultUnsafeBundleServiceAccessor.java:65) at com.atlassian.rm.common.bridges.agile.InternalAgileRankService.rankLast(InternalAgileRankService.java:75) at com.atlassian.rm.common.bridges.agile.BaseAgileRankServiceBridgeJpo.rankLast(BaseAgileRankServiceBridgeJpo.java:38) at com.atlassian.rm.common.bridges.agile.AgileVersionDomainRankServiceBridgeJpo.rankLast(AgileVersionDomainRankServiceBridgeJpo.java:9) at com.atlassian.rm.jpo.env.rank.BaseJiraEnvironmentRankService.rankLast(BaseJiraEnvironmentRankService.java:53)

```


author: Fazila Ashraf
body: Hi [@Sue Webber](/t5/user/viewprofilepage/user-id/3763114)

So running the integrity checks on the lexorank management page did not help?

The errors are highlighting the lexoranking.. Please contact Atlassian support with the logs.. they would be able to analyze more and recommend a fix


Tags: advanced-roadmaps

server