Upgraded from 1.8.x.x to 1.10(see attached image for version information)Upgrade went smooth AFAIK but maybe I messed something up?Having trouble with my email templates and/or the database table containing them.This problem arises in at least two known cases - there are probably more.#1. The first case is when replying to a message and the system attempts to email the customer.When posting the reply all that happens is that the screen attempts to refresh but 'hangs'. Manually refreshing will show the reply has been posted to the ticket, however the email is never sent due to a fatal errorPHP error log output: PHP Fatal error: Uncaught exception 'ObjectNotUnique' with message 'One object was expected; however multiple objects in the database matched the query. In fact, there are 2 matching objects.' in /home/omiss/www/support/include/class.orm.phpStack trace:#0 /home/omiss/www/support/include/class.orm.php(545): QuerySet->one()#1 /home/omiss/www/support/include/class.file.php(581): VerySimpleModel:(Array)#2 /home/omiss/www/support/include/class.file.php(586): AttachmentFile:('b56944cb4722cc5...')#3 /home/omiss/www/support/include/class.mailer.php(482): AttachmentFile:('b56944cb4722cc5...')#4 : Mailer->{closure}(Array)#5 /home/omiss/www/support/include/class.mailer.php(491): preg_replace_callback('/cid:({32...', Object(Closure), '<div style="dis...')#6 /home/omiss/www/support/include/class.email.php(178): Mailer->send(Object(TicketOwner), 'Re: test', '<br /><h3><span...', Array)#7 /home/omiss/www/support/include/class.ticket.php(2573): Email->send(Object(TicketOwner) in /home/omiss/www/support/include/class.orm.php on line 1176#2 the second case occurs when trying to edit my email templates.I have five template groups. Each has 12 templates. The attached mage of template group 2 (support) confirms that the templates are in the database because the `Updated` dates are present. Visual inspection of the ost_email_template table shows that all of the templates are there and there are no duplicate `id` or `code_name` entries in any of the `tpl_id` groups.Clicking on any of the templates to edit them results in a refresh and hang as above and another fatal error.PHP error log output: PHP Fatal error: Uncaught exception 'ObjectNotUnique' with message 'One object was expected; however multiple objects in the database matched the query. In fact, there are 2 matching objects.' in /home/omiss/www/support/include/class.orm.phpStack trace:#0 /home/omiss/www/support/include/class.orm.php(545): QuerySet->one()#1 /home/omiss/www/support/include/class.file.php(581): VerySimpleModel:(Array)#2 /home/omiss/www/support/include/class.file.php(586): AttachmentFile:('b56944cb4722cc5...')#3 /home/omiss/www/support/include/class.format.php(462): AttachmentFile:('b56944cb4722cc5...')#4 : Format->{closure}(Array)#5 /home/omiss/www/support/include/class.format.php(466): preg_replace_callback('/"cid:({...', Object(Closure), '<h3><strong>Dea...')#6 /home/omiss/www/support/include/class.template.php(560): Format->viewableImages('<h3><strong>Dea...')#7 /home/omiss/www/support/include/staff/tpl.inc.php(32): EmailTemplate->getBodyWithImages()#8 /home/omiss/www/suppo in /home/omiss/www/support/include/class.orm.php on line 1176Note: The template with `code_name` 'ticket.activity.notice' used or notifying collaborators of new ticket activity did not existing in my previous version. It did not have an entry in the table immediately after the upgrade. I clicked on that entry entry in the template list as part of problem analysis and was able to create a new template - you can see in the list that it was updated yesterday. What is interesting is that I can edit that one new template entry (and only that one) without throwing an error. This leads me to believe that the problem may be within the data in the template and not the table or row. I note that most of my templates, if not all, have embedded images in them.SOLVED. I actually stumbled on the solution to the problem while writing this post so i decided I would submit it anyway in case someone else sees something similar.There were two files in the database with the exact same key!!! One has been there since day one and one was apparently created as part of the upgrade. I used the partial key name that was showing in the PHP error (b56944cb4722cc5...) and searched the file table. Bingo - two files with the same key!! It was the powered-by-osticket.png image. I deleted the newest one.