Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-25236

Slow response and Confluence crashing when you have too many labels

      Steps to reproduce:

      1. Go to Browse > Labels
      2. It will take a long to load, and even timeout.

      Also general slowness and crashing due to long running SQL queries can be a symptom of this problem.

      Workaround

      Our developers have created a patch that can be applied to all versions of Confluence 4.2, up to and including 4.2.4. The issue will be resolved permanently in 4.2.5.

      How to apply the patch
      1. Copy the Label.hbm.xml file attached to this ticket, to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/labels/. Create the folders if they do not exist.
      2. Once this is done, restart your Confluence instance.
      Limitations

      Because of the nature of the patch, once it is applied, labels on attachments will not show up in popular labels, suggested labels and recently updated labels. This will be resolved in 4.2.5 when the permanent fix is released.

      Future-proofing

      Once you upgrade to 4.2.5, this patch must be removed. It may cause issues down the track if it is not.

        1. labels_conf421_cac.png
          162 kB
          HuseinA
        2. Label.hbm.xml
          14 kB
          Steve Lancashire
        3. Detailssummary.png
          69 kB
          Midori

            [CONFSERVER-25236] Slow response and Confluence crashing when you have too many labels

            Hi Christian,

            OnDemand is currently using Confluence 4.2.9, so this fix has been applied. What you're experiencing sounds a little different to this issue though. I'd suggest raising a support request in https://support.atlassian.com, and the OnDemand team can look into it for you.

            -Denise.

            Denise Unterwurzacher [Atlassian] (Inactive) added a comment - Hi Christian, OnDemand is currently using Confluence 4.2.9, so this fix has been applied. What you're experiencing sounds a little different to this issue though. I'd suggest raising a support request in https://support.atlassian.com , and the OnDemand team can look into it for you. -Denise.

            Do you know when this Fix will also be availble in the OnDemand edition, as currently the "Popular Labels" macro there doesn't show labeled attachments?

            CC

            Christian Reichert added a comment - Do you know when this Fix will also be availble in the OnDemand edition, as currently the "Popular Labels" macro there doesn't show labeled attachments? CC

            This is tracked in : CONF-25699 and fixed in 4.2.6

            Unfortunately the existing test for this query was using the size of the results returned, rather than inspecting the result, and due to generics type erasure a List<Object[]> is the same as List<Labelling> until you try to use it.

            Steve Lancashire (Inactive) added a comment - This is tracked in : CONF-25699 and fixed in 4.2.6 Unfortunately the existing test for this query was using the size of the results returned, rather than inspecting the result, and due to generics type erasure a List<Object[]> is the same as List<Labelling> until you try to use it.

            Midori added a comment -

            thanks, Denise. note -> i suggest reopening this issue

            Midori added a comment - thanks, Denise. note -> i suggest reopening this issue

            Hi Ferenc,

            Thanks so much for reporting that! We're going to look into it and will post an update when we have one.

            Kind regards,
            Denise
            Atlassian Support - Sydney

            Denise Unterwurzacher [Atlassian] (Inactive) added a comment - Hi Ferenc, Thanks so much for reporting that! We're going to look into it and will post an update when we have one. Kind regards, Denise Atlassian Support - Sydney

            Midori added a comment - - edited

            i'm sorry to report, but this recent change in Confluence 4.2.5 broke the method LabelManager.getCurrentContentForLabelAndSpace()!!!

            if you retrieve a list using that method, and then start iterating over its items, then:

            java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.atlassian.confluence.labels.Labelling
            	at com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao$10.apply(HibernateLabelDao.java:857)
            	at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451)
            	at java.util.AbstractList$Itr.next(AbstractList.java:345)
                    ...
            

            i found this problem using the Confluence Archiving Plugin, but other plugins using the same API (e.g. the Metadata Plugin) also suffer from this.

            see, for instance the Confluence user documentation at https://confluence.atlassian.com/display/DOC/Detailssummary+Macro, filled with these errors:

            i also searched through the Confluence source code, and it seems Confluence internally does not that method, funnily.

            Midori added a comment - - edited i'm sorry to report, but this recent change in Confluence 4.2.5 broke the method LabelManager.getCurrentContentForLabelAndSpace() !!! if you retrieve a list using that method, and then start iterating over its items, then: java.lang.ClassCastException: [Ljava.lang. Object ; cannot be cast to com.atlassian.confluence.labels.Labelling at com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao$10.apply(HibernateLabelDao.java:857) at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451) at java.util.AbstractList$Itr.next(AbstractList.java:345) ... i found this problem using the Confluence Archiving Plugin, but other plugins using the same API (e.g. the Metadata Plugin) also suffer from this. see, for instance the Confluence user documentation at https://confluence.atlassian.com/display/DOC/Detailssummary+Macro , filled with these errors: i also searched through the Confluence source code, and it seems Confluence internally does not that method, funnily.

            I can also confirm that this workaround works in our test enviroment.

            Patrick Forssell added a comment - I can also confirm that this workaround works in our test enviroment.

            Todays test in test environment went well. I've installed the patch on production a minute ago as well.

            @Atlassian: Please add to upgrade routine for 4.2.5 a dedicated hint to remove this workaround if dedected.

            Daniel Wedewardt added a comment - Todays test in test environment went well. I've installed the patch on production a minute ago as well. @Atlassian: Please add to upgrade routine for 4.2.5 a dedicated hint to remove this workaround if dedected.

            Hi everybody,

            Our developers have created a patch that can be applied to all versions of Confluence 4.2, up to and including 4.2.4 when it is released. The issue will be resolved permanently in 4.2.5.

            How to apply the patch
            1. Copy the Label.hbm.xml file attached to this ticket, to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/labels/Label.hbm.xml.
            2. Once this is done, restart your Confluence instance.
            Limitations

            Because of the nature of the patch, once it is applied, labels on attachments will not show up in popular labels, suggested labels and recently updated labels. This will be resolved in 4.2.5 when the permanent fix is released.

            Future-proofing

            Once you upgrade to 4.2.5, this patch must be removed. It may cause issues down the track if it is not.

            Thanks once again for your patience and understanding here. We appreciate all your input and we thank you for bringing this to our attention! If you have any issues with the patch or any questions about this or any other matter, feel free to raise a support request at http://support.atlassian.com.

            Kind regards,
            Denise
            Atlassian Support - Sydney

            Denise Unterwurzacher [Atlassian] (Inactive) added a comment - Hi everybody, Our developers have created a patch that can be applied to all versions of Confluence 4.2, up to and including 4.2.4 when it is released. The issue will be resolved permanently in 4.2.5. How to apply the patch Copy the Label.hbm.xml file attached to this ticket, to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/labels/Label.hbm.xml . Once this is done, restart your Confluence instance. Limitations Because of the nature of the patch, once it is applied, labels on attachments will not show up in popular labels, suggested labels and recently updated labels. This will be resolved in 4.2.5 when the permanent fix is released. Future-proofing Once you upgrade to 4.2.5, this patch must be removed. It may cause issues down the track if it is not. Thanks once again for your patience and understanding here. We appreciate all your input and we thank you for bringing this to our attention! If you have any issues with the patch or any questions about this or any other matter, feel free to raise a support request at http://support.atlassian.com . Kind regards, Denise Atlassian Support - Sydney

            I've attached a patched Label.hbm.xml, this file reverts a number of queries to their 4.1 versions, as such labels on attachments will not show up in popular labels, suggested labels and
            recently updated labels. These updated queries will be in 4.2.5.

            To reintroduce this functionality for labels on attachments the labels should be indexed and the popular labels, suggested labels and recently updated labels queries should be answered by lucene rather than the database. It's not appropriate to do this work as part of a bug fix release.

            Steve Lancashire (Inactive) added a comment - I've attached a patched Label.hbm.xml, this file reverts a number of queries to their 4.1 versions, as such labels on attachments will not show up in popular labels, suggested labels and recently updated labels. These updated queries will be in 4.2.5. To reintroduce this functionality for labels on attachments the labels should be indexed and the popular labels, suggested labels and recently updated labels queries should be answered by lucene rather than the database. It's not appropriate to do this work as part of a bug fix release.

              slancashire Steve Lancashire (Inactive)
              wzanchet William Zanchet (Inactive)
              Affected customers:
              11 This affects my team
              Watchers:
              28 Start watching this issue

                Created:
                Updated:
                Resolved: