com.atlassian.bitbucket.NoSuchEntityException: Couldnt find ref: {0}

Atlassian JIRA | Kristy Hughes [Atlassian] | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When the [suggested reviewers plugin|https://bitbucket.org/atlassian/stash-suggest-reviewers] cannot find a ref, it doesn't actually replace the placeholder in the log message with the ref name. Fix the log statement so the correct placeholder is used. {code:java} com.atlassian.bitbucket.NoSuchEntityException: Couldnt find ref: {0} at com.atlassian.bitbucket.server.suggestreviewers.internal.rest.SuggestedReviewersResource.getLatestCommit(SuggestedReviewersResource.java:114) ~[bitbucket-suggest-reviewers-3.0.0.jar:na] at com.atlassian.bitbucket.server.suggestreviewers.internal.rest.SuggestedReviewersResource.forRefs(SuggestedReviewersResource.java:76) ~[bitbucket-suggest-reviewers-3.0.0.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1468996546000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1468996546000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1468996546000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1468996546000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1468996546000.jar:na] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [classes/:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) [atlassian-trusted-apps-core-4.2.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) [atlassian-oauth-service-provider-plugin-2.0.3_1468996546000.jar:na] at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21) [atlassian-core-4.6.19.jar:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.19.jar:na] at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na] at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) [jwt-plugin-1.5.11-0002_1468996546000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) [analytics-client-5.2.7_1468996546000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.7_1468996546000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [classes/:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [classes/:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:83) ~[bitbucket-service-impl-4.8.1.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) ~[classes/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91] ... 229 frames trimmed {code} Caused by {{SuggestedReviewersResource.java}}: {code:java} private Commit getLatestCommit(Repository repository, String refName) { Ref ref = refService.resolveRef(repository, refName); if (ref == null) { throw new NoSuchEntityException(i18nService.getKeyedText("no.such.ref", "Couldn't find ref: {0}", refName)); } return commitService.getCommit(new CommitRequest.Builder(repository, ref.getLatestCommit()).build()); } {code}

    Atlassian JIRA | 9 months ago | Kristy Hughes [Atlassian]
    com.atlassian.bitbucket.NoSuchEntityException: Couldnt find ref: {0}

    Root Cause Analysis

    1. com.atlassian.bitbucket.NoSuchEntityException

      Couldnt find ref: {0}

      at com.atlassian.bitbucket.server.suggestreviewers.internal.rest.SuggestedReviewersResource.getLatestCommit()
    2. com.atlassian.bitbucket
      SuggestedReviewersResource.forRefs
      1. com.atlassian.bitbucket.server.suggestreviewers.internal.rest.SuggestedReviewersResource.getLatestCommit(SuggestedReviewersResource.java:114)[bitbucket-suggest-reviewers-3.0.0.jar:na]
      2. com.atlassian.bitbucket.server.suggestreviewers.internal.rest.SuggestedReviewersResource.forRefs(SuggestedReviewersResource.java:76)[bitbucket-suggest-reviewers-3.0.0.jar:na]
      2 frames
    3. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1468996546000.jar:na]
      2. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1468996546000.jar:na]
      3. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1468996546000.jar:na]
      4. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1468996546000.jar:na]
      5. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[applinks-plugin-5.2.2_1468996546000.jar:na]
      5 frames
    4. com.atlassian.plugin
      ApiScopingFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81)[atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
      1 frame
    5. com.atlassian.stash
      BeforeLoginPluginAuthenticationFilter.doFilter
      1. com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109)[classes/:na]
      3. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)[classes/:na]
      3 frames
    6. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)[atlassian-trusted-apps-core-4.2.0.jar:na]
      1 frame
    7. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)[atlassian-oauth-service-provider-plugin-2.0.3_1468996546000.jar:na]
      1 frame
    8. com.atlassian.core
      AbstractHttpFilter.doFilter
      1. com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21)[atlassian-core-4.6.19.jar:na]
      2. com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)[atlassian-core-4.6.19.jar:na]
      2 frames
    9. com.atlassian.plugin
      ThreeLeggedAuthFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)[atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
      1 frame
    10. com.atlassian.jwt
      JwtAuthFilter.doFilter
      1. com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)[jwt-plugin-1.5.11-0002_1468996546000.jar:na]
      1 frame
    11. com.atlassian.analytics
      AbstractHttpFilter.doFilter
      1. com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38)[analytics-client-5.2.7_1468996546000.jar:na]
      2. com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)[analytics-client-5.2.7_1468996546000.jar:na]
      2 frames
    12. com.atlassian.stash
      ConfigurableWebFilter.doFilter
      1. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87)[classes/:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)[classes/:na]
      3. com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:83)[bitbucket-service-impl-4.8.1.jar:na]
      4. com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)[classes/:na]
      4 frames
    13. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_91]
      2. java.lang.Thread.run(Thread.java:745)[na:1.8.0_91]
      2 frames