Too many spaces marked as Favourite can prevent exporting Space Analytics to Excel

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 7.13.8
    • Component/s: Core - Analytics
    • None
    • 5
    • Severity 3 - Minor
    • 0

      Issue Summary

      Exporting Space Analytic data to Excel can error out if a large number of spaces are marked as a Favourite by a large number of end users. A similar, yet much less likely, issue can occur if the character length of all Categories specified for spaces exceeds the Excel cell limit size of 32767.

      Within Confluence, Space Categories and Spaces marked as a Favourite by an end user are manifested as labels.  And labels involve a notion around scoping - that is, who can see and use a given label.

      For example, we most commonly use labels that are available throughout any context within Confluence - for these kinds of labels, they have a 'global' or 'team' value within the namespace column of the LABEL table. Included with these are Categories values that can be assigned to individual spaces and are considered to have 'team' scope.

      Additionally, there are also labels with much smaller personal scope that are only applicable to the creator or owner of the label. An example of this would be when a user tags a space as being a Favourite. Within, the Confluence database, these kinds of labels would have a namespace value of 'my' within the LABEL table.

      When outputting Space data from the site wide Analytics screen to Excel, Confluence includes label scoped at a personal 'my' level within the overall report and not just 'team' scoped labels. If the total length of characters for all of these labels exceeds the Excel cell limit size of 32767, then the Excel file generation will fail.

      Since the Analytics UI does not render space category/favourite data, it still renders fine. Likewise, if you view Analytics data either through the UI or Excel for a given individual space.

      This is reproducible on Data Center: Yes

      Steps to Reproduce

      1. Have many users mark a large number of spaces as Favourite.
      2. Click on Analytics from the main menu.
      3. Click on the Spaces tab.
      4. Click on ***** > Export Excel

      Expected Results

      An Excel report is created.

      Actual Results

      The Confluence UI displays the following message:

      "Something didn't work on the server, Try again or contact your administrator if this keeps happening"

      Within the Confluence application logs, a message like the following will be recorded:

      2023-01-30 17:20:42,479 ERROR [http-nio-27138-exec-8] [rest.util.excel.ExcelGenerationException] toResponse com.addonengine.addons.analytics.rest.util.excel.ExcelGenerationException: java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32767 characters
       -- referer: http://localhost:27138/c7138/plugins/confanalytics/analytics.action | url: /c7138/rest/confanalytics/1.0/instance/activityBySpace.xlsx | traceId: 3197a14a515416bd | userName: charlie
      com.addonengine.addons.analytics.rest.util.excel.ExcelGenerationException: java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32767 characters
      	at com.addonengine.addons.analytics.rest.util.excel.ExcelReportUtilsKt.buildExcelReportAndResponse(ExcelReportUtils.kt:21)
      	at com.addonengine.addons.analytics.rest.InstanceAnalyticsResource.getActivityBySpaceXlsx(InstanceAnalyticsResource.kt:144)
      

      Additional Diagnostics

      To get a handle around the scope of the issue, execute the following queries against the Confluence database:

      select count(*) from content_label where labelid in (select labelid from label where name = 'favourite' and namespace='my');
      

      Workaround

      A couple of options could be considered though none are optimal:

      1. First, for a given space that has a high volume of being tagged as a Favourite, temporarily mark that/those spaces as Archived, produce the report and then set the spaces back to Current.
        1. Click on Space Tools > Overview > Space Details > Edit Space Details
        2. Update the Status field.
      2. Another option would be to run the following queries to delete favourite labels that were set for all spaces by all end users:
        delete from content_label where labelid in (select labelid from label where name = 'favourite' and namespace='my');
         
        delete from label where name = 'favourite' and namespace='my';
        

        The obvious downside of this approach is that spaces will no longer appear as favourite to end users.

              Assignee:
              Unassigned
              Reporter:
              Steve Shaw
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: