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

Multiple AttachmentData objects were returned when only one was expected

      See https://support.atlassian.com/browse/CSP-7087 for more details and a stack trace.

      I was not able to reproduce it by 'clicking the upload button twice' . Yet somehow there are multiple copies of AttachmentData.
      (reviewed by Sam)

      excerpt from the HibernateAttachmentDataDao.java l.65
      // TODO find a more appropriate exception
      if (dataObjects.size() > 1)
      throw new RuntimeException("Multiple AttachmentData objects were returned when only one was expected");

      Question remains - how possible multiple objects were created in the DB initially? Please investigate...

      The logs for this will say: "findSingleObject Uh oh - found more than one object when single object requested"

            [CONFSERVER-7882] Multiple AttachmentData objects were returned when only one was expected

            Sam Hall added a comment -

            On one occasion on v5.7.5 I was able to reproduce this by rapidly clicking the upload button on a server that was seemingly laggy. But I've not been able to cause this to happen reliably, usually the additional Upload button clicks just cause additional versions of the file, but sometimes it can cause multiple current versions of file with the same name. This suggests to me that a race condition is at play.

            Sam Hall added a comment - On one occasion on v5.7.5 I was able to reproduce this by rapidly clicking the upload button on a server that was seemingly laggy. But I've not been able to cause this to happen reliably, usually the additional Upload button clicks just cause additional versions of the file, but sometimes it can cause multiple current versions of file with the same name. This suggests to me that a race condition is at play.

            I've just seen this error on a Confluence 5.7.

            Jacob Saaby Nielsen added a comment - I've just seen this error on a Confluence 5.7.

            still the same in 5.8.18.
            Atlassian, you should either re-open the ticket or clone it. This is not 'resolved'.

            Hans-Peter Geier added a comment - still the same in 5.8.18. Atlassian, you should either re-open the ticket or clone it. This is not 'resolved'.

            as do we, in 5.8.14. Is there a resolution, if the original error was fixed, to fix the data?

            Paula Manildi added a comment - as do we, in 5.8.14. Is there a resolution, if the original error was fixed, to fix the data?

            Same here on 5.8.10.

            Mary Washburn added a comment - Same here on 5.8.10.

            Same here on 5.9.4

            Kerem Caglar [Solveka] added a comment - Same here on 5.9.4

            Nil Plana added a comment -

            We get this error on 5.9.4

            Nil Plana added a comment - We get this error on 5.9.4

            We get this on 5.8.4

            MEDITECH ADMIN TEAM added a comment - We get this on 5.8.4

            I get this on 5.8.10 too

            Juan Jose del Rio added a comment - I get this on 5.8.10 too

            I just got this on 5.8.10 of Confluence as well.

            Michael Brinson added a comment - I just got this on 5.8.10 of Confluence as well.

            got this on 5.8.10 of Confluence too

            Nelson Jimenez Manio added a comment - got this on 5.8.10 of Confluence too

            intersol_old added a comment -

            Got this on 6.2.3!

            intersol_old added a comment - Got this on 6.2.3!

            Seeing this in 5.1.5

            Martin Sander added a comment - Seeing this in 5.1.5

            We see this on one of our 5.3.1 instances.

            Martin Cleaver added a comment - We see this on one of our 5.3.1 instances.

            Hans-Peter Geier added a comment - - edited

            We see this in 4.3.7, too.

            one was related to an attachment. It was named, so I was able to find it. It existed twice with the same name attached to the same place. For some reason, the upload of the attachment has loaded it twice (which should not happen). I was able to delete one of the duplicates.
            The suggested SQL (farer above in this thread) did not work for me.

            Besides of attachments, the error can also happen upon notifications:

            2013-04-26 10:17:54,153 ERROR [StreamsCompletionService::thread-1346] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [com.atlassian.confluence.mail.notification.Notification@17581f1, com.atlassian.confluence.mail.notification.Notification@17581f2]

            I don't know what throws it

            Hans-Peter Geier added a comment - - edited We see this in 4.3.7, too. one was related to an attachment. It was named, so I was able to find it. It existed twice with the same name attached to the same place. For some reason, the upload of the attachment has loaded it twice (which should not happen). I was able to delete one of the duplicates. The suggested SQL (farer above in this thread) did not work for me. Besides of attachments, the error can also happen upon notifications: 2013-04-26 10:17:54,153 ERROR [StreamsCompletionService::thread-1346] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [com.atlassian.confluence.mail.notification.Notification@17581f1, com.atlassian.confluence.mail.notification.Notification@17581f2] I don't know what throws it

            We see this in 4.3.2. Support referred us to the knowledge base article, but it does not apply for our version.

            Kelli Carlson added a comment - We see this in 4.3.2. Support referred us to the knowledge base article, but it does not apply for our version.

            Odd Vinje added a comment -

            Can confirm this is still an error in Confluence 4.3.3:

            2013-01-10 09:01:20,204 ERROR [http-8090-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [Attachment: AdmBrukerStruktur2.png v.1 (19398895) , Attachment: AdmBrukerStruktur2.png v.1 (19398899) ]
            2013-01-10 09:01:20,214 ERROR [http-8090-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object single object requested: [Attachment: AdmBrukerStruktur2.png v.1 (19398895) , Attachment: AdmBrukerStruktur2.png v.1 (19398899) ]
            
            

            Odd Vinje added a comment - Can confirm this is still an error in Confluence 4.3.3: 2013-01-10 09:01:20,204 ERROR [http-8090-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object when single object requested: [Attachment: AdmBrukerStruktur2.png v.1 (19398895) , Attachment: AdmBrukerStruktur2.png v.1 (19398899) ] 2013-01-10 09:01:20,214 ERROR [http-8090-14] [com.atlassian.hibernate.HibernateObjectDao] findSingleObject Uh oh - found more than one object single object requested: [Attachment: AdmBrukerStruktur2.png v.1 (19398895) , Attachment: AdmBrukerStruktur2.png v.1 (19398899) ]

            jplumhoff That's quite surprising - the fix shipped in 4.1, and we haven't seen any regressions around this in our own testing. Can you please create a support request, so we can dig into why you're still affected?

            Richard Atkins added a comment - jplumhoff That's quite surprising - the fix shipped in 4.1, and we haven't seen any regressions around this in our own testing. Can you please create a support request, so we can dig into why you're still affected?

            I'm running 4.2 and still seeing this error.

            Jason Plumhoff added a comment - I'm running 4.2 and still seeing this error.

            For those not moving to Confluence 4, workaround available here:

            Multiple AttachmentData objects were returned when only one was expected for attachment

            Ryan Goodwin (Inactive) added a comment - For those not moving to Confluence 4, workaround available here: Multiple AttachmentData objects were returned when only one was expected for attachment

            I'm seeing this in Confluence 4.0.3 now.

            Jason Swartz added a comment - I'm seeing this in Confluence 4.0.3 now.

            Kristyn Souder added a comment - - edited

            Still getting this bug in 3.5.4 Any idea when this will be corrected? It is now 4 years and 4 months since this bug (classified as 'Major') was opened....

            Kristyn Souder added a comment - - edited Still getting this bug in 3.5.4 Any idea when this will be corrected? It is now 4 years and 4 months since this bug (classified as 'Major') was opened....

            Garnet R. Chaney added a comment - - edited

            Going on three years for this bug to be open....

            We're getting hit with this on new pages throughout our wiki every couple of weeks.

            We need some utility that can go through our database and proactively deal with the issue, instead of waiting for users to be blocked in their work as they attempt to access wiki pages.....

            Our upgrade to 3.1 is failing during the database update on initial launch. I've just filed a report on this, so it is unknown if it is related to this bug, which I've received two different reports of in the last couple of weeks.

            What I am worried about is that creeping corruption in our database may eventually block an upgrade that tries to do something like adding constraints to the database.... A utility that validates the contents of the database, and applies known fixes to known problems, could be very important to large wikis.

            Garnet R. Chaney added a comment - - edited Going on three years for this bug to be open.... We're getting hit with this on new pages throughout our wiki every couple of weeks. We need some utility that can go through our database and proactively deal with the issue, instead of waiting for users to be blocked in their work as they attempt to access wiki pages..... Our upgrade to 3.1 is failing during the database update on initial launch. I've just filed a report on this, so it is unknown if it is related to this bug, which I've received two different reports of in the last couple of weeks. What I am worried about is that creeping corruption in our database may eventually block an upgrade that tries to do something like adding constraints to the database.... A utility that validates the contents of the database, and applies known fixes to known problems, could be very important to large wikis.

            Don Willis added a comment -

            I suggest we add a unique constraint to the attachmentdata.attachmentid column. That would stop this situation happening in any new instances. It might create another bug, since there's presumably an application logic flaw that attempts to insert two data rows for the one attachment, but this bug should be easier to find once the unique constraint causes an exception to be thrown immediately by the second insertion.

            Don Willis added a comment - I suggest we add a unique constraint to the attachmentdata.attachmentid column. That would stop this situation happening in any new instances. It might create another bug, since there's presumably an application logic flaw that attempts to insert two data rows for the one attachment, but this bug should be easier to find once the unique constraint causes an exception to be thrown immediately by the second insertion.

            Even though this issue has been assigned and waiting in the 2.5.x queue for a while, there was no immediate necessity to fix it (when comparing it to other issues importance). It has been decided to remove the fix version and reschedule it later.

            Per Fragemann [Atlassian] added a comment - Even though this issue has been assigned and waiting in the 2.5.x queue for a while, there was no immediate necessity to fix it (when comparing it to other issues importance). It has been decided to remove the fix version and reschedule it later.

            Please see the most recent post from Christian Hansen on CSP-7087 [16/Feb/07 05:02 AM]
            It seems as a particular ID from the ATTACHMENTS table is not referred in the ATTACHMENTDATA table at all. Instead of that, two copies of the same ID exists there.
            User resolved the problem by changing one of the duplicates to an expected value and problem was solved. However, two copies of the same version of an attachment still remained on a page.

            Ivan Benko [Atlassian] added a comment - Please see the most recent post from Christian Hansen on CSP-7087 [16/Feb/07 05:02 AM] It seems as a particular ID from the ATTACHMENTS table is not referred in the ATTACHMENTDATA table at all. Instead of that, two copies of the same ID exists there. User resolved the problem by changing one of the duplicates to an expected value and problem was solved. However, two copies of the same version of an attachment still remained on a page.

              don.willis@atlassian.com Don Willis
              ivan@atlassian.com Ivan Benko [Atlassian]
              Affected customers:
              12 This affects my team
              Watchers:
              33 Start watching this issue

                Created:
                Updated:
                Resolved: