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

HibernateSystemException: "query did not return a unique result" when performing label/space operations

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.2
    • 2.1.2, 2.1.3
    • None

      This is a symptom of CONF-5254, when duplicate labels exist on the system. An error like this may appear:

      HibernateSystemException: query did not return a unique result: 2

      The following query can be used to identify the offending labels:

      select name, labelid from label group by name, labelid having count(name) > 1

      and any duplicate labels can then be removed from the LABEL table. Relationships in the CONTENT_LABEL table will have to be mapped to the remaining label ID.

            [CONFSERVER-5255] HibernateSystemException: "query did not return a unique result" when performing label/space operations

            HibernateLabelDao now performs the query in such a way that this exception will not be thrown, although this does not of course prevent duplicate labels from existing.

            Andrew Lynch (Inactive) added a comment - HibernateLabelDao now performs the query in such a way that this exception will not be thrown, although this does not of course prevent duplicate labels from existing.

            I have committed a fix in the HibernateLabelDao that will prevent this exception from occuring, by returning the first label (and logging a message). It doesn't, however, fix the problem that there are duplicate labels in the system. We need to write an upgrade or scheduled task to clean up the duplicate labels.

            Jeremy Higgs added a comment - I have committed a fix in the HibernateLabelDao that will prevent this exception from occuring, by returning the first label (and logging a message). It doesn't, however, fix the problem that there are duplicate labels in the system. We need to write an upgrade or scheduled task to clean up the duplicate labels.

              Unassigned Unassigned
              8d92d19feb5e Jeremy Higgs
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: