java.lang.IllegalArgumentException: duplicate key: likedBy

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {{FlatteningCommentPropertyProvider}} does not deduplicate the comments when 'flattening' the {{CommentPropertyContext}}. As a result, descendants of that SPI class can provide properties for the same comments multiple times which creates {{IllegalArgumentException: duplicate key}} when the properties are added to the comment. For example: {noformat} java.lang.IllegalArgumentException: duplicate key: likedBy at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231) ~[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.property.PropertyMap$Builder.build(PropertyMap.java:160) ~[stash-api-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.content.AbstractProviderContext.getPropertiesFor(AbstractProviderContext.java:56) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:163) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:152) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:143) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451) ~[guava-11.0.2-atlassian-02.jar:na] at java.util.AbstractList$Itr.next(AbstractList.java:358) ~[na:1.8.0_31] at java.util.AbstractCollection.toArray(AbstractCollection.java:141) ~[na:1.8.0_31] at com.google.common.collect.ImmutableList.copyFromCollection(ImmutableList.java:290) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:247) ~[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor.processAll(PluginCommentPostProcessor.java:79) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CompositeCommentPostProcessor.processAll(CompositeCommentPostProcessor.java:45) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CommentPullRequestActivityEnricher.enrich(CommentPullRequestActivityEnricher.java:96) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1207) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1200) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.searchActivities(DefaultPullRequestService.java:791) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] {noformat}
    via by Pierre-Etienne Poirot [Atlassian],
  • {{FlatteningCommentPropertyProvider}} does not deduplicate the comments when 'flattening' the {{CommentPropertyContext}}. As a result, descendants of that SPI class can provide properties for the same comments multiple times which creates {{IllegalArgumentException: duplicate key}} when the properties are added to the comment. For example: {noformat} java.lang.IllegalArgumentException: duplicate key: likedBy at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231) ~[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.property.PropertyMap$Builder.build(PropertyMap.java:160) ~[stash-api-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.content.AbstractProviderContext.getPropertiesFor(AbstractProviderContext.java:56) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:163) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:152) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:143) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451) ~[guava-11.0.2-atlassian-02.jar:na] at java.util.AbstractList$Itr.next(AbstractList.java:358) ~[na:1.8.0_31] at java.util.AbstractCollection.toArray(AbstractCollection.java:141) ~[na:1.8.0_31] at com.google.common.collect.ImmutableList.copyFromCollection(ImmutableList.java:290) ~[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:247) ~[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor.processAll(PluginCommentPostProcessor.java:79) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CompositeCommentPostProcessor.processAll(CompositeCommentPostProcessor.java:45) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CommentPullRequestActivityEnricher.enrich(CommentPullRequestActivityEnricher.java:96) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1207) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1200) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.searchActivities(DefaultPullRequestService.java:791) ~[stash-service-impl-3.7.0-SNAPSHOT.jar:na] {noformat}
    via by Pierre-Etienne Poirot [Atlassian],
  • Use AssetBundle on /
    via GitHub by jamesward
    ,
  • GitHub comment 29#3911949
    via GitHub by tinkerware
    ,
  • h3. Summary When searching for a specific keyword an error page appears with this message: {code} Oops - an error has occurred Cause java.lang.IllegalArgumentException: duplicate key: com.atlassian.confluence.search.v2.ProjectedSearchResult@87d75330 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) {code} If you run a content index, you will also see the index hang at 99%. h3. Environment * Confluence 6.0.0-OD-2015.50.1-0003 h3. Steps to Reproduce # Search for keyword in the Confluence search bar at the top navigation panel or through advanced search. *OR* # Run a content index of the Confluence instance. h3. Expected Results # The search populates the results of the keyword search. *OR* # The content index completes to 100%. h3. Actual Results # You see the following appear on the search page: {code} Oops - an error has occurred Stack Trace:[hide] java.lang.IllegalArgumentException: duplicate key: com.atlassian.confluence.search.v2.ProjectedSearchResult@87d75330 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72) at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231) at com.atlassian.confluence.plugins.cql.impl.factory.SearchResultsFactory.buildFrom(SearchResultsFactory.java:166) at com.atlassian.confluence.plugins.cql.impl.DefaultCQLSearchService.search(DefaultCQLSearchService.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy844.search(Unknown Source) {code} *OR* 2. The index hangs at 99% and the below exception is thrown in the confluence log file: {code} 2015-12-10 11:51:11,898 ERROR [Indexer: 1] [atlassian.bonnie.search.BaseDocumentBuilder] lambda$extractWithLuceneExtractors$120 Error extracting search fields from page: PAGE NAME HERE (25329733) using BackwardsCompatibleExtractor wrapping com.atlassian.confluence.search.lucene.LabelExtractor@13003f0 (confluence.extractors.core:labelExtractor): Failed to lazily initialize a collection {code} h3.Workaround A [Rebuild the content indexes from scratch|https://confluence.atlassian.com/display/CONFKB/How+to+rebuild+the+content+indexes+from+scratch] in some cases fixes the problem.
    via by Rachel Fuerst [Atlassian],
  • h3. Summary When searching for a specific keyword an error page appears with this message: {code} Oops - an error has occurred Cause java.lang.IllegalArgumentException: duplicate key: com.atlassian.confluence.search.v2.ProjectedSearchResult@87d75330 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) {code} If you run a content index, you will also see the index hang at 99%. h3. Environment * Confluence 6.0.0-OD-2015.50.1-0003 h3. Steps to Reproduce # Search for keyword in the Confluence search bar at the top navigation panel or through advanced search. *OR* # Run a content index of the Confluence instance. h3. Expected Results # The search populates the results of the keyword search. *OR* # The content index completes to 100%. h3. Actual Results # You see the following appear on the search page: {code} Oops - an error has occurred Stack Trace:[hide] java.lang.IllegalArgumentException: duplicate key: com.atlassian.confluence.search.v2.ProjectedSearchResult@87d75330 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115) at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72) at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231) at com.atlassian.confluence.plugins.cql.impl.factory.SearchResultsFactory.buildFrom(SearchResultsFactory.java:166) at com.atlassian.confluence.plugins.cql.impl.DefaultCQLSearchService.search(DefaultCQLSearchService.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy844.search(Unknown Source) {code} *OR* 2. The index hangs at 99% and the below exception is thrown in the confluence log file: {code} 2015-12-10 11:51:11,898 ERROR [Indexer: 1] [atlassian.bonnie.search.BaseDocumentBuilder] lambda$extractWithLuceneExtractors$120 Error extracting search fields from page: PAGE NAME HERE (25329733) using BackwardsCompatibleExtractor wrapping com.atlassian.confluence.search.lucene.LabelExtractor@13003f0 (confluence.extractors.core:labelExtractor): Failed to lazily initialize a collection {code} h3.Workaround A [Rebuild the content indexes from scratch|https://confluence.atlassian.com/display/CONFKB/How+to+rebuild+the+content+indexes+from+scratch] in some cases fixes the problem.
    via by Rachel Fuerst [Atlassian],
  • Server crash
    via GitHub by niklon
    ,
    • java.lang.IllegalArgumentException: duplicate key: likedBy at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115)[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72)[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245)[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231)[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.property.PropertyMap$Builder.build(PropertyMap.java:160)[stash-api-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.content.AbstractProviderContext.getPropertiesFor(AbstractProviderContext.java:56)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:163)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:152)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor$Enricher.apply(PluginCommentPostProcessor.java:143)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451)[guava-11.0.2-atlassian-02.jar:na] at java.util.AbstractList$Itr.next(AbstractList.java:358)[na:1.8.0_31] at java.util.AbstractCollection.toArray(AbstractCollection.java:141)[na:1.8.0_31] at com.google.common.collect.ImmutableList.copyFromCollection(ImmutableList.java:290)[guava-11.0.2-atlassian-02.jar:na] at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:247)[guava-11.0.2-atlassian-02.jar:na] at com.atlassian.stash.internal.comment.PluginCommentPostProcessor.processAll(PluginCommentPostProcessor.java:79)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CompositeCommentPostProcessor.processAll(CompositeCommentPostProcessor.java:45)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.comment.CommentPullRequestActivityEnricher.enrich(CommentPullRequestActivityEnricher.java:96)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1207)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.enrichActivities(DefaultPullRequestService.java:1200)[stash-service-impl-3.7.0-SNAPSHOT.jar:na] at com.atlassian.stash.internal.pull.DefaultPullRequestService.searchActivities(DefaultPullRequestService.java:791)[stash-service-impl-3.7.0-SNAPSHOT.jar:na]

    Users with the same issue

    arturgajowy
    arturgajowy1 times, last one,
    Unknown visitor1 times, last one,
    Михайло Тітов
    Михайло Тітов1 times, last one,
    Luka
    Luka1 times, last one,
    batwalrus76
    batwalrus763 times, last one,
    32 more bugmates