Erroe:
'TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
...
at uk.co.corelogic.mosaic.repository.document.dao.DocumentDAOImpl.retrieveDocumentByExternalId'
The issue with accessing the attachment from the step summary screen is due to group steps not supporting external document storage in versions earlier than 21.1.0.0.
When a step with only one subject had attachments and new members were added to the step, transforming it into a group step, the attachments would remain bound to the initial subject.
From 21.1.0.0 when a step with one subject with attachments becomes a group step the attachments are moved from the single subject to the group.
To allow access to all attachments and uploading of additional files, a data fix script can be run to set the MO_DOCUMENT_METADATA.SUBGROUP_ID to MO_WORKFLOW_STEPS.SUBGROUP_ID. This will allow access to the Documents screen for all affected subjects.
When retrieving the attachments for the step summary screen a check is performed and if it is a group step, Mosaic tries to retrieve the document from local storage. This same error can prevent an attachment from opening when you don't have an EDRMS.
Until the upgrade is complete it is advised that subjects are not added to an existing step with an attachment, it should be possible to avoid this issue by starting all steps as a group step, however this would need to be tested.
