Ahh, you need to login to the database, go to the ost_thread_entry_email
table, and look for records with duplicate thread_entry_id
values. You need to figure out which one is not needed and delete it.
SELECT
`thread_entry_id`,
COUNT(`thread_entry_id`)
FROM
`ost_thread_entry_email`
GROUP BY `thread_entry_id`
HAVING COUNT(`thread_entry_id`) > 1;
Once you do this you should be able to view the ticket thread. If you run into the same error, repeat the steps until there are no duplicates.
Cheers.