Forum Discussion

angela's avatar
angela
Catalyst II
21 days ago

VaultRecycleBin - What can go wrong if I just delete the complete folder?

Hi Community,

I´m currently trying to free up some space on our Vault server. 

During this process, I noticed that we have accumulated several very large files in the VaultRecycleBin over the years. The files I checked no longer appear to be referenced in the Innovator database.

What are the risks of deleting the contents of the VaultRecycleBin? My assumption is that deleting everything would not be a good idea. In a few tests, I found that some files in the folder still seem to have active references.

I assume it should be possible to determine which files are still in use and which are no longer needed.

But can anyone explain the purpose of the VaultRecycleBin in more detail? Under what circumstances are files moved to this folder?

I am not using the Force Orphaned Files Delete variable, so I´m wondering whether these files might be the result of interrupted or failed file transfers, or if there are other scenarios that would cause files to end up there.

Any insights or best practices would be greatly appreciated!

Angela

4 Replies

  • Hello Angela,

    I don't know why the files ended up in the VaultRecycleBin. It could potentially be the result of a vault migration, upgrade activity, interrupted file operations, or some cleanup process, but I have not found any documentation that explains exactly under which circumstances Aras moves files there.

    One possible approach would be to extract the IDs of the files contained in the VaultRecycleBin and search the Innovator database for any remaining references to those IDs.

    A modified version of the Find by ID method could be used for this. However, the original method only checks whether the supplied ID matches the id of an Item. It would need to be extended to search all relevant reference columns, including relationship source_id and related_id values, as well as Item properties that reference a File.

    Search an item by id across all item types | Aras

    That should provide a clearer indication of which files are still actively referenced and which ones may truly be orphaned. I would not recommend deleting the entire folder without first validating the results and creating backups of both the database and the vault.

    Good luck

    Michael

    • angela's avatar
      angela
      Catalyst II

      Thanks for your answer and tips!

      Based on your ideas I used PowerShell to generate a list of all file IDs found in the VaultRecycleBin and compared them with the File Items in Aras via SQL. Good news: Not a single one of those files exists as a File Item in Innovator anymore, so I assume it's safe to delete them.

      "I don't know why the files ended up in the VaultRecycleBin. It could potentially be the result of a vault migration, upgrade activity, interrupted file operations, or some cleanup process."

      Well... I´ve literally done ALL of that over the years. 😄

      In 2022, we moved to a new server, including the Vault Server. Back then, I didn´t fully think things through, and some existing folders ended up with incorrect permissions. It´s all well documented in the forum:

      https://community.aras.com/discussions/getting-started/multiple-errors-dophysicalfiles---access-to-the-path-is-denied--when-deleting-fi/10101

      I  assume many of my files in the VaultRecycleBin came from that era of my glorous repairs. 

      I think the VaultRecycleBin is a security mechanism in Innovator. When a file is deleted, it is moved there instead of being removed immediately, providing a fallback in case something goes wrong.

      I have a second Innovator instance that runs for several years know and the VaultRecycleBin is completly empty. Just like there was never an Admin that played around with the file system. 

      • mconstantin_aras_com's avatar
        mconstantin_aras_com
        Creator III

        Good morning,

        I made some research as I'm also interested in understanding how the vault works for this scenario.
        Here is the summary of what I found:

        1. Client requests deletion/purge of a File item.
        2. Innovator Server starts the delete operation and identifies the physical files that must be removed.
        3. Innovator Server sends a PrepareDeleteFile request to the Vault Server.
        4. Vault Server prepares the deletion (historically this involves moving the physical file to VaultRecycleBin rather than permanently deleting it yet).
        5. Innovator Server completes and commits the database transaction.
        6. After the database transaction succeeds, Innovator Server sends ConfirmDeleteFile to the Vault Server.
        7. Vault Server permanently removes the file from VaultRecycleBin.
        8. Vault Server returns success to Innovator Server.

         

        So Innovator server and Vault server are both handling a part of the process, I can imagine that if the vault has an issue the file can be stuck in the VaultRecycleBin:

        • Innovator Server manages the database transaction (File item records, relationships, references, etc.).
        • Vault Server manages the physical file on disk.

         

        Because the operation is distributed across both systems, failures can occur between the PrepareDeleteFile and ConfirmDeleteFile phases.

        Regards

        Michael

  • Thanks for the technical background! The explanation sounds very reasonable. As soon as I have some time, I´ll run a few tests to see if I can enforce or reproduce certain error scenarios. For science!🚀