Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use secret-service 1.5.0 #1

Merged
merged 4 commits into from
Feb 22, 2021
Merged

Use secret-service 1.5.0 #1

merged 4 commits into from
Feb 22, 2021

Conversation

swiesend
Copy link
Contributor

  • use static method SimpleCollection.isAvailable()
  • handle AccessControlExceptions

- use static method `SimpleCollection.isAvailable()`
- handle `AccessControlException`s
@infeo
Copy link
Member

infeo commented Dec 9, 2020

The actual changes are good (especially the static applicable() method!).

But a integration test revealed an issue. Using this lib with Cryptomator leads to

a) The application blocks for two minutes (aka 120seconds) if the unlock dialogue of the secret service is canceld. This makes it nearly unusable.
b) An exception is thrown if the dialogue is canceled:

16:59:02.930 [JavaFX Application Thread] INFO  o.f.secret.handlers.SignalHandler - Await signal org.freedesktop.secret.interfaces.Prompt$Completed(/org/freedesktop/secrets/prompt/u1) within 120 seconds.
17:01:02.936 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method Dismiss is not implemented on interface org.freedesktop.Secret.Prompt
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:63)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Prompt.dismiss(Prompt.java:84)
	at org.freedesktop.secret.handlers.SignalHandler.await(SignalHandler.java:200)
	at org.freedesktop.secret.Prompt.await(Prompt.java:60)
	at org.freedesktop.secret.simple.SimpleCollection.performPrompt(SimpleCollection.java:220)
	at org.freedesktop.secret.simple.SimpleCollection.unlock(SimpleCollection.java:252)
	at org.freedesktop.secret.simple.SimpleCollection.getItems(SimpleCollection.java:484)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:39)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1806)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:111)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
17:01:02.936 [JavaFX Application Thread] WARN  o.f.secret.handlers.SignalHandler - Cancelled the prompt (/org/freedesktop/secrets/prompt/u1) manually after exceeding the timeout of 120 seconds.
17:01:02.940 [JavaFX Application Thread] INFO  o.f.secret.handlers.SignalHandler - Await signal org.freedesktop.secret.interfaces.Prompt$Completed(/org/freedesktop/secrets/prompt/u2) within 120 seconds.
17:03:02.943 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method Dismiss is not implemented on interface org.freedesktop.Secret.Prompt
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:63)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Prompt.dismiss(Prompt.java:84)
	at org.freedesktop.secret.handlers.SignalHandler.await(SignalHandler.java:200)
	at org.freedesktop.secret.Prompt.await(Prompt.java:60)
	at org.freedesktop.secret.simple.SimpleCollection.performPrompt(SimpleCollection.java:220)
	at org.freedesktop.secret.simple.SimpleCollection.unlock(SimpleCollection.java:252)
	at org.freedesktop.secret.simple.SimpleCollection.getSecret(SimpleCollection.java:504)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:41)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1806)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:111)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
17:03:02.944 [JavaFX Application Thread] WARN  o.f.secret.handlers.SignalHandler - Cancelled the prompt (/org/freedesktop/secrets/prompt/u2) manually after exceeding the timeout of 120 seconds.

Later, a locked keyring is also not utterly well handled:

17:03:02.946 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - D-Bus response:
org.freedesktop.secret.errors.IsLocked: Cannot get secret of a locked object
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:58)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Item.getSecret(Item.java:94)
	at org.freedesktop.secret.simple.SimpleCollection.getSecret(SimpleCollection.java:509)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:41)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1806)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:111)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)

Copy link
Member

@infeo infeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the issue(s) in the above commetn are not addressed, this PR will not be merged.

@swiesend
Copy link
Contributor Author

swiesend commented Dec 9, 2020

  1. The UnknownMethod method error usually occurs, if the Prompt does not pop up, but has been assigned an object-path:
    org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method Dismiss is not implemented on interface org.freedesktop.Secret.Prompt

Do you remember if the prompt was visible in that scenario? On which system did you test?

  1. Is not good and should have been handled as AccessControlException

Thanks for the feedback. There seems also to be the new https://github.com/hypfvieh/dbus-java 3.4.2 version with the fix for the race condition. So I guess its about time to fix this, too.

@infeo
Copy link
Member

infeo commented Dec 10, 2020

Do you remember if the prompt was visible in that scenario? On which system did you test?

The prompt was visible and one can interact with it. No matter what action I choose (Canceling or Unlocking keyring). i always have to wait 120seconds.

I tested it on Ubuntu 20.04 with the latest updates (5.4.0-56 kernel, GNOME 3.36.3) inside a VM.

@purejava
Copy link
Contributor

We've got 3 problems here:

First get() is a blocking operation and the JavaFX application thread is blocked by it:

Name: JavaFX Application Thread
State: TIMED_WAITING on java.util.concurrent.FutureTask@444a2920
Total blocked: 31  Total waited: 33

Stack trace: 
java.base@14.0.2/jdk.internal.misc.Unsafe.park(Native Method)
java.base@14.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
java.base@14.0.2/java.util.concurrent.FutureTask.awaitDone(FutureTask.java:444)
java.base@14.0.2/java.util.concurrent.FutureTask.get(FutureTask.java:203)
app//org.freedesktop.secret.handlers.SignalHandler.await(SignalHandler.java:196)
app//org.freedesktop.secret.Prompt.await(Prompt.java:60)
app//org.freedesktop.secret.simple.SimpleCollection.performPrompt(SimpleCollection.java:220)
app//org.freedesktop.secret.simple.SimpleCollection.unlock(SimpleCollection.java:252)
app//org.freedesktop.secret.simple.SimpleCollection.getItems(SimpleCollection.java:484)
app//org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:43)
app//org.cryptomator.common.keychain.KeychainManager.isPassphraseStored(KeychainManager.java:83)
app//org.cryptomator.common.keychain.KeychainManager.createStoredPassphraseProperty(KeychainManager.java:120)
app//org.cryptomator.common.keychain.KeychainManager$$Lambda$449/0x00000001004e5440.apply(Unknown Source)
app//com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
app//com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
app//com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
app//com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)

https://github.com/swiesend/secret-service/blob/master/src/main/java/org/freedesktop/secret/handlers/SignalHandler.java#L196

return handler.get(timeout.toMillis(), TimeUnit.MILLISECONDS);

Second, the org.freedesktop.DBus.Error.UnknownMethod is not catched in the MessageHandler.
Catching it and retrieving some information reveals that we are dismissing a prompt that was never created, e.g. I triggered this by creating a vault, ending Cryptomator, locking the keyring, starting Cryptomator and just clicking once on the vault in the vault list.
This leads to these messages:

13:45:55.337 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator SNAPSHOT on Linux 5.9.13-arch1-1 (amd64)
13:45:55.576 [JavaFX Application Thread] INFO  o.c.ui.launcher.FxApplicationStarter - JavaFX Runtime started.
13:45:56.553 [JavaFX Application Thread] WARN  o.cryptomator.ui.fxapp.FxApplication - has visible stages: true
13:46:01.925 [JavaFX Application Thread] INFO  o.f.secret.handlers.SignalHandler - Await signal org.freedesktop.secret.interfaces.Prompt$Completed(/org/freedesktop/secrets/prompt/u5) within 120 seconds.
13:46:02.030 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:46:02.030 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - Message sent: MethodCall(0,34) { Path=>/org/freedesktop/secrets/prompt/u5, Interface=>org.freedesktop.Secret.Prompt, Member=>Dismiss, Destination=>org.freedesktop.secrets, Signature=> } { }
13:46:02.030 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - Response: Error(1,1914) { Error Name=>org.freedesktop.DBus.Error.UnknownMethod, Reply Serial=>34, Destination=>:1.461, Sender=>:1.362, Signature=>s } { Method Dismiss is not implemented on interface org.freedesktop.Secret.Prompt }
13:46:02.031 [JavaFX Application Thread] WARN  o.f.secret.handlers.SignalHandler - Cancelled the prompt (/org/freedesktop/secrets/prompt/u5) manually after exceeding the timeout of 120 seconds.

Note that I did not cancel a prompt at all.

This brings us to the third problem: somehow the prompt handling seems to dismiss prompts before creating them.

I suggest the following:

  • to change the timeout for the get() to get the result of the Future without blocking the application thread
  • add handling for the org.freedesktop.DBus.Error.UnknownMethod error
  • re-check the prompt handling

A branch with a changed timeout that allows to run Cryptomator with secret-service 1.2.3 and investigate things further can be found here.

@swiesend
Copy link
Contributor Author

swiesend commented Jan 5, 2021

I released the secret-service 1.3.0, which addresses several issues. I tested the version with a local build on Ubuntu 20.04 with Gnome and Kubuntu 20.04 (virtual machine) with the gnome-keyring installed.

  1. uses the new dbus-java in version 3.2.4, which solves Possible race condition when disconnecting hypfvieh/dbus-java#123
  2. The signal handling in the main thread "JavaFX Application Thread" should be interruptible now
  3. org.freedesktop.DBus.Error.UnknownMethod is handled, others, too
  4. I rechecked the prompt handling and fixed prompt test
  5. This edge case should be handled, too: added checks for system-only DBus #4

There are also some other changes https://github.com/swiesend/secret-service/blob/master/CHANGELOG.md

@infeo and @purejava please let me know, if there are still issues!

@swiesend swiesend changed the title Use secret-service 1.2.3 Use secret-service 1.3.0 Jan 5, 2021
@infeo infeo self-assigned this Jan 11, 2021
@infeo
Copy link
Member

infeo commented Jan 12, 2021

@swiesend Thanks for the update. I tested 1.3.0 with the current cryptomator snapshot on a recent ubuntu 20.10 and kubuntu 20.10. The results are mixed.

On the ubuntu machine everything runs smoothly. Unlock, lock, save passwords, remove passwords work out of the box without any problem. Very nice (:

Talking about the kubuntu system, things are different. First start of Cryptomator with the updated lib and a single vault I looked into the keyring selection dialogue. To my surprise the gnome keyring was selectable, hence i chose it and tried to unlock the vault. Not surprinsingly stacktraces were thrown. Was also able to check the save-password-box resulting in more stack traces of similar kind:

12:59:16.345 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator SNAPSHOT on Linux 5.8.0-36-generic (amd64)
12:59:16.661 [JavaFX Application Thread] INFO  o.c.ui.launcher.FxApplicationStarter - JavaFX Runtime started.
12:59:19.024 [JavaFX Application Thread] WARN  o.cryptomator.ui.fxapp.FxApplication - has visible stages: true
12:59:20.643 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - Unexpected D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:60)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Service.openSession(Service.java:29)
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:80)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:38)
	at org.cryptomator.common.keychain.KeychainManager.isPassphraseStored(KeychainManager.java:83)
	at org.cryptomator.common.keychain.KeychainManager.createStoredPassphraseProperty(KeychainManager.java:120)
	at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4941)
	at org.cryptomator.common.keychain.KeychainManager.getPassphraseStoredProperty(KeychainManager.java:115)
	at org.cryptomator.ui.mainwindow.VaultDetailLockedController.lambda$new$0(VaultDetailLockedController.java:37)
	at com.tobiasdiez.easybind.select.LeafSelectionElement.connect(LeafSelectionElement.java:25)
	at com.tobiasdiez.easybind.select.SelectObjectBinding.computeValue(SelectObjectBinding.java:31)
	at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:157)
	at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
	at javafx.beans.binding.BooleanExpression$2.computeValue(BooleanExpression.java:136)
	at javafx.beans.binding.BooleanBinding.get(BooleanBinding.java:155)
	at javafx.beans.binding.BooleanExpression.getValue(BooleanExpression.java:55)
	at javafx.beans.binding.BooleanBinding.getValue(BooleanBinding.java:59)
	at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:355)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:174)
	at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:52)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.binding.ObjectBinding.invalidate(ObjectBinding.java:176)
	at com.tobiasdiez.easybind.select.SelectObjectBinding.lambda$new$0(SelectObjectBinding.java:19)
	at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:348)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:106)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
	at javafx.beans.property.ObjectPropertyBase$Listener.invalidated(ObjectPropertyBase.java:234)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
	at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
	at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
	at javafx.scene.control.SelectionModel.setSelectedItem(SelectionModel.java:105)
	at javafx.scene.control.MultipleSelectionModelBase.lambda$new$0(MultipleSelectionModelBase.java:67)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ReadOnlyIntegerPropertyBase.fireValueChangedEvent(ReadOnlyIntegerPropertyBase.java:72)
	at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:102)
	at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:114)
	at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
	at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:69)
	at javafx.scene.control.MultipleSelectionModelBase.select(MultipleSelectionModelBase.java:412)
	at javafx.scene.control.MultipleSelectionModelBase.clearAndSelect(MultipleSelectionModelBase.java:360)
	at javafx.scene.control.ListView$ListViewBitSetSelectionModel.clearAndSelect(ListView.java:1449)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.simpleSelect(CellBehaviorBase.java:282)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.doSelect(CellBehaviorBase.java:246)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.mousePressed(CellBehaviorBase.java:176)
	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1851)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at com.sun.glass.ui.View.notifyMouse(View.java:942)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
12:59:20.648 [JavaFX Application Thread] ERROR o.f.secret.simple.SimpleCollection - Could not communicate properly with the secret service.
java.lang.NullPointerException: Cannot read field "a" because "osResponse" is null
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:84)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:38)
	at org.cryptomator.common.keychain.KeychainManager.isPassphraseStored(KeychainManager.java:83)
	at org.cryptomator.common.keychain.KeychainManager.createStoredPassphraseProperty(KeychainManager.java:120)
	at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4941)
	at org.cryptomator.common.keychain.KeychainManager.getPassphraseStoredProperty(KeychainManager.java:115)
	at org.cryptomator.ui.mainwindow.VaultDetailLockedController.lambda$new$0(VaultDetailLockedController.java:37)
	at com.tobiasdiez.easybind.select.LeafSelectionElement.connect(LeafSelectionElement.java:25)
	at com.tobiasdiez.easybind.select.SelectObjectBinding.computeValue(SelectObjectBinding.java:31)
	at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:157)
	at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
	at javafx.beans.binding.BooleanExpression$2.computeValue(BooleanExpression.java:136)
	at javafx.beans.binding.BooleanBinding.get(BooleanBinding.java:155)
	at javafx.beans.binding.BooleanExpression.getValue(BooleanExpression.java:55)
	at javafx.beans.binding.BooleanBinding.getValue(BooleanBinding.java:59)
	at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:355)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.binding.BooleanBinding.invalidate(BooleanBinding.java:174)
	at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:52)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.binding.ObjectBinding.invalidate(ObjectBinding.java:176)
	at com.tobiasdiez.easybind.select.SelectObjectBinding.lambda$new$0(SelectObjectBinding.java:19)
	at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:348)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:106)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
	at javafx.beans.property.ObjectPropertyBase$Listener.invalidated(ObjectPropertyBase.java:234)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
	at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
	at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
	at javafx.scene.control.SelectionModel.setSelectedItem(SelectionModel.java:105)
	at javafx.scene.control.MultipleSelectionModelBase.lambda$new$0(MultipleSelectionModelBase.java:67)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ReadOnlyIntegerPropertyBase.fireValueChangedEvent(ReadOnlyIntegerPropertyBase.java:72)
	at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:102)
	at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:114)
	at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148)
	at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:69)
	at javafx.scene.control.MultipleSelectionModelBase.select(MultipleSelectionModelBase.java:412)
	at javafx.scene.control.MultipleSelectionModelBase.clearAndSelect(MultipleSelectionModelBase.java:360)
	at javafx.scene.control.ListView$ListViewBitSetSelectionModel.clearAndSelect(ListView.java:1449)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.simpleSelect(CellBehaviorBase.java:282)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.doSelect(CellBehaviorBase.java:246)
	at com.sun.javafx.scene.control.behavior.CellBehaviorBase.mousePressed(CellBehaviorBase.java:176)
	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1851)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at com.sun.glass.ui.View.notifyMouse(View.java:942)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
13:00:05.338 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - Unexpected D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:60)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Service.openSession(Service.java:29)
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:80)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:38)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1802)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:116)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
13:00:05.339 [JavaFX Application Thread] ERROR o.f.secret.simple.SimpleCollection - Could not communicate properly with the secret service.
java.lang.NullPointerException: Cannot read field "a" because "osResponse" is null
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:84)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:38)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1802)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:116)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
13:00:05.339 [JavaFX Application Thread] ERROR o.cryptomator.ui.unlock.UnlockModule - Failed to load entry from system keychain.
org.cryptomator.integrations.keychain.KeychainAccessException: Loading password failed.
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:46)
	at org.cryptomator.common.keychain.KeychainManager.loadPassphrase(KeychainManager.java:49)
	at org.cryptomator.ui.unlock.UnlockModule.provideStoredPassword(UnlockModule.java:57)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.provideStoredPassword(UnlockModule_ProvideStoredPasswordFactory.java:41)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:32)
	at org.cryptomator.ui.unlock.UnlockModule_ProvideStoredPasswordFactory.get(UnlockModule_ProvideStoredPasswordFactory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:27)
	at org.cryptomator.ui.unlock.UnlockModule_ProvidePasswordFactory.get(UnlockModule_ProvidePasswordFactory.java:10)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:77)
	at org.cryptomator.ui.unlock.UnlockWorkflow_Factory.get(UnlockWorkflow_Factory.java:19)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$FxApplicationComponentImpl$UnlockComponentImpl.unlockWorkflow(DaggerCryptomatorComponent.java:1802)
	at org.cryptomator.ui.unlock.UnlockComponent.startUnlockWorkflow(UnlockComponent.java:27)
	at org.cryptomator.ui.fxapp.FxApplication.lambda$startUnlockWorkflow$2(FxApplication.java:116)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.io.IOException: Could not communicate properly with the secret service.
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:71)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.loadPassphrase(SecretServiceKeychainAccess.java:38)
	... 22 common frames omitted
Caused by: java.lang.NullPointerException: Cannot read field "a" because "osResponse" is null
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:84)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	... 23 common frames omitted
13:00:12.938 [App Background Thread 003] INFO  o.c.ui.unlock.UnlockWorkflow - Unlock of 'asd' succeeded.
13:00:12.943 [App Background Thread 003] ERROR o.f.secret.handlers.MessageHandler - Unexpected D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown
	at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:60)
	at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
	at org.freedesktop.secret.Service.openSession(Service.java:29)
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:80)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.storePassphrase(SecretServiceKeychainAccess.java:24)
	at org.cryptomator.common.keychain.KeychainManager.storePassphrase(KeychainManager.java:43)
	at org.cryptomator.ui.unlock.UnlockWorkflow.savePasswordToSystemkeychain(UnlockWorkflow.java:155)
	at org.cryptomator.ui.unlock.UnlockWorkflow.handleSuccess(UnlockWorkflow.java:137)
	at org.cryptomator.ui.unlock.UnlockWorkflow.call(UnlockWorkflow.java:91)
	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(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
13:00:12.944 [App Background Thread 003] ERROR o.f.secret.simple.SimpleCollection - Could not communicate properly with the secret service.
java.lang.NullPointerException: Cannot read field "a" because "osResponse" is null
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:84)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.storePassphrase(SecretServiceKeychainAccess.java:24)
	at org.cryptomator.common.keychain.KeychainManager.storePassphrase(KeychainManager.java:43)
	at org.cryptomator.ui.unlock.UnlockWorkflow.savePasswordToSystemkeychain(UnlockWorkflow.java:155)
	at org.cryptomator.ui.unlock.UnlockWorkflow.handleSuccess(UnlockWorkflow.java:137)
	at org.cryptomator.ui.unlock.UnlockWorkflow.call(UnlockWorkflow.java:91)
	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(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
13:00:12.944 [App Background Thread 003] ERROR o.c.ui.unlock.UnlockWorkflow - Failed to store passphrase in system keychain.
org.cryptomator.integrations.keychain.KeychainAccessException: Storing password failed.
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.storePassphrase(SecretServiceKeychainAccess.java:32)
	at org.cryptomator.common.keychain.KeychainManager.storePassphrase(KeychainManager.java:43)
	at org.cryptomator.ui.unlock.UnlockWorkflow.savePasswordToSystemkeychain(UnlockWorkflow.java:155)
	at org.cryptomator.ui.unlock.UnlockWorkflow.handleSuccess(UnlockWorkflow.java:137)
	at org.cryptomator.ui.unlock.UnlockWorkflow.call(UnlockWorkflow.java:91)
	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(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.io.IOException: Could not communicate properly with the secret service.
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:71)
	at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.storePassphrase(SecretServiceKeychainAccess.java:24)
	... 12 common frames omitted
Caused by: java.lang.NullPointerException: Cannot read field "a" because "osResponse" is null
	at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:84)
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:167)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:66)
	... 13 common frames omitted
13:00:14.872 [JavaFX Application Thread] INFO  org.cryptomator.ui.lock.LockWorkflow - Lock of asd succeeded.

The bottom line is, that the change in the isSupported() method broke something. Switching to the old method, at least the GNOME Keyring option is not selectable anymore. (but if it was selected before, it is still shown in the selected option and not the fallback. this needs further investigation, but first in the ui.)

Second, even if the gnome-keyring package is installed, as long as no login keyring is created, always when a vault is selected or unlocked, a bunch of warnings are logged:

13:06:11.528 [JavaFX Application Thread] INFO  o.c.ui.launcher.FxApplicationStarter - JavaFX Runtime started.
13:06:13.193 [JavaFX Application Thread] WARN  o.cryptomator.ui.fxapp.FxApplication - has visible stages: true
13:06:14.874 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:14.876 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:14.877 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:17.139 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:17.140 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:17.141 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
13:06:22.317 [App Background Thread 003] INFO  o.c.ui.unlock.UnlockWorkflow - Unlock of 'asd' succeeded.
13:06:24.493 [JavaFX Application Thread] INFO  org.cryptomator.ui.lock.LockWorkflow - Lock of asd succeeded.

Hence, maybe the isSupported() should include such a check and if not print an appropiate error message, if possible.

@swiesend
Copy link
Contributor Author

swiesend commented Jan 19, 2021

I could identify two problems:

  1. In 1.3.0 I introduced a NPE, which I could trigger on a clean kubuntu 20.04.1 installation. This is solved by my newly released version 1.3.1. But on that clean kubuntu I was not able to store any password as both the secret-service and kdewallet could not communicate properly with the D-Bus:
00:54:28.311 [JavaFX Application Thread] WARN  o.c.l.k.KDEWalletKeychainAccess - SESSION DBus not found.
00:54:29.130 [JavaFX Application Thread] WARN  o.f.secret.simple.SimpleCollection - Could not communicate properly with the D-Bus: Cannot Resolve Session Bus Address (RuntimeException)

This needs more investigation. There is something weird going on. Maybe with dbus-java or the D-Bus itself. The problem occurs even with gnome-keyring installed.

  1. Was more surprising to me. The org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown from your stacktrace @infeo should be handled if raised, but I never expected the the SimpleCollection to get to this point, as the SimpleCollection.isAvailable() should have prevented that. In order to solve that issue I had to introduce another check with a call to the service, which checks if the secret service is actually provided and supports the expected transport encryption algorithm. This slows the check a little bit down, but seems to be necessary. So if you can get away with 1.3.1 that would be great, but I think you have to go with 1.4.0.

I order to get both versions "working" I first had to apply the changes from #4. Built and tested with adoptopenjdk-15-hotspot, which had a problem with the maven-javadoc-plugin plugin.

Regarding to your second point @infeo from your last comment: I think this is a weird artifact, as by installing the gnome-keyring the default collection should be provided by installation. I think one would be able to delete the default collection with seahorse, but that is a very special edge case.

@swiesend swiesend changed the title Use secret-service 1.3.0 Use secret-service 1.3.1 or 1.4.0 if necessary Jan 20, 2021
@infeo
Copy link
Member

infeo commented Jan 26, 2021

@swiesend To easier testing it I added in eaa880b a simple unit test to check if the isSupported() method is working. You can merge this into your develop branch and then try to adapt/debug your library until the problem of the isSupported() method is solved.
The alternative is keep the old version of the isSupported() method.

Additionally, since the github CI servers don't run a session dbus, it will also show if some errors will be thrown if it is not present.

@purejava
Copy link
Contributor

This all looks very interesting. 😃
I downloaded the KUbuntu 20.04.1 ISO and gave it a whirl.
Some of the above results from gnome-keyring not being installed:

ralph@ubuntu:~$ aptitude search libkf5wallet5 gnome-keyring
p   gnome-keyring                             
v   gnome-keyring:i386
p   gnome-keyring-pkcs11
i A libkf5wallet5
p   libpam-gnome-keyring
p   pidgin-gnome-keyring
ralph@ubuntu:~$ ps aux | grep -i wallet
ralph      13056  0.0  0.0   8900   660 pts/2    S+   19:25   0:00 grep --color=auto -i wallet
ralph@ubuntu:~$

As you see, the /usr/bin/kwalletd5 daemon is not yet running, as no one requested its service so far. That's like it should be.
I did request it by cloning the Cryptomator sources, compiling and starting them. Please note, that I used secret-service 1.3.1 and kdewallet 1.2.0.
Besides that, I did not do anything else.

After starting Cryptomator, secret-service was available in the prefs, which is a bug. I agree on that one. I changed that to kwallet and could use this backend without issues. So I don't know, why this did not work for @swiesend.

ralph@ubuntu:~/git/cryptomator/main/buildkit/target$ ./launcher-linux.sh 
19:48:30.562 [main] DEBUG org.cryptomator.common.Environment - user.home: /home/ralph
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - user.language: en
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - user.region: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.keychainPath: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.logDir: ~/.local/share/Cryptomator/logs
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.mountPointsDir: ~/.local/share/Cryptomator/mnt
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.minPwLength: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.buildNumber: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - cryptomator.showTrayIcon: null
19:48:30.564 [main] DEBUG org.cryptomator.common.Environment - fuse.experimental: false
19:48:30.588 [main] DEBUG org.cryptomator.common.ShutdownHook - Registered shutdown hook.
19:48:30.632 [main] DEBUG org.cryptomator.common.settings.SettingsProvider - Attempting to load settings from /home/ralph/.config/Cryptomator/settings.json
19:48:30.869 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator 1.6.0-SNAPSHOT on Linux 5.4.0-65-generic (amd64)
19:48:31.082 [JavaFX Application Thread] INFO  o.c.ui.launcher.FxApplicationStarter - JavaFX Runtime started.
19:48:31.922 [JavaFX Application Thread] ERROR o.f.secret.handlers.MessageHandler - Unexpected D-Bus response:
org.freedesktop.dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown
        at org.freedesktop.secret.handlers.MessageHandler.send(MessageHandler.java:60)
        at org.freedesktop.secret.handlers.Messaging.send(Messaging.java:37)
        at org.freedesktop.secret.Service.openSession(Service.java:29)
        at org.freedesktop.secret.TransportEncryption.openSession(TransportEncryption.java:80)
        at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:172)
        at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:70)
        at org.cryptomator.linux.keychain.SecretServiceKeychainAccess.isSupported(SecretServiceKeychainAccess.java:18)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        at org.cryptomator.common.keychain.KeychainModule.provideSupportedKeychainAccessProviders(KeychainModule.java:30)
        at org.cryptomator.common.keychain.KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.provideSupportedKeychainAccessProviders(KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.java:39)
        at org.cryptomator.common.keychain.KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.get(KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.java:29)
        at org.cryptomator.common.keychain.KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.get(KeychainModule_ProvideSupportedKeychainAccessProvidersFactory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at org.cryptomator.common.keychain.KeychainModule_ProvideKeychainAccessProviderFactory.get(KeychainModule_ProvideKeychainAccessProviderFactory.java:33)
        at org.cryptomator.common.keychain.KeychainModule_ProvideKeychainAccessProviderFactory.get(KeychainModule_ProvideKeychainAccessProviderFactory.java:12)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at org.cryptomator.common.keychain.KeychainManager_Factory.get(KeychainManager_Factory.java:27)
        at org.cryptomator.common.keychain.KeychainManager_Factory.get(KeychainManager_Factory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at org.cryptomator.ui.mainwindow.VaultDetailLockedController_Factory.get(VaultDetailLockedController_Factory.java:45)
        at org.cryptomator.ui.mainwindow.VaultDetailLockedController_Factory.get(VaultDetailLockedController_Factory.java:13)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at org.cryptomator.ui.common.FXMLLoaderFactory.constructController(FXMLLoaderFactory.java:75)
        at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:940)
        at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:982)
        at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:229)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
        at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1156)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:756)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
        at javafx.fxml.FXMLLoader$IncludeElement.constructValue(FXMLLoader.java:1156)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:756)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2532)
        at org.cryptomator.ui.common.FXMLLoaderFactory.load(FXMLLoaderFactory.java:46)
        at org.cryptomator.ui.common.FXMLLoaderFactory.createScene(FXMLLoaderFactory.java:60)
        at org.cryptomator.ui.mainwindow.MainWindowModule.provideMainScene(MainWindowModule.java:64)
        at org.cryptomator.ui.mainwindow.MainWindowModule_ProvideMainSceneFactory.provideMainScene(MainWindowModule_ProvideMainSceneFactory.java:36)
        at org.cryptomator.ui.mainwindow.MainWindowModule_ProvideMainSceneFactory.get(MainWindowModule_ProvideMainSceneFactory.java:27)
        at org.cryptomator.ui.mainwindow.MainWindowModule_ProvideMainSceneFactory.get(MainWindowModule_ProvideMainSceneFactory.java:10)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at org.cryptomator.ui.mainwindow.MainWindowComponent.showMainWindow(MainWindowComponent.java:28)
        at org.cryptomator.ui.fxapp.FxApplication.lambda$showMainWindow$1(FxApplication.java:107)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
        at java.base/java.lang.Thread.run(Thread.java:832)

(java:12487): Gtk-WARNING **: 19:48:32.089: Unable to locate theme engine in module_path: "adwaita",
19:48:32.092 [JavaFX Application Thread] WARN  o.cryptomator.ui.fxapp.FxApplication - has visible stages: true
19:48:39.658 [App Scheduled Executor 01] INFO  o.c.common.settings.SettingsProvider - Settings saved to /home/ralph/.config/Cryptomator/settings.json
19:48:57.444 [App Background Thread 003] INFO  o.c.u.a.CreateNewVaultPasswordController - Created vault at /home/ralph/Test
19:48:57.556 [JavaFX Application Thread] INFO  o.f.dbus.handlers.SignalHandler - Await signal org.kde.KWallet$walletAsyncOpened(/modules/kwalletd5) within 120 seconds.
19:48:58.459 [App Scheduled Executor 01] INFO  o.c.common.settings.SettingsProvider - Settings saved to /home/ralph/.config/Cryptomator/settings.json
19:49:11.707 [DBus Worker Thread-2] INFO  o.f.dbus.handlers.SignalHandler - Received signal KWallet.walletOpened: kdewallet
19:49:11.708 [DBus Worker Thread-3] INFO  o.f.dbus.handlers.SignalHandler - Received signal KWallet.walletAsyncOpened: {TransactionID: 0, handle: 1318629513}
19:49:18.019 [App Background Thread 004] INFO  org.cryptomator.common.vaults.Vault - Storing file name length limit of 220
19:49:19.021 [App Scheduled Executor 02] INFO  o.c.common.settings.SettingsProvider - Settings saved to /home/ralph/.config/Cryptomator/settings.json
19:49:20.312 [App Background Thread 004] INFO  o.c.ui.unlock.UnlockWorkflow - Unlock of 'Test' succeeded.
19:49:20.315 [DBus Worker Thread-3] INFO  o.f.dbus.handlers.SignalHandler - Received signal KWallet.folderUpdated: {wallet: kdewallet, folder: Cryptomator}
19:49:23.234 [JavaFX Application Thread] INFO  org.cryptomator.ui.lock.LockWorkflow - Lock of Test succeeded.
19:49:29.014 [JavaFX Application Thread] WARN  o.cryptomator.ui.fxapp.FxApplication - has visible stages: false
19:49:29.015 [main] INFO  org.cryptomator.launcher.Cryptomator - UI shut down
ralph@ubuntu:~/git/cryptomator/main/buildkit/target$ 

I'll see if I can give a helping hand for the above at the weekend.

@purejava
Copy link
Contributor

On the ubuntu machine everything runs smoothly. Unlock, lock, save passwords, remove passwords work out of the box without any problem. Very nice (:

I tested secret-service 1.4.0 on KUbuntu 20.04.1 and totally agree with @infeo.
After circumventing a couple of obstacles on KUbuntu (I will come to that in a second), the latest version of secret-service works very well and does not show the problems that were discussed in this issue before. Thank you very much for the good work @swiesend!

As a side note for anybody interested in testing, please note that KUbuntu 20.04 comes with gnome-keyring installed, whereas KUbuntu 20.04.1 does not have it installed.

The problems @infeo and I noticed with an org.freedesktop.DBus.Error.ServiceUnknown error thrown are caused by the new SimpleCollection.isAvailable() method that is failing.
When gnome-keyring is not installed, you cannot get an object that belongs to the gnome-keyring package by calling getRemoteObject() for that object, this will lead to the error. For that, there is another method. You retrieve the DBus object itself and call ListActivatableNames() on it. Every packages registers a unique name there and that let's you check, wether the necessary package (gnome-keying in this case) is installed.

The according code looks like this:

public static boolean isAvailable() {
        if (connection != null && connection.isConnected()) {
            try {
                DBus bus = connection.getRemoteObject("org.freedesktop.DBus",
                        "/org/freedesktop/DBus", DBus.class);
                if (!Arrays.asList(bus.ListActivatableNames()).contains("org.freedesktop.secrets")) {
                    return false;
                }

                org.freedesktop.secret.interfaces.Service service = connection.getRemoteObject(
                        Static.Service.SECRETS,
                        Static.ObjectPaths.SECRETS,
                        org.freedesktop.secret.interfaces.Service.class);

Another thing I noticed during testing is, that secret-service fails, if a keyring with the name "login" is missing. secret-service does not check for that and relies on this keyring being there. As far as I know the GNOME desktop, this keyring gets created the first time you log into your session. On situations where you install gnome-keyring on a KDE system where gnome-keyring wasn't installed before (like KUbuntu 20.04.1) you end up with secret-service logging quite a few warnings

15:04:36.700 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
15:04:36.702 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod
15:04:36.702 [JavaFX Application Thread] WARN  o.f.secret.handlers.MessageHandler - org.freedesktop.DBus.Error.UnknownMethod

and a non working secret-service.

When the above mentioned pre-conditions are met, secret-service is working very well. Nevertheless there is one remaining issue: in case gnome-keyring is not installed and so secret-service is not available, the Cryptomator prefs show it as available, but the kdewallet backend is used instead.

There seems to be some missing bolt in integrations-linux. Maybe the result of calling isAvailable() isn't processed properly? I have not looked into that one.

Copy link
Member

@infeo infeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purejava Thanks for also reviewing this PR and digging a little bit deeper to find the problems.

@swiesend You need to do two things in library, before the PR is merged. The broken isSupported() method must be fixed. And a graceful handling of the case, when there is no "login" keyring present. (including no warning spam in the log).

For the latter case, maybe this can be integrated into the isSupported call.

pom.xml Outdated
@@ -39,7 +39,7 @@

<!-- runtime dependencies -->
<api.version>0.1.3</api.version>
<secret-service.version>1.2.1</secret-service.version>
<secret-service.version>1.3.0</secret-service.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.3.0 is still buggy (as is 1.4.0). This needs to be changed once a new release is out (1.4.x)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is 1.5.0

@purejava
Copy link
Contributor

Hi,

as we are addressing wishes here 😉:
Might it be possible @swiesend to level the Collection#isLocked() method up into the SimpleCollection, meaning to make it available there too?

This would help a lot to solve this one.

@swiesend: if you need any help with that, don't hesitate to ask.

- fix `SimpleCollection.isAvailable()`
- handle `org.freedesktop.DBus.Error.ServiceUnknown` errors
- log `org.freedesktop.DBus.Error.*` errors only in debug mode
@swiesend swiesend changed the title Use secret-service 1.3.1 or 1.4.0 if necessary Use secret-service 1.5.0 Feb 18, 2021
@swiesend
Copy link
Contributor Author

swiesend commented Feb 18, 2021

Hey folks! Sorry that I did not respond to this earlier!

The issues of my isAvailable() method should be solved now.

I tested 1.5.0 on:

  1. Kubuntu 20.04.1 without gnome-keyring.
  2. Kubuntu 20.04.1 with gnome-keyring, but no login collection (deleted via seahorse).
  3. Kubuntu 20.04.1 with gnome-keyring, with a login collection (manually created via seahorse).
  4. Ubuntu 20.04.1 with gnome-keyring and a login collection.

@infeo there is 1.5.0:

  • fix SimpleCollection.isAvailable()
  • handle org.freedesktop.DBus.Error.ServiceUnknown errors
  • log org.freedesktop.DBus.Error.* errors only in debug mode

@purejava Feel free to use the SimpleColletion.isLocked() method. But there is not yet a branch or PR where the org.cryptomator.integrations.keychain.KeychainAccessProvider interface provides a boolean isLocked(); method, right?

@infeo and @purejava can you please test this as well with the first 3 test cases. I find testing this manually in a virtual machine very tedious and error prone. I guess I had different behavior in the past as I accidentally started the launcher script as root and not as common user.

Copy link
Member

@infeo infeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is wonderful news :D

The isSupported() works now. (: If no login keyring is present, the log stays in non-debug mode clean and does not create any errors. Of course a user can still check to store the password, but it is not stored. While this is not perfect, for this PR the behaviour is sufficient.

Before merge, i'd like to wait for feedback fo @purejava to be absolutely sure to not to break anything.

@purejava
Copy link
Contributor

This is great news!
I'll happily test secret-service 1.5.0 as well.

@purejava
Copy link
Contributor

secret-service 1.5.0 is great!

I tested it on Kubuntu 20.04.1 with and without either gnome-keyring and kwallet-daemon installed.
isSupported() does work now and recognises when gnome-keyring (the backend itself) is missing or no login keyring was created. I am approving this PR too.

Of course a user can still check to store the password, but it is not stored. While this is not perfect, for this PR the behaviour is sufficient.

Did you test on Kubuntu 20.04.1 as well? In this case, this is due to the kwallet-daemon being available. The checkbox to remember a password should only get displayed in general, if a working backend is available and choosen in the prefs. On testing I noticed (and I think this is what you've experienced too) that, with gnome-keyring uninstalled and the according process killed, Gnome Keyring is available as a backend in the prefs. So this is a small bug that does not break anything but needs to be addressed in a new issue.

@infeo infeo merged commit d0688e2 into cryptomator:develop Feb 22, 2021
@infeo
Copy link
Member

infeo commented Feb 25, 2021

Did you test on Kubuntu 20.04.1 as well? In this case, this is due to the kwallet-daemon being available.

You missunderstood me, this is unrelated to kdewallet. If the GNOME keyring is installed and no keyring called "login" present, you can still select to store the password. But it won't get saved and after unlocking and relocking the vault, you have to reenter the passwords.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gnome-Keyring Access: RejectedExecutionException on shutdown or JVM shutdown blocked for minutes
3 participants