I mistakenly removed a USB stick with an encrypted WinFsp vault while it was being written to. Now I have a zero byte file that cannot be deleted or renamed. “Error 0x8007045D:” I/O device error. Performed full Health Checks but report is all “good”. Quit Cryptomator, dismounted USB and reinserted, and Windows found a problem and repaired it, but file remains in vault. Vault will accept new files, I’d just like to remove this entry. Any suggestions or tools to repair ?
infeo
August 30, 2023, 8:47am
2
Can’t you just delete it?
infeo
August 31, 2023, 11:07am
4
I could reproduce the problem myself and opened a bug ticket on the Cryptomator issue tracker:
opened 11:02AM - 31 Aug 23 UTC
type:bug
os:windows
mount:fuse
### Please agree to the following
- [X] I have searched [existing issues](https… ://github.com/cryptomator/cryptomator/issues?q=) for duplicates
- [X] I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/cryptomator/blob/develop/.github/CODE_OF_CONDUCT.md)
### Summary
If file corruption extends to the header region of a Cryptomator encrypted file, the file cannot be deleted anymore when mounting the vault with WinFSP.
### What software is involved?
- Operating System: Windows
- Cryptomator: 1.9.3
### Volume Type
WinFsp
### Steps to Reproduce
1. Locate the encrypted pendant of a file in your vault with the [reveal encrypted file feature](https://cryptomator.org/blog/2023/02/01/1-7-0-what-you-need-to-know/#locate-encrypted-file)
2. Open the encrypted file with a text editor and delete all content
3. Unlock the vault and try to delete the file
### Expected Behavior
File is deleted
### Actual Behavior
File cannot be deleted and an error is displayed:

### Reproducibility
Always
### Relevant Log Output
```shell
12:21:48.535 [Thread-0] ERROR org.cryptomator.frontend.fuse.ReadOnlyAdapter - open /alf.jpg failed.
java.io.IOException: Unable to decrypt header of file T:\vaultFormat8\d\TY\OIE623ER622PE7JKBJYNYDQ4XPUTEV\8Jn9r1EMPB0ZIApqo1oaA8x0GymgYUI=.c9r
at org.cryptomator.cryptofs.fh.FileHeaderHolder.loadExisting(FileHeaderHolder.java:78)
at org.cryptomator.cryptofs.fh.OpenCryptoFile.initFileHeader(OpenCryptoFile.java:114)
at org.cryptomator.cryptofs.fh.OpenCryptoFile.newFileChannel(OpenCryptoFile.java:76)
at org.cryptomator.cryptofs.CryptoFileSystemImpl.newFileChannelFromFile(CryptoFileSystemImpl.java:399)
at org.cryptomator.cryptofs.CryptoFileSystemImpl.newFileChannel(CryptoFileSystemImpl.java:367)
at org.cryptomator.cryptofs.CryptoFileSystemProvider.newFileChannel(CryptoFileSystemProvider.java:221)
at java.base/java.nio.channels.FileChannel.open(FileChannel.java:308)
at org.cryptomator.frontend.fuse.OpenFile.create(OpenFile.java:28)
at org.cryptomator.frontend.fuse.OpenFileFactory.open(OpenFileFactory.java:43)
at org.cryptomator.frontend.fuse.ReadWriteFileHandler.open(ReadWriteFileHandler.java:51)
at org.cryptomator.frontend.fuse.ReadOnlyFileHandler.open(ReadOnlyFileHandler.java:27)
at org.cryptomator.frontend.fuse.ReadOnlyAdapter.open(ReadOnlyAdapter.java:249)
at org.cryptomator.jfuse.api.FuseOperationsDecorator.open(FuseOperationsDecorator.java:112)
at org.cryptomator.jfuse.win.FuseImpl.open(FuseImpl.java:210)
Caused by: java.lang.IllegalArgumentException: Malformed ciphertext header
at org.cryptomator.cryptolib.v1.FileHeaderCryptorImpl.decryptHeader(FileHeaderCryptorImpl.java:92)
at org.cryptomator.cryptofs.fh.FileHeaderHolder.loadExisting(FileHeaderHolder.java:72)
... 13 more
```
### Anything else?
Workaround: Use the "Reveal Encrypted File" feature to locate the encrypted file and delete this one instead.
Fortunately, there exists a workaround: Use the “reveal encrypted file” feature in Cryptomator and delete the encrypted file directly.
Thanks, that’s what I needed.
It errored and did not quite work at locate the encrypted file, but it did open the containing folder and I was able to identify the file by size and date, and shift-delete it.
Much appreciated!