java.lang.IllegalArgumentException: Multiple entries with same key: repositoryId=1 and repositoryId=1

Atlassian JIRA | Juan Palacios [Atlassian] | 6 months ago
  1. 0

    Reproduced on {{4.6.2}} tag commit. If a PR comment reply is edited, and {{DefaultPullRequestService#searchActivities}} is called without filtering the activities, an exception is thrown when attempting to enrich them: {code} 2016-06-06 15:23:30,755 ERROR [http-nio-7990-exec-8] @1OKPYXRx923x153x0 1k4rz0u 0:0:0:0:0:0:0:1 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/bitbucket/plugins/servlet/notification/debug/projects/STASH/repos/stash/pull-requests/1] java.lang.IllegalArgumentException: Multiple entries with same key: repositoryId=1 and repositoryId=1 at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) ~[guava-18.0.jar:na] at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) ~[guava-18.0.jar:na] at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) ~[guava-18.0.jar:na] at com.atlassian.bitbucket.property.PropertyMap$Builder.build(PropertyMap.java:161) ~[bitbucket-api-4.6.2.jar:na] at com.atlassian.stash.internal.content.AbstractProviderContext.getPropertiesFor(AbstractProviderContext.java:35) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:135) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:127) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:118) ~[bitbucket-service-impl-4.6.2.jar:na] at com.google.common.collect.Iterators$8.transform(Iterators.java:799) ~[guava-18.0.jar:na] at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:317) ~[guava-18.0.jar:na] at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:300) ~[guava-18.0.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor.processAll(PluginCommentPostProcessor.java:70) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.pull.comment.CompositeCommentPostProcessor.processAll(CompositeCommentPostProcessor.java:51) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.pull.comment.CommentPullRequestActivityEnricher.enrich(CommentPullRequestActivityEnricher.java:93) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1186) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1179) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.searchActivities(DefaultPullRequestService.java:762) ~[bitbucket-service-impl-4.6.2.jar:na] at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.1.8.jar:na] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na] at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na] at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na] at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na] at com.atlassian.stash.internal.notification.web.NotificationRendererDebugServlet.getPullRequestActivities(NotificationRendererDebugServlet.java:120) ~[na:na] at com.atlassian.stash.internal.notification.web.NotificationRendererDebugServlet.doGet(NotificationRendererDebugServlet.java:85) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) ~[na:na] at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:181) ~[sitemesh-2.5-atlassian-11.jar:na] at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:85) ~[sitemesh-2.5-atlassian-11.jar:na] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) ~[na: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) ~[na: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) ~[na:na] at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) ~[na:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) ~[na:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) ~[na: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:86) ~[bitbucket-service-impl-4.6.2.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_45] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45] ... 283 frames trimmed {code} This happens because the same comment activity is enriched twice. Three activity items are retrieved: * Root comment added (Comment X) * Reply added (Comment Y) * Reply edited (Comment Y) The comments are added to a {{Set}} in {{CommentPullRequestActivityEnricher#enrich}} which filters it out to root comment (X) and reply (Y). However the enriching logic creates a {{CommentChain}} which implements {{DepthFirstIterator}}. This iterator will iterate through all the comments and their replies in reverse order, meaning: reply comment Y (no replies), root comment X -> reply comment Y.

    Atlassian JIRA | 6 months ago | Juan Palacios [Atlassian]
    java.lang.IllegalArgumentException: Multiple entries with same key: repositoryId=1 and repositoryId=1
  2. 0

    creating QBean projection with identical Path names

    GitHub | 2 years ago | fe2s
    java.lang.IllegalArgumentException: Multiple entries with same key: name=team.leader.name and name=team.name
  3. 0

    Exception during planning with duplicate columns in order by clause

    GitHub | 2 years ago | martint
    java.lang.IllegalArgumentException: Multiple entries with same key: x_2=ASC_NULLS_LAST and x_2=ASC_NULLS_LAST
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When loading word embeddings via thrift: close words (for and four) were modified to one word (for and for)?! and resulting in an error

    GitHub | 2 years ago | c0der1337
    java.lang.IllegalArgumentException: Multiple entries with same key: for=[D@1813ed0e and for=[D@44303e7b
  6. 0

    ImmutableMap builder does not allow put(existing key) to replace

    GitHub | 2 years ago | zml2008
    com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Multiple entries with same key: []=DataEntry{permissions=null, options={prefix=nethermember}, parents=null, defaultValue=0} and []=DataEntry{permissions={essentials.help=0, mcmmo.commands.defaults=0, essentials.recipe=0, chestcommands.open.server-info.yml=0, craftbook.mech.elevator=0, craftbook.mech.gate.restock=0, essentials.tpdeny=0, buttonwarp.use=0, essentials.mail=0, echopet.pet.remove=0, essentials.getpos=0, essentials.news=0, bukkit.command.plugins=0, craftbook.mech.bridge.restock=0, echopet.pet=0, essentials.sethome=0, chestcommands.open.commands.yml=0, lottery.buy=0, serversigns.use=0, mcmmo.skills.all=0, essentials.afk=0, craftbook.mech.gate.use=0, echopet.pet.hide=0, essentials.balance.others=0, essentials.helpop=0, essentials.msg.url=0, chestcommands.open.arenas.yml=0, craftbook.mech.bookshelf.use=0, mcdocs.command.motd=0, essentials.list=0, essentials.balancetop=0, essentials.afk.auto=0, essentials.seen.banreason=0, ChestShop.shop.sell=0, mcmmo.mobhealthdisplay=0, craftbook.mech.elevator.use=0, mcmmo.commands.party.all=0, test.perm=0, echopet.pet.call=0, lwc.protect=0, buttonwarp.warp.spawn=0, essentials.msg=0, echopet.pet.menu=0, craftbook.mech.paintingswitch.use=0, craftbook.mech.door.use=0, ChestShop.shop.buy=0, essentials.warp=0, automessage.receive.default=0, essentials.balance=0, chestcommands.open.warps.yml=0, essentials.seen=0, essentials.motd=0, essentials.spawn=0, essentials.signs.color=0, bukkit.command.help=0, essentials.pay=0, essentials.delhome=0, echopet.pet.show=0, essentials.build=0, chestcommands.item.main-menu.yml=0, essentials.mail.send=0, bukkit.command.version=0, essentials.home=0, pvparena.user=0, echopet.pet.info=0, craftbook.mech.door.restock=0, essentials.realname=0, essentials.vanish.interact=0, mcmmo.commands.ptp.all=0, essentials.compass=0, essentials.home.bed=0, essentials.tpaccept=0, essentials.warp.list=0, essentials.ping=0, essentials.depth=0, chestcommands.open.main-menu.yml=0, craftbook.mech.bridge.use=0, echopet.pet.list=0, test.perm2=0}, options={prefix=&e, suffix=failure, rank-ladder=Member, rank=5}, parents=null, defaultValue=0}

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Multiple entries with same key: repositoryId=1 and repositoryId=1

      at com.google.common.collect.ImmutableMap.checkNoConflict()
    2. Guava
      ImmutableMap$Builder.build
      1. com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)[guava-18.0.jar:na]
      2. com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)[guava-18.0.jar:na]
      3. com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70)[guava-18.0.jar:na]
      4. com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)[guava-18.0.jar:na]
      4 frames
    3. com.atlassian.bitbucket
      PropertyMap$Builder.build
      1. com.atlassian.bitbucket.property.PropertyMap$Builder.build(PropertyMap.java:161)[bitbucket-api-4.6.2.jar:na]
      1 frame
    4. com.atlassian.stash
      PluginCommentPostProcessor$Enricher.apply
      1. com.atlassian.stash.internal.content.AbstractProviderContext.getPropertiesFor(AbstractProviderContext.java:35)[bitbucket-service-impl-4.6.2.jar:na]
      2. com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:135)[bitbucket-service-impl-4.6.2.jar:na]
      3. com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:127)[bitbucket-service-impl-4.6.2.jar:na]
      4. com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:118)[bitbucket-service-impl-4.6.2.jar:na]
      4 frames
    5. Guava
      ImmutableSet.copyOf
      1. com.google.common.collect.Iterators$8.transform(Iterators.java:799)[guava-18.0.jar:na]
      2. com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)[guava-18.0.jar:na]
      3. com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:317)[guava-18.0.jar:na]
      4. com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:300)[guava-18.0.jar:na]
      4 frames
    6. com.atlassian.stash
      DefaultPullRequestService.searchActivities
      1. com.atlassian.stash.internal.comment.PluginCommentPostProcessor.processAll(PluginCommentPostProcessor.java:70)[bitbucket-service-impl-4.6.2.jar:na]
      2. com.atlassian.stash.internal.pull.comment.CompositeCommentPostProcessor.processAll(CompositeCommentPostProcessor.java:51)[bitbucket-service-impl-4.6.2.jar:na]
      3. com.atlassian.stash.internal.pull.comment.CommentPullRequestActivityEnricher.enrich(CommentPullRequestActivityEnricher.java:93)[bitbucket-service-impl-4.6.2.jar:na]
      4. com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1186)[bitbucket-service-impl-4.6.2.jar:na]
      5. com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1179)[bitbucket-service-impl-4.6.2.jar:na]
      6. com.atlassian.stash.internal.pull.DefaultPullRequestService.searchActivities(DefaultPullRequestService.java:762)[bitbucket-service-impl-4.6.2.jar:na]
      6 frames
    7. com.atlassian.plugin
      ContextClassLoaderSettingInvocationHandler.invoke
      1. com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)[atlassian-plugins-core-4.1.8.jar:na]
      1 frame
    8. org.eclipse.gemini
      LocalBundleContextAdvice.invoke
      1. org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)[na:na]
      2. org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)[na:na]
      3. org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)[na:na]
      4. org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)[na:na]
      5. org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)[na:na]
      5 frames
    9. com.atlassian.stash
      NotificationRendererDebugServlet.doGet
      1. com.atlassian.stash.internal.notification.web.NotificationRendererDebugServlet.getPullRequestActivities(NotificationRendererDebugServlet.java:120)[na:na]
      2. com.atlassian.stash.internal.notification.web.NotificationRendererDebugServlet.doGet(NotificationRendererDebugServlet.java:85)[na:na]
      2 frames
    10. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[na:na]
      2. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[na:na]
      3. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[na:na]
      4. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[na:na]
      5. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)[na:na]
      5 frames
    11. Sitemesh
      SiteMeshFilter.doFilter
      1. com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:181)[sitemesh-2.5-atlassian-11.jar:na]
      2. com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:85)[sitemesh-2.5-atlassian-11.jar:na]
      2 frames
    12. com.atlassian.plugin
      ApiScopingFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81)[na:na]
      1 frame
    13. 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
    14. 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
    15. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)[na:na]
      1 frame
    16. 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
    17. com.atlassian.plugin
      ThreeLeggedAuthFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)[na:na]
      1 frame
    18. com.atlassian.jwt
      JwtAuthFilter.doFilter
      1. com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)[na:na]
      1 frame
    19. com.atlassian.analytics
      AbstractHttpFilter.doFilter
      1. com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38)[na:na]
      2. com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)[na:na]
      2 frames
    20. 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:86)[bitbucket-service-impl-4.6.2.jar:na]
      4. com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)[classes/:na]
      4 frames
    21. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_45]
      2. java.lang.Thread.run(Thread.java:745)[na:1.8.0_45]
      2 frames