Skip to content

System update with PackageKit fails on Debian Trixie #1034

@ali1234

Description

@ali1234

What happened

There are currently two problems preventing it from working correctly:

The first is that PackageKit added some new info enums: PackageKit/PackageKit@652afe1664

If one of these enums appears in the result of a get-updates then you will see something like this in moonraker.log:

Traceback (most recent call last):
  File "src/dbus_fast/message_bus.py", line 797, in dbus_fast.message_bus.BaseMessageBus._process_message
  File "/home/voron/moonraker-env/lib/python3.13/site-packages/dbus_fast/proxy_object.py", line 143, in _message_handler
    cb_result = handler.fn(*data)
  File "/home/voron/moonraker/moonraker/components/update_manager/system_deploy.py", line 396, in _on_package_signal
    info = PkEnum.Info.from_index(info_code)
  File "/home/voron/moonraker/moonraker/thirdparty/packagekit/enums.py", line 41, in from_index
    return cls(1 << index)
  File "/usr/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/enum.py", line 1211, in __new__
    raise exc
  File "/usr/lib/python3.13/enum.py", line 1188, in __new__
    result = cls._missing_(value)
  File "/usr/lib/python3.13/enum.py", line 1484, in _missing_
    raise ValueError(
    ...<2 lines>...
                ))
ValueError: <flag 'Info'> invalid value 134217728
    given 0b0 1000000000000000000000000000
  allowed 0b0 0111111111111111111111111111

The bigger problem however is that for some reason PackageKit has started sending some (not all) info enums not as their value, but as (value + (value<<16)). For example if pkcon get-updates says:

    Normal       7zip-25.01+dfsg-1~deb13u1.arm64 (debian-stable-main)

Then on dbus-monitor I see:

signal time=1763785284.718476 sender=:1.152 -> destination=(null destination) serial=100 path=/48_ceabecae; interface=org.freedesktop.PackageKit.Transaction; member=Packages
   array [
      struct {
         uint32 327685
         string "7zip;25.01+dfsg-1~deb13u1;arm64;debian-stable-main"
         string "7-Zip file archiver with a high compression ratio"
      }

PK_INFO_ENUM_NORMAL = 5, and 327685 = 5 + (5<<16)

Some other enums follow this same pattern of x + (x << 16), but others seems to still be transmitted normally.

Because Moonraker uses python Flag enums, it looks up an enum by doing 1<<info_code. 1<<327685 is a very large number, so large that printing the resulting exception itself causes an exception:

ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
2025-11-22 04:27:20,422 [runners.py:run()] - A message handler raised an exception: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
Traceback (most recent call last):
  File "src/dbus_fast/message_bus.py", line 797, in dbus_fast.message_bus.BaseMessageBus._process_message
  File "/home/voron/moonraker-env/lib/python3.13/site-packages/dbus_fast/proxy_object.py", line 143, in _message_handler
    cb_result = handler.fn(*data)
  File "/home/voron/moonraker/moonraker/components/update_manager/system_deploy.py", line 394, in _on_package_signal
    info = PkEnum.Info.from_index(info_code)
  File "/home/voron/moonraker/moonraker/thirdparty/packagekit/enums.py", line 41, in from_index
    return cls(1 << index)
  File "/usr/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/enum.py", line 1201, in __new__
    ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__))

Somehow PackageKit is mangling the enums when transmitting them, and then unmangling them when receiving them. But because Moonraker uses raw DBus calls to access PackageKit, it is seeing the mangled (extremely large) enums.

I don't yet understand why PackageKit is doing this, or whether it is DBus which is really responsible.

Also if this is happening with info enums then it could be happening with other enums too. I have not checked that.

Client

Fluidd

Browser

Firefox

How to reproduce

Install Klipper, Moonraker, Fluidd on Raspberry Pi OS Trixie, using all defaults. (You don't need to configure Klipper to reproduce. You don't even need a printer.)

Open Fluidd settings and click "Check for updates".

Additional information

moonraker.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions