active_units_by_patterns() in src/systemd/unit.rs:71-87 filters the reply of list_units_by_patterns() on the typed systemd_zbus::ActiveState. The typed bindings reject a state string they do not know, and that fails the whole reply, not just the entry:
systemd-zbus 5.3.2 (newest release) deserializes the states with from_str (src/lib.rs:26-33), which errors on anything unknown (:96).
SubState is missing 5 states systemd 255 reports: dead-before-auto-restart, failed-before-auto-restart, dead-resources-pinned, reload-notify, reload-signal. ActiveState and LoadState are complete for systemd 250 (kirkstone) and 255 (scarthgap), but a systemd bump in the Yocto layer can add a state at any time.
So a wifi-commissioning-service@*.service instance in a state the crate does not know makes active_iface() (src/twin/wifi_commissioning.rs:252) return an error instead of the interface name. The blast radius is small: the pattern limits the reply to the wifi commissioning units, and the failure is not silent.
The update validation had the same problem with a much larger blast radius (it lists all units, and a failed poll can roll a healthy update back). It was fixed in #206 by reading the unit list through a local proxy whose struct has the states as String (src/systemd/mod.rs, commit f9ee5cc), with a test that asserts the zvariant signature (ssssssouso).
Suggested fix: read the patterned unit list the same way, so an unknown state stays uninteresting instead of fatal. The ListedUnit struct and the SystemdManager proxy in src/systemd/mod.rs can be shared; ListUnitsByPatterns has the same return signature as ListUnits.
Found during the review of #206.
active_units_by_patterns()insrc/systemd/unit.rs:71-87filters the reply oflist_units_by_patterns()on the typedsystemd_zbus::ActiveState. The typed bindings reject a state string they do not know, and that fails the whole reply, not just the entry:systemd-zbus5.3.2 (newest release) deserializes the states withfrom_str(src/lib.rs:26-33), which errors on anything unknown (:96).SubStateis missing 5 states systemd 255 reports:dead-before-auto-restart,failed-before-auto-restart,dead-resources-pinned,reload-notify,reload-signal.ActiveStateandLoadStateare complete for systemd 250 (kirkstone) and 255 (scarthgap), but a systemd bump in the Yocto layer can add a state at any time.So a
wifi-commissioning-service@*.serviceinstance in a state the crate does not know makesactive_iface()(src/twin/wifi_commissioning.rs:252) return an error instead of the interface name. The blast radius is small: the pattern limits the reply to the wifi commissioning units, and the failure is not silent.The update validation had the same problem with a much larger blast radius (it lists all units, and a failed poll can roll a healthy update back). It was fixed in #206 by reading the unit list through a local proxy whose struct has the states as
String(src/systemd/mod.rs, commit f9ee5cc), with a test that asserts the zvariant signature(ssssssouso).Suggested fix: read the patterned unit list the same way, so an unknown state stays uninteresting instead of fatal. The
ListedUnitstruct and theSystemdManagerproxy insrc/systemd/mod.rscan be shared;ListUnitsByPatternshas the same return signature asListUnits.Found during the review of #206.