"Cannot create a file when that file already exists" error when saving model


Product(s):WaterGEMS, WaterCAD, HAMMER, SewerGEMS, SewerCAD, StormCAD, CivilStorm
Version(s):10.XX.XX.XX and higher

Problem

When attempting to save a model, the following error appears and the model is not saved. A save-as can be performed but subsequent saves result in the same issue.

Cannot create a file when that file already exists.

Solution

This issue has been known to occur if certain security software is interfering, or if multiple users are saving a model to a shared network folder. 

Examining the product log file can confirm the issue. For example you may see a line like this:

Exception in TempFileMover.Delete: UnauthorizedAccessException: Access to the path 'C:\Users\[username]\Desktop\WaterModel\WaterModel.wtg.01.bak' is denied.

To resolve this issue, here are a few things to check and try:

  1. If you are saving to a network location (shared network folder), it is possible that multiple users are trying to save at the same time and the file in question is locked in use by another user. It is highly advisable to use a proper file sharing system like ProjectWise instead. See: Multi-user Workflows
  2. Check the logs of any security software running on your computer which could be interfering (blocking the file save action). This may require you to engage with your company IT or Helpdesk. For example in at least one occasion, the software "Carbon Black" was preventing a .bak file from being modified (overwritten), causing the error in question. In this case, your IT or Helpdesk may need to create a custom software rule to allow file modifications for .BAK files in the specified folder.
  3. Navigate to the Windows temporary folder and delete the contents of the "Bentley" subfolder. Open File Explorer, type %temp% in the address bar and press enter, then open the Bentley folder. You may need to enable hidden and system folder visibility in the File Explorer settings.
  4. Try create a new model and save to another folder, then save again.
  5. Restart your computer and ensure you're using the latest version of the OpenFlows software. Check your version number under File > Help > About. See more: Downloading OpenFlows Software

See Also

(Forum discussion) WaterCad File Saving Issue

(Forum discussion) File Exists Error