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

Secret Service not found in Docker Container #41

Open
xinyuxu1026 opened this issue Jul 21, 2023 · 4 comments
Open

Secret Service not found in Docker Container #41

xinyuxu1026 opened this issue Jul 21, 2023 · 4 comments

Comments

@xinyuxu1026
Copy link

Distro: AlmaLinux 8 container on top of Ubuntu 20.04 with privilege
secret-service version: 1.6.2
Error shows that

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: The secret service is not available.

Caused by: java.io.IOException: The secret service is not available.
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:277)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:57)

The org.freedesktop.secrets.service and org.gnome.keyring.service exist.

ls /usr/share/dbus-1/services/
ca.desrt.dconf.service                  org.freedesktop.secrets.service            org.gnome.keyring.SystemPrompter.service
org.freedesktop.systemd1.service           org.gnome.keyring.service
org.a11y.Bus.service                    org.gnome.keyring.PrivatePrompter.service  org.gtk.GLib.PACRunner.service

gnome-keyring is also running

ps aux | grep gnome-keyring
user    1217  0.0  0.0 154656  4864 ?        Sl   01:12   0:00 gnome-keyring-daemon --daemonize --login
user    1222  0.0  0.1 302364  9232 ?        Sl   01:12   0:00 gnome-keyring-daemon --unlock
user    1227  0.0  0.0      0     0 ?        Z    01:12   0:00 [gnome-keyring-d] <defunct>
user    1517  0.0  0.0   9220  1204 ?        S    01:13   0:00 grep gnome-keyring

We also have some keyring related tests running successfully in the container.

Why is it complaining about the secret service is not available?
Is there any general advice about how to run this in container?

Thank you very much.

@tanmaymanolkar1
Copy link

any updates on this bug? we are facing the same issue.

@purejava
Copy link
Contributor

Distro: AlmaLinux 8 container on top of Ubuntu 20.04 with privilege secret-service version: 1.6.2 Error shows that

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: The secret service is not available.

Caused by: java.io.IOException: The secret service is not available.
	at org.freedesktop.secret.simple.SimpleCollection.init(SimpleCollection.java:277)
	at org.freedesktop.secret.simple.SimpleCollection.<init>(SimpleCollection.java:57)

The java.io.IOException that hits you comes from the isAvailable() method returning false.

The method checks for certain services, registered on the bus, namely:

  • org.freedesktop.DBus
  • org.freedesktop.secrets
  • org.gnome.keyring

As you have these, the method probably fails on encrypting the session, which is done next.

It's hard to tell, what javax.crypto or java.security parts are missing in your container.

@xinyuxu1026
Copy link
Author

Thank you! @purejava , do you know how to install those parts? and is there a way to check which part is missing?

@purejava
Copy link
Contributor

Thank you! @purejava , do you know how to install those parts? and is there a way to check which part is missing?

No, I've never used Java inside a container.

According to the JavaDoc the javax.crypto implementation is provider-based.

Maybe another Java vendor works better?

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

No branches or pull requests

3 participants