Project xml corrupted if SoapUI not closed correctly
Hi,
There is a known bug when after system failure, SoapUI corrupts already saved project xml.
https://community.smartbear.com/t5/SoapUI-Open-Source/Error-Running-Soapui/m-p/7046#M4025
I encountered this problem twice.
As a lesson from the first experience (when just several characters have been broken and I was able to fix it), I have set automatic creation of backup folder in Preferences / UI settings and also synced the backup folder with cloud repository.
As a result of the second failure, I have THREE sets of corrupted files (this time full of NULLs and not recoverable): the actual project files, the automatic backups and even the cloud backups.
My recommendation to users:
- Create regular snapshots (win backup), or regularly SAVE the Project AS different file. Projects which are not opened, cannot be broken with this bug.
- Uncheck Preferences / UI settings / "Save all projects on exit".
Unfortunately, I have no solution for already broken files. I appreciate any advice here.
Brainstormig about possible solutions... Im not familiar with java development so may be totally out of box :-)
- Change the backup logic to create new file each time, instead of overwriting the original one. There can be, for example, three latest versions of project xml as a result of automatic backup; further backup will remove the oldest version and add a newest one.
- Or, change the logic SoapUI handles the project in memory. Does it create a "local copy" or manipulates the actual file "directly"? If not closed correctly, do not try to save latest changes (let the project file untouched)?
- Saving process handled as a kind of a transaction? Validate a file before try to save it on file system?
Situations when this bug can be encountered with high probability:
- Windows cannot be resumed from Sleep or Hibernate mode and hard restart or switch-off is needed.
- Computer off because of power outage.
Unexpected system failure can break new/not saved data (and no one complains) but it should never break old, saved and backup-ed ones, imho.
I would be great if SoapUI could prevent this rare, however critical issue.
Thank you and have a nice day,
Zuzana