Products › lamco-dbus-tools › Use cases
Type of message does not match expected type: D-Bus InvalidArgs
Type of message does not match expected type: How a changed D-Bus method signature broke old clients with InvalidArgs, and the CI check that catches it.
A service's new version gives a method one more argument, and every client written for the old one fails at run time:
Error: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, “(s)”, does not match expected type “(su)”
lamco-dbus-tools caught it before the release with dbussee, which read the built service's own
description of its interface, and dbustell, whose drift failed the CI job on the change.
Real runs on 2026-11-30 on Debian 13, each job under dbus-run-session, with a development build of
lamco-dbus-tools, version 0.1.0, and run again with a later build with the same output. The service is made up for
this page, not a real one, in three versions: catalog.py. The stored interface is
com.example.Catalog.xml and the job ci.sh; every output quoted is in the use case's directory.
The change
Version 1 of a catalog service has Lookup(s key) -> s. Version 2 gives it a flags argument, Lookup(s
key, u flags) -> s: A small change, the method's name unchanged, and its own tests pass.
What an old client gets
$ gdbus call --session --dest com.example.Catalog --object-path /com/example/Catalog --method com.example.Catalog.Lookup widget
Error: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, “(s)”, does not match expected type “(su)”
Every program written for version 1 fails this way, at run time, on users' machines.
The job
The project keeps the interface's XML, as released with version 1. Its CI starts the built service on a bus of its own and holds it to that:
dbussee --quiet --out "live-v$VERSION.json" introspect com.example.Catalog
dbustell drift com.example.Catalog.xml "live-v$VERSION.json" --junit "drift-v$VERSION.xml"
Version 1:
0 changes, 0 breaking.
dbustell drift exit 0
Version 2:
Breaking, 1:
DRIFT-005 com.example.Catalog method Lookup: it takes (su) where it took (s)
1 changes, 1 breaking.
dbustell drift exit 1
<testsuite name="dbustell drift" tests="1" failures="1">
<testcase name="DRIFT-005 com.example.Catalog method Lookup">
<failure message="it takes (su) where it took (s)">it takes (su) where it took (s)</failure>
</testcase>
</testsuite>
The job fails before the release, naming the method and the change.
The fix
Add a method, and leave the old one: Version 2b has Lookup(s) -> s as before and LookupWithFlags(s, u)
-> s beside it.
New clients only, 1:
DRIFT-011 com.example.Catalog method LookupWithFlags: added
1 changes, 0 breaking.
dbustell drift exit 0
The old client works again, and a client that uses the new method knows it needs version 2b.
What made it catchable
- A description kept in the project, so "what we promised" is a file the job can read.
- The live service's own description, asked with the no-start flag, so the check is of what the build runs, not of what someone remembered to write down.
- A classification by what an old client sees: An added argument breaks, an added method doesn't.