infeo
January 18, 2021, 5:55pm
5
This specific issue is also on our bug tracker (and already fixed):
opened 05:35PM - 18 Jan 21 UTC
closed 05:41PM - 18 Jan 21 UTC
type:bug
### Description
If a vault fails to unlock (aka unlock and mount) and the use… r tries to unlock the same vault again, the error screen is displayed with the following stack trace:
```
java.lang.IllegalStateException: Already unlocked.
at org.cryptomator.common.vaults.Vault.unlock(Vault.java:131)
at org.cryptomator.ui.unlock.UnlockWorkflow.attemptUnlock(UnlockWorkflow.java:107)
at org.cryptomator.ui.unlock.UnlockWorkflow.call(UnlockWorkflow.java:90)
at org.cryptomator.ui.unlock.UnlockWorkflow.call(UnlockWorkflow.java:44)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
```
The reason for this error lies within the `Vault` class:
https://github.com/cryptomator/cryptomator/blob/0f3085cc7363e7cb2adb7269ae6b71f4ca873c7f/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java#L124-L133
As long as the cryptofilesystem creation does not throw an exception, it is always created and set, even when the `mount()` method fails. Hence, the filesytem remains inside the application in an unlocked state which lead to `IllegalStateExceptions` in subsequent attempts to unlock due to the check in the first line of the method.
### System Setup
* Operating system and version: -
* Cryptomator version: 1.5.11
* Volume type: -
### Steps to Reproduce
1. Set up the used volume implementation to throw directly a `VolumeException`
2. Start Cryptomator, unlock vault.
3. Try to unlock the same vault again.
#### Expected Behavior
Unlock is performed again without throwing this exception.
#### Actual Behavior
IllegalStateException is thrown.
#### Reproducibility
[Always/Intermittent/Only once]
### Additional Information
This issue summarizes the issues #1506, #1470 and #1507.
But as noted in the comment, from the user point of view the real issue is, that the vault is not accessible in the first try. As the OP wrote the issue appeared on MacOS, i suggest to look at those threads:
I have finally fixed the problem by updating FUSE for macOS
https://osxfuse.github.io
to the developer version 4.0.2
It’s not called a stable version but as for now it works for me.
Cryptomator uses WebDAV as a fallback but FUSE is still recommended. Do you remember if you gave permission for osxfuse to load in the System Preferences under “Security & Privacy”?
It should’ve looked like this:
[image]
I’d recommend to try to install osxfuse again. If it doesn’t work, I’m also out of ideas but maybe that’s what caused the issue.