ENOENT with warning to save files deletes note immediately

Reproduced on OSX.

Steps to reproduce

  1. Plug in an external drive
  2. Open a folder on the drive as a vault
  3. Edit a file, save
  4. Disconnect the drive and force disconnect even when it says applications are still using it.
  5. Start typing into the still-open editor
  6. Observe the error message stating “Make a backup of the contents of this file now to avoid losing data” as the window with the contents of said file is closed in front of you

Did you follow the troubleshooting guide? [Y/N]

Yes. This cannot be reproduced with the sandbox vault because it involves changes to the vault outside of obsidian. Restricted mode on community plugins/themes/etc are all off.

Expected result

The editor to remain open, perhaps with text entry disabled but selection enabled, for me to copy the contents and recover what the editor still has available

Actual result

In conflict with the wording of the error message, the file is closed and the contents are made irrecoverable


Obsidian version: v1.4.16
Installer version: v1.4.16
Operating system: Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64 22.6.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on


Additional information

The relevant error message:
Screenshot 2023-11-06 at 03.09.12

I forgot my vault was on this drive when I force-disconnected it. Everything’s fine, but I figured you’d want to know that the error message and what happens seem misaligned.

I think it’s okay. The message is just a warning that Obsidian can’t write and infact it can’t write because you removed the hard drive.

That’s understandable, I just thought it would be reasonable/a good feature to do what other editors do in this situation, which is keep the file open if this happens. As it is, clearly there’s a disk error condition where on save all your changes since the last save are immediately deleted. If you were to, for example, plug the drive back in and try and save again you wouldn’t be able to here.

I agree the behavior should be more like what you describe (and I thought it was), but as a workaround you should be able to recover the file from Settings > File Recovery if (Maude forbid) it happens again.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.