D-Bus services not working on foreign distributions/non-user profiles

OpenSubmitted by Maxim Cournoyer.
Details
5 participants
  • John Kehayias
  • Leo Prikler
  • Leo Famulari
  • Maxim Cournoyer
  • zimoun
Owner
unassigned
Severity
normal
Merged with
M
M
Maxim Cournoyer wrote on 20 May 2021 17:20
(name . bug-guix)(address . bug-guix@gnu.org)
8735uhzb2a.fsf@gmail.com
Hello,

On Guix System, the D-bus session service honors D-Bus service
definitions found under ~/.guix-profile/share. That is not the case on
foreign distributions, breaking applications such as Jami (where the
daemon is normally auto-launched via D-Bus at the time the client
attempts to use it).

The same problem occurs on Guix System when attempting to use D-Bus
services from a non-user profile (such as with 'guix environment
--ad-hoc').

We should try to find a way to make this work; either automatically
(seems a tough nut to crack) or through manual, documented steps.

Thanks,

Maxim
M
M
Maxim Cournoyer wrote on 20 May 2021 19:18
Re: bug#48538: D-Bus services do not work on foreign distributions/non-user profiles
(address . 48538@debbugs.gnu.org)
87wnrtxr13.fsf@gmail.com
This can be verified on a system where the jami-daemon (libring) has not
yet been installed (commonly via propagation from one of the jami
clients):

$ guix environment --ad-hoc jami-gnome -- jami-gnome

Attempt to run it:

$ jami-gnome

It should fail with the following message: "Could not rec-connect to the
Jami daemon (dring). Jami will now quit."


as the currently running dbus session doesn't know about
the newly installed D-Bus service, as it only look under a few
hard-coded places.

For this particular instance, a workaround is to run jami via the
dbus-run-session utility, which launches the client in an ad-hoc d-bus
session which knows about the dring D-Bus service (through the
XDG_DATA_DIRS variable set by glib's search path).

$ guix environment --pure --ad-hoc jami-gnome dbus glib \
-- dbus-run-session jami-gnome

The glib package is added for its XDG_DATA_DIRS search path. It works
because the client doesn't really care about being able to talk to
anything else but its daemon over D-Bus.
Z
Z
zimoun wrote on 27 May 2021 20:54
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 48538@debbugs.gnu.org)
86y2c0m2h2.fsf@gmail.com
Hi Maxim,


On Thu, 20 May 2021 at 13:18, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

Toggle quote (12 lines)
> For this particular instance, a workaround is to run jami via the
> dbus-run-session utility, which launches the client in an ad-hoc d-bus
> session which knows about the dring D-Bus service (through the
> XDG_DATA_DIRS variable set by glib's search path).
>
> $ guix environment --pure --ad-hoc jami-gnome dbus glib \
> -- dbus-run-session jami-gnome
>
> The glib package is added for its XDG_DATA_DIRS search path. It works
> because the client doesn't really care about being able to talk to
> anything else but its daemon over D-Bus.

On Debian, using 014421e, I get:

Toggle snippet (24 lines)
$ guix environment --pure --ad-hoc jami-gnome dbus glib \
-- dbus-run-session jami-gnome
** Message: 20:50:31.130: Jami GNOME client version: development
** Message: 20:50:31.130: git ref: unknown
dbus-daemon[24024]: [session uid=1001 pid=24024] Activating service name='cx.ring.Ring' requested by ':1.1' (uid=1001 pid=24025 comm="jami-gnome ")
Jami Daemon 9.10.0, by Savoir-faire Linux 2004-2019
https://jami.net/
[Video support enabled]
[Plugins support enabled]

dbus-daemon[24024]: [session uid=1001 pid=24024] Successfully activated service 'cx.ring.Ring'
20:50:31.556 os_core_unix.c !pjlib 2.10 for POSIX initialized
ALSA lib conf.c:3725:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so (/gnu/store/z1iyvbvnkd7zkjxsx157n6qx2iwzxq7p-alsa-lib-1.2.4/lib/alsa-lib/libasound_module_conf_pulse.so: cannot open shared object file: No such file or directory)
ALSA lib control.c:1471:(snd_ctl_open_noupdate) Invalid CTL hw:0
No accounts to migrate

(jami-gnome:24025): libnotify-WARNING **: 20:50:31.600: Failed to connect to proxy
QDBusMarshaller: type `VectorString' attempts to redefine basic D-BUS type 'as' (QStringList) (Did you forget to call beginStructure() ?)
QDBusMarshaller: type `MapStringVectorString' produces invalid D-BUS signature `a{s}' (Did you forget to call beginStructure() ?)
QDBusMarshaller: type `QMap<QString,MapStringVectorString>' produces invalid D-BUS signature `a{s}' (Did you forget to call beginStructure() ?)

(jami-gnome:24025): GLib-GIO-ERROR **: 20:50:31.711: Settings schema 'org.gtk.Settings.FileChooser' is not installed

Well, it means I have some misconfigured about ALSA, right?


Cheers,
simon
L
L
Leo Famulari wrote on 27 May 2021 21:20
(name . zimoun)(address . zimon.toutoune@gmail.com)
YK/xBdzrzxJrUSQg@jasmine.lan
On Thu, May 27, 2021 at 08:54:49PM +0200, zimoun wrote:
Toggle quote (1 lines)
> ALSA lib conf.c:3725:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so (/gnu/store/z1iyvbvnkd7zkjxsx157n6qx2iwzxq7p-alsa-lib-1.2.4/lib/alsa-lib/libasound_module_conf_pulse.so: cannot open shared object file: No such file or directory)
[...]
Toggle quote (3 lines)
>
> Well, it means I have some misconfigured about ALSA, right?

Did you install alsa-plugins and alsa-plugins:pulseaudio ?

If you do that, then it should "just work" on other distros.
Z
Z
zimoun wrote on 27 May 2021 21:59
(name . Leo Famulari)(address . leo@famulari.name)
86r1hslzhk.fsf@gmail.com
Hi Leo,

On Thu, 27 May 2021 at 15:20, Leo Famulari <leo@famulari.name> wrote:
Toggle quote (8 lines)
> On Thu, May 27, 2021 at 08:54:49PM +0200, zimoun wrote:
>> ALSA lib conf.c:3725:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so (/gnu/store/z1iyvbvnkd7zkjxsx157n6qx2iwzxq7p-alsa-lib-1.2.4/lib/alsa-lib/libasound_module_conf_pulse.so: cannot open shared object file: No such file or directory)
> [...]
>>
>> Well, it means I have some misconfigured about ALSA, right?
>
> Did you install alsa-plugins and alsa-plugins:pulseaudio ?

Do you mean

guix environment --pure --ad-hoc jami-gnome dbus glib \
alsa-plugins alsa-plugins:pulseaudio \
-- dbus-run-session jami-gnome

? If yes, there is still errors:

Toggle snippet (20 lines)
** Message: 21:45:49.955: Jami GNOME client version: development
** Message: 21:45:49.956: git ref: unknown
dbus-daemon[12101]: [session uid=1001 pid=12101] Activating service name='cx.ring.Ring' requested by ':1.1' (uid=1001 pid=12102 comm="jami-gnome ")
Jami Daemon 9.10.0, by Savoir-faire Linux 2004-2019
https://jami.net/
[Video support enabled]
[Plugins support enabled]

dbus-daemon[12101]: [session uid=1001 pid=12101] Successfully activated service 'cx.ring.Ring'
21:45:50.388 os_core_unix.c !pjlib 2.10 for POSIX initialized
No accounts to migrate

(jami-gnome:12102): libnotify-WARNING **: 21:45:50.693: Failed to connect to proxy
QDBusMarshaller: type `VectorString' attempts to redefine basic D-BUS type 'as' (QStringList) (Did you forget to call beginStructure() ?)
QDBusMarshaller: type `MapStringVectorString' produces invalid D-BUS signature `a{s}' (Did you forget to call beginStructure() ?)
QDBusMarshaller: type `QMap<QString,MapStringVectorString>' produces invalid D-BUS signature `a{s}' (Did you forget to call beginStructure() ?)

(jami-gnome:12102): GLib-GIO-ERROR **: 21:45:50.807: Settings schema 'org.gtk.Settings.FileChooser' is not installed

the ’--pure’ is not the issue. It is probably different but it rings a
bell with bug#47106.



Cheers,
simon
L
L
Leo Famulari wrote on 27 May 2021 22:14
(name . zimoun)(address . zimon.toutoune@gmail.com)
YK/9sPya8cFZ+nj7@jasmine.lan
On Thu, May 27, 2021 at 09:59:19PM +0200, zimoun wrote:
Toggle quote (6 lines)
> Do you mean
>
> guix environment --pure --ad-hoc jami-gnome dbus glib \
> alsa-plugins alsa-plugins:pulseaudio \
> -- dbus-run-session jami-gnome

Yes

Toggle quote (3 lines)
>
> ? If yes, there is still errors:

Okay, but not from ALSA :) So, at least you have eliminated ALSA
problems from your test.
L
L
Leo Prikler wrote on 28 May 2021 01:17
8ef0cc61d63992486f0d1bad0084207a7a526eaf.camel@student.tugraz.at
Am Donnerstag, den 27.05.2021, 21:59 +0200 schrieb zimoun:
Toggle quote (57 lines)
> Hi Leo,
>
> On Thu, 27 May 2021 at 15:20, Leo Famulari <leo@famulari.name> wrote:
> > On Thu, May 27, 2021 at 08:54:49PM +0200, zimoun wrote:
> > > ALSA lib conf.c:3725:(snd_config_hooks_call) Cannot open shared
> > > library libasound_module_conf_pulse.so
> > > (/gnu/store/z1iyvbvnkd7zkjxsx157n6qx2iwzxq7p-alsa-lib-
> > > 1.2.4/lib/alsa-lib/libasound_module_conf_pulse.so: cannot open
> > > shared object file: No such file or directory)
> > [...]
> > > Well, it means I have some misconfigured about ALSA, right?
> >
> > Did you install alsa-plugins and alsa-plugins:pulseaudio ?
>
> Do you mean
>
> guix environment --pure --ad-hoc jami-gnome dbus glib \
> alsa-plugins alsa-plugins:pulseaudio \
> -- dbus-run-session jami-gnome
>
> ? If yes, there is still errors:
>
> --8<---------------cut here---------------start------------->8---
> ** Message: 21:45:49.955: Jami GNOME client version: development
> ** Message: 21:45:49.956: git ref: unknown
> dbus-daemon[12101]: [session uid=1001 pid=12101] Activating service
> name='cx.ring.Ring' requested by ':1.1' (uid=1001 pid=12102
> comm="jami-gnome ")
> Jami Daemon 9.10.0, by Savoir-faire Linux 2004-2019
> https://jami.net/
> [Video support enabled]
> [Plugins support enabled]
>
> dbus-daemon[12101]: [session uid=1001 pid=12101] Successfully
> activated service 'cx.ring.Ring'
> 21:45:50.388 os_core_unix.c !pjlib 2.10 for POSIX initialized
> No accounts to migrate
>
> (jami-gnome:12102): libnotify-WARNING **: 21:45:50.693: Failed to
> connect to proxy
> QDBusMarshaller: type `VectorString' attempts to redefine basic D-BUS
> type 'as' (QStringList) (Did you forget to call beginStructure() ?)
> QDBusMarshaller: type `MapStringVectorString' produces invalid D-BUS
> signature `a{s}' (Did you forget to call beginStructure() ?)
> QDBusMarshaller: type `QMap<QString,MapStringVectorString>' produces
> invalid D-BUS signature `a{s}' (Did you forget to call
> beginStructure() ?)
>
> (jami-gnome:12102): GLib-GIO-ERROR **: 21:45:50.807: Settings schema
> 'org.gtk.Settings.FileChooser' is not installed
> --8<---------------cut here---------------end--------------->8---
>
> the ’--pure’ is not the issue. It is probably different but it rings
> a
> bell with bug#47106.
>
> <http://issues.guix.gnu.org/issue/47106>
It is different. The cause of your issue is probably, that you're
lacking gsettings-desktop-schemas or something similar to it inside
your environment. Perhaps we could try forming a "gnome-base"
metapackage, that propagates all of dbus, glib, gsettings-schemas etc.
for such purposes (maybe on wip-gnome first)?

Regards,
Leo

PS: Command just ran through

Toggle snippet (8 lines)
** Message: 00:57:50.154: Jami GNOME client version: development
** Message: 00:57:50.154: git ref: unknown
No protocol specified

** (jami-gnome:27881): ERROR **: 00:57:50.217: Could not init clutter :
0

I'm sure you know about -E XAUTHORITY by now, but imo we should have a
switch similar to --networking for container operations.

PPS: Just adding gsettings-desktop-schemas didn't work. "jami-gnome
glib gnome" obviously works, but that's a little overkill (also it
appears that you'll have to get credentials into this thing, which I
haven't bothered worrying about).
M
M
Maxim Cournoyer wrote on 28 May 2021 04:17
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
87tumniouo.fsf@gmail.com
Hi!

Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (5 lines)
> PPS: Just adding gsettings-desktop-schemas didn't work. "jami-gnome
> glib gnome" obviously works, but that's a little overkill (also it
> appears that you'll have to get credentials into this thing, which I
> haven't bothered worrying about).

No credentials are needed; it asked to register your username by
default, but pressing the 'skip' button will, well, skip that step and
go straight to creating your account (which is just a private key on
your device, basically).

Maxim
M
M
Maxim Cournoyer wrote on 28 May 2021 07:10
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
87lf7ziguj.fsf@gmail.com
Hi Leo & Simon,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (21 lines)
> Am Donnerstag, den 27.05.2021, 21:59 +0200 schrieb zimoun:
>> Hi Leo,
>>
>> On Thu, 27 May 2021 at 15:20, Leo Famulari <leo@famulari.name> wrote:
>> > On Thu, May 27, 2021 at 08:54:49PM +0200, zimoun wrote:
>> > > ALSA lib conf.c:3725:(snd_config_hooks_call) Cannot open shared
>> > > library libasound_module_conf_pulse.so
>> > > (/gnu/store/z1iyvbvnkd7zkjxsx157n6qx2iwzxq7p-alsa-lib-
>> > > 1.2.4/lib/alsa-lib/libasound_module_conf_pulse.so: cannot open
>> > > shared object file: No such file or directory)
>> > [...]
>> > > Well, it means I have some misconfigured about ALSA, right?
>> >
>> > Did you install alsa-plugins and alsa-plugins:pulseaudio ?
>>
>> Do you mean
>>
>> guix environment --pure --ad-hoc jami-gnome dbus glib \
>> alsa-plugins alsa-plugins:pulseaudio \
>> -- dbus-run-session jami-gnome

We're drifting off topic for this issue (which is supposed to be about
D-Bus rather than Jami on foreign distributions :-)), but for the sake
of completion, the following works (tested on a Debian 10 i386 VM):

$ guix environment --ad-hoc jami-gnome dbus glib gtk+ openssl nss-certs \
-- dbus-run-session jami-gnome

Apparently the FileChooser schema is provided by gtk+. I also found out
that OpenSSL from Guix wants the SSL_* environment variable sets, so I
added the nss-certs and openssl packages to the mix (otherwise you
wouldn't have been able to search for contacts).

I think for gtk+/glib this can be improved by adding the
glib-or-gtk-build-system phases to the jami-gnome package definition.

HTH!

Maxim
L
L
Leo Prikler wrote on 28 May 2021 08:35
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
68190d6a7441ec99c11f7dc06f7e89209033d4e8.camel@student.tugraz.at
Am Donnerstag, den 27.05.2021, 22:17 -0400 schrieb Maxim Cournoyer:
Toggle quote (16 lines)
> Hi!
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > PPS: Just adding gsettings-desktop-schemas didn't work. "jami-
> > gnome
> > glib gnome" obviously works, but that's a little overkill (also it
> > appears that you'll have to get credentials into this thing, which
> > I
> > haven't bothered worrying about).
>
> No credentials are needed; it asked to register your username by
> default, but pressing the 'skip' button will, well, skip that step
> and
> go straight to creating your account (which is just a private key on
> your device, basically).
That's probably a difference in what data already exists. At the very
least, it tried accessing the SecretService on my machine, but I don't
know for which purpose and as you pointed out in your other mail, we
are drifting off-topic :)
J
J
John Kehayias wrote on 17 Aug 2021 04:57
D-Bus services not working on foreign distributions/non-user profiles
(name . 48538@debbugs.gnu.org)(address . 48538@debbugs.gnu.org)
s9KS77vJYU10chcL1bQ4bd2AZA0o_nbuaOEYTEuN7EkNAo7l2RCNN6DcwFyfcSMahemBTdWXMoZgsGOwZSZxC1thX_0ENptgh1HLgJqE5lY=@protonmail.com
Hi everyone,

I also ran into this issue, where I've put all my packages in various profiles, with the default one being empty (outside of short-lived packages for trying out). This is a setup is mentioned in the cookbook, on profiles and manifests.

Since the dbus files are not in the default profile, I was running into issues with dbus seeing them with the default system daemon (from %desktop-services). As suggested above, one workaround is to use dbus-run-session to launch a program (no problems).

I found a better one for me, which may be due to how I run my desktop session. I use the default gdm but just an .xsession file (which is just my .xinitrc, like a plain startx setup). If I modify my WM start in the final line from just `exec WM` to `dbus-launch --exit-with-session WM` that works for me. Seems to be an issue of how the dbus daemon is run. Could also be a side effect from not adding the xsession properly to gdm, but I haven't tried with .desktop files yet. (Another work around suggested on IRC was to start a user daemon from the login profile; this didn't work for me.) Also note that I did have glib in the profile, so that XDG_DATA_DIRS was properly in the profile, and all profiles loaded at login.

Hope this is helpful and that we can find a proper solution, as I think this is a tricky bug to encounter for a user.

John
J
J
John Kehayias wrote on 17 Aug 2021 06:32
(name . 48538@debbugs.gnu.org)(address . 48538@debbugs.gnu.org)
qdVOoas4s50ARx1FsMgZ_Ttu_izfVZ6cV1SzIgCKYqdqwbkgk0yMMXtmX2CqgrejPzcn9kDFzVj_V39TDkBSGGvdzOwSzLJxCwLPDHqysxE=@protonmail.com
It looks like dbus-daemon-wrapper tries to take care of this by finding the user's profile, but this would just be the default one: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/xorg.scm#n851

Not sure if it is easy for the service to find a non-standard profile, or if this should be exposed some other way.
M
M
Maxim Cournoyer wrote on 1 Nov 2021 18:34
control message for bug #48538
(address . control@debbugs.gnu.org)
871r3z93un.fsf@gmail.com
forcemerge 48538 51439
quit
M
M
Maxim Cournoyer wrote on 5 Nov 2021 05:53
(address . control@debbugs.gnu.org)
87bl2z430e.fsf@gmail.com
forcemerge 48538 51438
quit
?