Its possible to insert null labels for pages into the database

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Low
    • None
    • Affects Version/s: 3.0.1, 3.0.2, 4.2.8
    • Component/s: None

      Having null labels in the database throws the exception -

      java.lang.NullPointerException
      at java.lang.String.compareTo(String.java:1168)
      at com.atlassian.confluence.labels.actions.RankedNameComparator.compare(RankedNameComparator.java:13)
      at java.util.TreeMap.put(TreeMap.java:530)
      at java.util.TreeSet.add(TreeSet.java:238)
      at com.atlassian.confluence.labels.DefaultLabelManager.getRankedLabels(DefaultLabelManager.java:463)
      at com.atlassian.confluence.labels.DefaultLabelManager.getMostPopularLabelsWithRanksInSpace(DefaultLabelManager.java:449)
      

      Currently, there is no constraint in the Database which disallows null labels - we should check for nulls.

      One of the known cause of this is due to Checklist Macros plugin's bug CHK-68.

      Workaround

      You can delete the null label from the database by:

      1. Backup your database
      2. Run this query to find the label id of the null label.
        select LABELID from LABEL where NAME is null;
        
      3. Run this query to delete all the null label from the CONTENT_LABEL table. Replace the <LABEL_ID> with the labelid of the null label.
        DELETE FROM CONTENT_LABEL
        WHERE LABELID=<LABEL_ID>
        
      4. Run this query to delete all the null label from the LABEL table.
        DELETE FROM LABEL
        WHERE LABELID=<LABEL_ID>
        
      5. Restart Confluence

            Assignee:
            Steve Haffenden (Inactive)
            Reporter:
            AjayA
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: