Cannot resolve error: Failed to save file "filepath". EBADF: bad file descriptor, write. Make a backup

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I’m trying to write a note. Which seems to be synced with Obsidan Sync. However, I get this error whenever typing something new in the note (this also happens in other notes):


Things I have tried

  • Update obsidian (edit: and community plugins. Obsidian v1.3.1, installer version: v1.2.8)
  • Reboot obsidian
  • Reboot system
  • Cleaned registry
  • Reboot system

How can I solve this to prevent data loss?

If you haven’t already, make a copy of your vault — preferably on another disk.

Do you see this problem in all notes or only some of them?

Is your disk full?

Are you using any other sync (Dropbox, iCloud, etc.) at the same time as Obsidian Sync?

The error pops also pops up when editing other notes.
Initially, I thought it had to do with the period in the folder name, but the same error also occurs when editing notes in other folders.

The vault is located in the Documents folder on the local C drive (114 GB of free space), which is not backed up by any other sync than Obsidian sync., which I double-checked to be sure.

What I have done:

  • copied the vault on a USB drive.
  • Waited for indexing to complete (~5800 files).
  • Enabled obsidian sync.
  • Closed vault as sync seemed to stop after a while.

Sync log: 2023-05-22 11:26 - Connection successful. Detecting changes…

  • Reopened backed-up vault. Waited until a second round of indexing was completed.
  • Waited for the “Fully synced” indicator.
  • Tried reproducing error in the backed-up vault, in the same notes.
    The error cannot be reproduced in this backed-up and synced vault on the USB drive. In the original vault, edits made in the backed-up vault resulted in syn errors

Sync log (file names abbreviated here, they were not changed in the vault):

2023-05-22 11:08 - Connecting to server
2023-05-22 11:08 - Connection successful. Detecting changes…
2023-05-22 11:08 - Fully synced
2023-05-22 11:34 - Server pushed [Lenny] 11 Researcher/130.FSE-Thesis/Data/2022-05-01 Interview…md
2023-05-22 11:34 - Downloading file 11 Researcher/130.FSE-Thesis/Data/2022-05-01 Interview…md
2023-05-22 11:34 - EBADF: bad file descriptor, write 11 Researcher/130.FSE-Thesis/Data/2022-05-01 Interview…md
2023-05-22 11:34 - Server pushed [Lenny] 00 Overview/!!Working
2023-05-22 11:34 - Downloading file 00 Overview/!!Working
2023-05-22 11:34 - EBADF: bad file descriptor, write 00 Overview/!!Working
2023-05-22 11:34 - Downloading file 11 Researcher/130.FSE-Thesis/Data/2022-05-01 Interview…md
2023-05-22 11:34 - EBADF: bad file descriptor, write 11 Researcher/130.FSE-Thesis/Data/2022-05-01 Interview…md

Considerations, questions and potential next steps

It seems that the local drive creates the issue.

  • Do you think replacing the original vault with this copied vault may solve the issue? If so, I will try that.
  • Can Bitlocker cause the issue? It is enabled on the local drive but not the USB drive.

Does this info help with identifying the issue? Tonight (around 19:00 CET), I can provide additional info if needed.

For now, I will work in the vault on the USB drive as time is limited to complete my work before a deadline :')

And thank you for your help, I really appreciate it.

I’d try copying the vault from the USB to a new folder on the main disk and see if it that one works. If it does, then I’d replace the old one.

If Bitlocker is BitLocker - Wikipedia, I’d guess it’s not the problem.

You may want to search the web for something like windows bad file descriptor to try to find the root of the problem. It looks like it may take some digging to figure out, but perhaps the disk check mentioned in windows 7 - 'Bad file descriptor', check disk found no errors - Super User is a place to start.

Copying the ‘USB-vault’ to the main disk did not solve the issue.

I did find an error running the disk check and will find out later if resolving it fixes the issue. Thank you for suggesting finding the root cause.

I had a same issue today along with below notification from Windows system.

I did below steps to fix it. See if this resolves the issue for you.

  1. Navigate to Windows Security > Virus & threat protection > Manage ransomware protection > Allow an app through Controlled folder access
  2. Add Obsidian to the allowed app list
1 Like

This seems to have solved the issue, thank you!

This solved my problem as well! Thank you!

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