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

FindSingleObject Uh oh - found more than one object when single object requested - globaldescription

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      This error appears in the logs when there's two items in the database:

      2008-12-20 18:17:23,697 ERROR [http-8080-Processor4] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [globaldescription:  v.1 (29687809), globaldescription:  v.1 (29687810)]
       -- url: /login.action | userName: anonymous
      

      The workaround is to delete one of the duplicate rows from the Content table, with ContentID being the value in parentheses.

          Form Name

            [CONFSERVER-14040] FindSingleObject Uh oh - found more than one object when single object requested - globaldescription

            Hi All,

            A quick update on this one.

            We've attempted to reproduce this issue with the steps provided by the community and have been unable to do so. Unfortunately the issue here describes a symptom rather than the issue itself, and whilst we know this condition can occur, this doesn't give us anything to actually fix.

            As such we're going to close the issue. If you're able to reliably reproduce this issue, please contact support via https://support.atlassian.com with reproduction steps so we can investigate further.

            Closing the ticket.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hi All, A quick update on this one. We've attempted to reproduce this issue with the steps provided by the community and have been unable to do so. Unfortunately the issue here describes a symptom rather than the issue itself, and whilst we know this condition can occur, this doesn't give us anything to actually fix. As such we're going to close the issue. If you're able to reliably reproduce this issue, please contact support via https://support.atlassian.com with reproduction steps so we can investigate further. Closing the ticket. Thanks, James Ponting Engineering Manager - Confluence Data Center

            We have found a lot of these duplicate attachments and tracked it down to when we have updated from 7.4.8 to 7.4.10. Since then until now (7.13.4 DC) we are experiencing duplicates created each day.

            Please check and resolve.

            Thanks and regards,
            Robert

            I have used this for analyzing further details of the defect in our oracle db.

            select *
              from content c
             where c.contenttype = 'ATTACHMENT'
               and c.content_status = 'current'
               and c.prevver is null
               and exists (select *
                      from content i
                     where c.contentid <> i.contentid
                       and c.contenttype = i.contenttype
                       and c.title = i.title
                       and c.version = i.version
                       and c.creator = i.creator
                       and c.creationdate = i.creationdate
                       and c.lastmodifier = i.lastmodifier
                       and c.lastmoddate = i.lastmoddate
                       and c.content_status = i.content_status
                       and c.spaceid = i.spaceid
                       and c.pageid = i.pageid
                       and c.hibernateversion = i.hibernateversion
                       and c.lowertitle = i.lowertitle)
             order by 1, 2, 3 asc;
            

             

            Robert Hellmann added a comment - We have found a lot of these duplicate attachments and tracked it down to when we have updated from 7.4.8 to 7.4.10. Since then until now (7.13.4 DC) we are experiencing duplicates created each day. Please check and resolve. Thanks and regards, Robert I have used this for analyzing further details of the defect in our oracle db. select * from content c where c .contenttype = 'ATTACHMENT' and c .content_status = ' current ' and c .prevver is null and exists ( select * from content i where c .contentid <> i.contentid and c .contenttype = i.contenttype and c .title = i.title and c .version = i.version and c .creator = i.creator and c .creationdate = i.creationdate and c .lastmodifier = i.lastmodifier and c .lastmoddate = i.lastmoddate and c .content_status = i.content_status and c .spaceid = i.spaceid and c .pageid = i.pageid and c .hibernateversion = i.hibernateversion and c .lowertitle = i.lowertitle) order by 1, 2, 3 asc ;  

            2020-02-06 12:46:20,346 ERROR [http-nio-8090-exec-24] [core.persistence.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [Attachment: Test.png v.1 (101580883) iucroitoru, Attachment: Test.png v.1 (101580889) iucroitoru]
            – url: /pages/viewpage.action | page: 98893901 | traceId: 3199cf98cc14ba4f | userName: iucroitoru | referer: https://uatconfluence.endava.com/pages/viewpage.action?pageId=98893901 | action: viewpage
            2020-02-06 12:46:24,833 ERROR [http-nio-8090-exec-13] [core.persistence.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [Attachment: Test.png v.1 (101580883) iucroitoru, Attachment: Test.png v.1 (101580889) iucroitoru]

            We experience the same issue on 7.2.2 Server

            Serghei Avdonin added a comment - 2020-02-06 12:46:20,346 ERROR [http-nio-8090-exec-24] [core.persistence.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [Attachment: Test.png v.1 (101580883) iucroitoru, Attachment: Test.png v.1 (101580889) iucroitoru] – url: /pages/viewpage.action | page: 98893901 | traceId: 3199cf98cc14ba4f | userName: iucroitoru | referer: https://uatconfluence.endava.com/pages/viewpage.action?pageId=98893901 | action: viewpage 2020-02-06 12:46:24,833 ERROR [http-nio-8090-exec-13] [core.persistence.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested:  [Attachment: Test.png v.1 (101580883) iucroitoru, Attachment: Test.png v.1 (101580889) iucroitoru] We experience the same issue on 7.2.2 Server

            this issue does not even have an assignee!  Quite unacceptable!

            Hans-Peter Geier added a comment - this issue does not even have an assignee!  Quite unacceptable!

            We are facing the same issue on version 6.3.4 for more than 200 pages. That must be fixed soon, especially as this bug is nearly 10 years old !

            Matthias Damsch added a comment - We are facing the same issue on version 6.3.4 for more than 200 pages. That must be fixed soon, especially as this bug is nearly 10 years old !

            Same issue on 5.10.8

            Christoph Lasecki added a comment - Same issue on 5.10.8

            Any update on this?

            Same issue here with Gliffy diagrams

            Jens Kasperek (Bosch GmbH) added a comment - Any update on this? Same issue here with Gliffy diagrams

            Same issue on 5.10.7

            Michal Sladek added a comment - Same issue on 5.10.7

            Same issue on 5.9.6

            Michal Sladek added a comment - Same issue on 5.9.6

            It looks like this can impact notifications as well:

            atlassian-confluence.log.5:2016-08-29 07:50:33,664 ERROR [http-nio-8090-exec-501] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [com.atlassian.confluence.mail.notification.Notification@5bf8439, com.atlassian.confluence.mail.notification.Notification@5bf843a] 
            

            Since they are in memory, there is no way to recover from this situation without loosing emails.

            Boris Berenberg [Uber] added a comment - It looks like this can impact notifications as well: atlassian-confluence.log.5:2016-08-29 07:50:33,664 ERROR [http-nio-8090-exec-501] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [com.atlassian.confluence.mail.notification.Notification@5bf8439, com.atlassian.confluence.mail.notification.Notification@5bf843a]  Since they are in memory, there is no way to recover from this situation without loosing emails.

            An easy way to solve an uh oh error is to delete one the two attachments via the user interface:

            • Search on the attachment name you see in the logs
            • Go to the page containing the attachment
            • Go to the attachments
            • Sort by name and verify the attachment is there twice
            • delete one of them (this should have no impact on your page)

            Of course, you have to to this one by one, so if you have hundreds of double attachments, it may take a while to do this

            Kristof Vandermeersch added a comment - An easy way to solve an uh oh error is to delete one the two attachments via the user interface: Search on the attachment name you see in the logs Go to the page containing the attachment Go to the attachments Sort by name and verify the attachment is there twice delete one of them (this should have no impact on your page) Of course, you have to to this one by one, so if you have hundreds of double attachments, it may take a while to do this

            Steps to reproduce

            1. Upload attachment to page.
            2. Upload attachment to page again
            3. Look to DB
              # select spaceid, pageid, title, version, lastmoddate, content_status from content 
              where contenttype='ATTACHMENT' and title='4AA1-7850ENW-datasheet.pdf' order by lastmoddate;
               spaceid |  pageid   |           title            | version |       lastmoddate       | content_status
              ---------+-----------+----------------------------+---------+-------------------------+----------------
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       1 | 2016-05-18 15:51:02.148 | current
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       2 | 2016-05-18 15:51:29.152 | current
              
            4. Delete attachment in Attachments area
            5. Look to DB - only last version is deleted
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       1 | 2016-05-18 15:51:02.148 | current
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       2 | 2016-05-18 15:51:29.152 | deleted
              
            6. Upload attachment again - uh oh
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       1 | 2016-05-18 15:51:02.148 | current
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       2 | 2016-05-18 15:51:29.152 | deleted
                    38 | 126156803 | 4AA1-7850ENW-datasheet.pdf |       1 | 2016-05-18 15:53:18.876 | current
              

            Jozef Kotlár added a comment - Steps to reproduce Upload attachment to page. Upload attachment to page again Look to DB # select spaceid, pageid, title, version, lastmoddate, content_status from content where contenttype='ATTACHMENT' and title='4AA1-7850ENW-datasheet.pdf' order by lastmoddate; spaceid | pageid | title | version | lastmoddate | content_status ---------+-----------+----------------------------+---------+-------------------------+---------------- 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 1 | 2016-05-18 15:51:02.148 | current 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 2 | 2016-05-18 15:51:29.152 | current Delete attachment in Attachments area Look to DB - only last version is deleted 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 1 | 2016-05-18 15:51:02.148 | current 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 2 | 2016-05-18 15:51:29.152 | deleted Upload attachment again - uh oh 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 1 | 2016-05-18 15:51:02.148 | current 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 2 | 2016-05-18 15:51:29.152 | deleted 38 | 126156803 | 4AA1-7850ENW-datasheet.pdf | 1 | 2016-05-18 15:53:18.876 | current

            same issue for 5.8.x and 5.9.x

            Hans-Peter Geier added a comment - same issue for 5.8.x and 5.9.x

            This issue is now open for 7 years. See: https://jira.atlassian.com/browse/CONF-13480

            Are there any plans to work on this issue?

            Isn't there any workaround to prevent confluence from creating duplicate entries?

            Jens Kasperek (Bosch GmbH) added a comment - This issue is now open for 7 years . See: https://jira.atlassian.com/browse/CONF-13480 Are there any plans to work on this issue? Isn't there any workaround to prevent confluence from creating duplicate entries?

            Same for 5.7.6

            Intel CHD Jira Admin added a comment - Same for 5.7.6

            Same issue on Confluence 5.5.6 and 5.8.6

            Jens Kasperek (Bosch GmbH) (Inactive) added a comment - Same issue on Confluence 5.5.6 and 5.8.6

            Margarita Kolotilova added a comment - - edited

            hi,
            please clarify how to choose the record that should be deleted?
            the error I get:
            [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [globaldescription: v.1 (131074), globaldescription: v.1 (425986)]
            the item with Id = 425986 seems to be newer (just because its id is bigger) but at the same time this item in the database has earlier create and update dates than the item with id = 131074
            so which one should be deleted in this case? is there any criterion I should follow?

            Margarita Kolotilova added a comment - - edited hi, please clarify how to choose the record that should be deleted? the error I get: [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [globaldescription: v.1 (131074), globaldescription: v.1 (425986)] the item with Id = 425986 seems to be newer (just because its id is bigger) but at the same time this item in the database has earlier create and update dates than the item with id = 131074 so which one should be deleted in this case? is there any criterion I should follow?

            So what would one do in the case of many many instances of this error? I'm hearing write a big script.

            Alain Arduain added a comment - So what would one do in the case of many many instances of this error? I'm hearing write a big script.

            I think, If you created the page with older version with duplicate attachments and still you can see this error in latest versions when you view.

            Ishan Liyanage added a comment - I think, If you created the page with older version with duplicate attachments and still you can see this error in latest versions when you view.

            Jon Moser added a comment -

            Hello,

            I realize this is a pretty old ticket but just wanted to let you know that we are seeing this on 5.4.3.

            Thanks!

            Jon Moser added a comment - Hello, I realize this is a pretty old ticket but just wanted to let you know that we are seeing this on 5.4.3. Thanks!

            Jim Clark added a comment -

            Do you know why this is happening? Is the user clicking save multiple times? We're experiencing the same issue, not sure if this just started w/ 2.10.3, which we just upgraded to. It surprises me that multiple versions are allowed for a "piece" of content.

            Thanks,
            Jim

            Jim Clark added a comment - Do you know why this is happening? Is the user clicking save multiple times? We're experiencing the same issue, not sure if this just started w/ 2.10.3, which we just upgraded to. It surprises me that multiple versions are allowed for a "piece" of content. Thanks, Jim

            A similar error can also occur:

            ERROR [http-8080-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object
            when single object requested: [page: Release Notes v.48 (72909739), 
            page: Release Notes v.48 (72909740)]
            

            Here is SQL for Microsoft SQL that will resolve it:

            /* Per CONF-14040 (http://jira.atlassian.com/browse/CONF-14040), this can
               result from multiple content rows.
            */
            
               
            
            // Edit the WHERE clause to list the 2 contentid values listed in the error message (in parentheses),
            // then see which one is the LESS current (This is the one you will be deleting).
            SELECT * 
            FROM CONTENT
            WHERE contentid IN (72909739,72909740)
            
            // Given that ID, run the following SQL:
            // You may want to comment out the DELETE statement and UNcomment out the SELECT
            // statement to 'preview' what you will be deleting.
            DECLARE @id2Delete NUMERIC(19,0)
            SET @id2Delete = 72909739
            
            --SELECT *
            DELETE
            FROM attachmentdata WHERE attachmentid IN 
               (SELECT attachmentid FROM attachments WHERE PAGEID=@id2Delete)
            
            --SELECT *
            DELETE
            FROM attachments WHERE pageid = @id2Delete
            
            --SELECT *
            DELETE
            FROM bodycontent WHERE contentid = @id2Delete
            
            --SELECT *
            DELETE
            FROM content WHERE contentid = @id2Delete
            

            Betsy Walker added a comment - A similar error can also occur: ERROR [http-8080-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [page: Release Notes v.48 (72909739), page: Release Notes v.48 (72909740)] Here is SQL for Microsoft SQL that will resolve it: /* Per CONF-14040 (http: //jira.atlassian.com/browse/CONF-14040), this can result from multiple content rows. */ // Edit the WHERE clause to list the 2 contentid values listed in the error message (in parentheses), // then see which one is the LESS current (This is the one you will be deleting). SELECT * FROM CONTENT WHERE contentid IN (72909739,72909740) // Given that ID, run the following SQL: // You may want to comment out the DELETE statement and UNcomment out the SELECT // statement to 'preview' what you will be deleting. DECLARE @id2Delete NUMERIC(19,0) SET @id2Delete = 72909739 --SELECT * DELETE FROM attachmentdata WHERE attachmentid IN (SELECT attachmentid FROM attachments WHERE PAGEID=@id2Delete) --SELECT * DELETE FROM attachments WHERE pageid = @id2Delete --SELECT * DELETE FROM bodycontent WHERE contentid = @id2Delete --SELECT * DELETE FROM content WHERE contentid = @id2Delete

            We're using filesystem storage for attachments so it wasn't necessary but thanks for pointing it out. That will definitely help others who are having this problem and use database storage for attachment data.

            Colin Kinder added a comment - We're using filesystem storage for attachments so it wasn't necessary but thanks for pointing it out. That will definitely help others who are having this problem and use database storage for attachment data.

            Thanks Colin. I think you'd need to delete the attachmentdata as well, if the attachments are stored on the database. The whole SQL would be:

            1. DELETE FROM ATTACHMENTDATA WHERE ATTACHMENTID IN (SELECT ATTACHMENTID FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses);
            2. DELETE FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses;
            3. DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses;

            Jeremy Largman added a comment - Thanks Colin. I think you'd need to delete the attachmentdata as well, if the attachments are stored on the database. The whole SQL would be: DELETE FROM ATTACHMENTDATA WHERE ATTACHMENTID IN (SELECT ATTACHMENTID FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses); DELETE FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses; DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses;

            Colin Kinder added a comment - - edited

            The workaround here doesn't appear to be as easy as it sounds...

            DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses;
            "Cannot delete or update a parent row: a foreign key constraint fails (`wiki`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`))"

            Any suggestions?

            Edit: Nevermind, answered my own question by deleting the attachment that was associated with that id. So the SQL commands I ran were:
            DELETE FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses;
            DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses;

            I ran these two commands only once for the CONTENTID that had been created with a later date.

            Colin Kinder added a comment - - edited The workaround here doesn't appear to be as easy as it sounds... DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses; "Cannot delete or update a parent row: a foreign key constraint fails (`wiki`.`ATTACHMENTS`, CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`))" Any suggestions? Edit: Nevermind, answered my own question by deleting the attachment that was associated with that id. So the SQL commands I ran were: DELETE FROM ATTACHMENTS WHERE PAGEID=ContentID_from_parentheses; DELETE FROM CONTENT WHERE CONTENTID=ContentID_from_parentheses; I ran these two commands only once for the CONTENTID that had been created with a later date.

              3061d200deff Arpan Agrawal
              jlargman Jeremy Largman
              Affected customers:
              66 This affects my team
              Watchers:
              70 Start watching this issue

                Created:
                Updated:
                Resolved: