-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
"Invalid client serial" when used with xdg-dbus-proxy #177
Comments
Sorry I don't get it... Edit |
xdg-dbus-proxy is a utility used for separating apps that use dbus from the rest of the system, giving them only access to the specific services that they need. It creates its own dbus server and connects to the system's dbus server to proxy and filter calls. This is incredibly useful for any kind of sandboxing technology, such as flatpak and firejail. I am trying to get an app that uses dbus-java to run inside a sandbox whilst using xdg-dbus-proxy to restrict its access from most dbus services. My current trail of debugging has led me towards this library, as removing its transport jar changes the result of the execution, causing it to not connect to dbus at all, instead of hanging. I mention this as a "fix" since I don't rely on its dbus functionality, I just want the app to run. The version of dbus-java involved, according to the jar files in jetbrains-toolbox, is 4.0.0. |
Is there any sort of log produced by dbus-java? Usually dbus-java uses Slf4j with any slf4j compliant logger to log what's going on. Especially turning on TRACE-logging would definitely help to find out what is going on. |
I have no idea how to do that. |
Are you sure you are xdg-dbus-proxy the correct way? When using xdg-dbus-proxy and a patched version of jetbrains-toolbox (with logging enabled) I can see that dbus-java connects to the Bus for the handshaking stuff, but as soon as jetbrains-toolbox want to listen to signals of com.canonical.Unity.LauncherEntry the signal is not being answered and the socket is closed. |
I wasn't able to tell which dbus services it was trying to access, but yeah I reckon it needs a few whitelists to work. Still, I don't have a com.canonical.Unity.LauncherEntry on my system, so it should have the same behavior here? And if DBUS_SESSION_BUS_ADDRESS is set to some bogus value like "foo", it gracefully and silently fails as well.. |
This has to do with the exception handling of the calling code. When blocking certain calls the problem is different. While establishing connection to DBus worked (handshaking, sending Hello etc), specific calls get blocked. In that case the connection (at least in version 4.0.0) gets into some sort of half-disconnected behaviour, which causes the connection to be treated as connected when it actually isn't. When using 4.1.0 with your setup, the application will only block for about 10-20 seconds due to waiting for method replys which will never be received. I improved this in the latest 4.1.1 snapshot, so dbus-java will no longer wait for method-replies if the disconnection from the bus was caused by an The error message 'invalid client serial' you see is not from dbus-java but from some launcher used to start the jetbrains-toolbox. |
Thanks a lot for digging into this issue! Glad to know the mechanics of all of this now. It makes sense, as xdg-dbus-proxy works in a way many applications don't expect, but I guess I was confused since I've never seen similar behavior in other programs using dbus. Many thanks for implementing a workaround anyway, I'll be patiently waiting for that to trickle downstream :) And yeah, the "Invalid client serial" message comes from xdg-dbus-proxy itself: https://github.com/flatpak/xdg-dbus-proxy/blob/main/flatpak-proxy.c#L2182-L2190 |
Hi, I was trying to use Jetbrains Toolbox with xdg-dbus-proxy, and I encountered an issue with your library.
Specifically, if xdg-dbus-proxy's --filter option is being used, the app will hang on startup for about 5-10 minutes before continuing. Meanwhile, xdg-dbus-proxy spits out the following message:
steps to reproduce
Download the Jetbrains Toolbox app, then run the following:
Full xdg-dbus-proxy log:
temporary workaround
run jetbrains-toolbox like this instead:
This causes the app to never connect to dbus, bypassing the hang.
cross-linked issues
flatpak/xdg-dbus-proxy#45
netblue30/firejail#5265
The text was updated successfully, but these errors were encountered: