Products › lamco-dbus-tools › Use cases

org.freedesktop.DBus.Error.ServiceUnknown in a Flatpak app

org.freedesktop.DBus.Error.ServiceUnknown in a Flatpak app whose service is running: Find the grant it lacks, and test it against the real xdg-dbus-proxy.

A Flatpak application calls a service that's running, and it's told the service doesn't exist:

Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown

lamco-dbus-tools found the cause with dbussee, which read the application's grant and looked at the bus from inside the sandbox, and dbusdo, which gave the grant to the real xdg-dbus-proxy and showed it hiding the name.

A real run on 2026-11-30 on fedora45-gnome (a test VM, Fedora 45 Workstation, Flatpak 1.18.4, xdg-dbus-proxy 0.1.9), with a development build of lamco-dbus-tools, version 0.1.0. The application is made up for this page, not a real one: com.example.Notifier, whose whole program is notify-me, built and installed by run.sh and removed again; every output quoted is in the use case's directory.

The symptom

An application tells the desktop when a backup finishes. Run from a terminal it works; packaged as a Flatpak it fails:

$ sh notify-me
(uint32 1,)
$ flatpak run com.example.Notifier
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown

"Service unknown", although the notification service is running: The same call outside the sandbox was answered.

What the application is granted

$ dbussee sandbox show com.example.Notifier
Layers, merged in this order:
  runtime        .../org.freedesktop.Platform/x86_64/26.08/active/metadata  (nothing about the buses)
  application    .../com.example.Notifier/x86_64/master/active/metadata  (nothing about the buses)

The session bus, through the proxy with:
  --filter
  --own=com.example.Notifier.*
  --own=org.mpris.MediaPlayer2.com.example.Notifier.*
  --call=org.freedesktop.portal.*=*
  --broadcast=org.freedesktop.portal.*=@/org/freedesktop/portal/*

The system bus: None.

Each layer of the grant, and the options Flatpak builds from them for the proxy between the application and the bus. Nothing names org.freedesktop.Notifications.

What it sees

Run inside the sandbox, for one run with the directory holding the program shared:

$ flatpak run --filesystem=/var/tmp/uc3 --command=/var/tmp/uc3/bin/dbussee com.example.Notifier sandbox inside
Inside Flatpak: com.example.Notifier, instance 3439808731
  DBUS_SESSION_BUS_ADDRESS=unix:path=/run/flatpak/bus
The bus answered, id 05ce38eaf154f814e5b772a089f354ea. It shows 4 well-known names:
  org.freedesktop.DBus
  org.freedesktop.portal.Desktop
  org.freedesktop.portal.Documents
  org.freedesktop.portal.IBus

From inside, the service doesn't exist.

What the proxy does with it

dbusdo sandbox probe gives the application's grant to the machine's own xdg-dbus-proxy, on a private bus where stand-ins hold the names the real bus has, and asks:

$ dbusdo sandbox probe --app com.example.Notifier
389 probes, 78 names mirrored by stand-ins on a private bus. The proxy's own log gives each decision.

389 of 389 calls as the evaluator said:
  Ping org.freedesktop.Notifications                             hidden         answered org.freedesktop.DBus.Error.NameHasNoOwner
  Ping org.freedesktop.portal.Desktop                            passed         answered reply
  NameHasOwner org.freedesktop.Notifications                     made up        answered false
  GetNameOwner org.freedesktop.Notifications                     made up        answered org.freedesktop.DBus.Error.NameHasNoOwner

The proxy hides the name: A call to it is answered with an error as if no one owned it, and asked whether it has an owner, the proxy makes up the answer "no" itself. That's why the application's error says the service is unknown rather than that access was denied. (The probe's call and the application's got different errors, NameHasNoOwner and ServiceUnknown; both say the name isn't there.)

The fix

The grant the application lacks, given for one run:

$ flatpak run --talk-name=org.freedesktop.Notifications com.example.Notifier
(uint32 2,)

For good, it goes in the application's manifest as --talk-name=org.freedesktop.Notifications in finish-args. Or the application can use the notification portal, which every Flatpak application may call with no grant, as the --call=org.freedesktop.portal.*=* above says:

$ flatpak run --command=gdbus com.example.Notifier call --session --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.Notification.AddNotification backup "{'title': <'Backup done'>, 'body': <'Nightly backup finished'>}"
()

What made it findable

  • The error names the wrong cause. The grant, read in its layers, names the right one.
  • The view from inside shows what the application sees, which no tool outside the sandbox can.
  • The probe asks the real proxy, not a model of it, and says how each name is treated: Passed, hidden, or answered with something made up.

Related