Issue
During an attachment upload to repository storage, when an error scenario causes a rollback, the attachment file is not removed from the repository .
Symptoms and Impact
If a database COMMIT fails while writing the attachment from Data-WorkAttach-File to the repository, the same attachment cannot be created in the repository on subsequent attempts, as it already exists in the folder.
After addressing the failure, the following error occurs when reuploading the file:
"The specified file/folder already exists in the target repository. Please specify a different file/folder."
Steps to reproduce
- Enable repository storage for attachments.
- Attach a file to a work object.
- Reproduce/Simulate a repository connectivity issue during the file attachment.
- Address the source of the failure.
- Reupload the file using the same name.
- The system moves the case to Broken Processes with the error:
"The specified file/folder already exists in the target repository. Please specify a different file/folder."
Root Cause
A defect in Pega Code/Rules where the associated Link-Attachment and Data-WorkAttach-File objects in the database are rolled back, but the file on the repository is not rolled back.
Solution
This issue has been identified as a bug and will be fixed in the next available Patch Release.
This known issue document will be updated when a release with the fix is available.
Workaround
An interim workaround is to adjust the file name to allow the upload to proceed.
One way to do this automatically is to append a timestamp to the filename via an override of CallVirusCheck.
For details on the CallVirusCheck extension point see Extension points and supporting Rules for attachments and Performing a virus scan on an attachment.