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...
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.