cups-browsed repeatedly deletes/recreates a healthy driverless IPP-Everywhere queue via a self-triggering on_printer_modified() loop
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- c
- 領域
- backend, networking
調査の方向性
エントリポイント on_printer_modified() から開始し、CUPS 通知コールバックと並行して設定のバックアップアクションを追跡します。DebugLogging stderr で再現し、systemd のジャーナルと CUPS notifier のシグナルを調査します。正常で変更されていない DNS-SD キューが、自己トリガーによる変更ループや削除・再作成通知なしに維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
cups-browsed periodically tears down and recreates an already-working, unchanged implicitclass:// queue for a driverless IPP-Everywhere printer discovered via DNS-SD, roughly every 5-50 minutes with no external trigger (network state is stable, printer is idle and reachable the whole time). Debug logging shows this is caused by on_printer_modified() reacting to its own settings-backup action as if it were a new external modification, creating a self-triggering loop that sometimes cascades into a full delete-and-recreate of the queue. Each cycle fires a CUPS PrinterAdded/PrinterModified D-Bus notification, which downstream desktop components (e.g. GNOME's gsd-print-notifications) surface as a repeated "Printer Added" toast, even though nothing about the printer or network actually changed.
Environment
- OS: Ubuntu 26.04 LTS (Resolute Raccoon)
- Kernel:
7.0.0-27-generic cups-browsed:2.1.1-0ubuntu3cups/cups-daemon/cups-client/cups-common:2.4.16-1ubuntu1.3cups-filters:2.0.1-0ubuntu4.1libcups2t64:2.4.16-1ubuntu1.3- Printer: HP LaserJet MFP M235sdw, discovered via DNS-SD (
_ipps._tcpand_ipp._tcp, hostNPIDE7C12.local), driverless/IPP-Everywhere (printer-make-and-model: HP Printer, driverless, 2.1.1) - Queue backend:
implicitclass://HP_LaserJet_MFP_M235sdw_DE7C12/ - Network: single stable WiFi interface throughout (
wlp0s20f3), no interface/IP changes during the observed cycles /etc/cups/cups-browsed.conf(non-default/active lines only):BrowseRemoteProtocols dnssd DebugLogging stderr
What we ruled out before finding this
- Avahi was scoped to a single real interface (
allow-interfaces=wlp0s20f3in/etc/avahi/avahi-daemon.conf) - no change. - This machine happened to have two independent
cups-browsedinstances running in parallel (the apt-packagedcups-browsed.serviceand a separate one bundled in the OpenPrintingcupssnap,cups.cups-browsed), which we confirmed via a live D-Bus capture were both racing to manage the same queue (one's deletion explicitly logged as caused by the other). Disabling the duplicate snap-managed instance reduced noise but did not stop the core loop - it still reproduces with a singlecups-browsedinstance running cleanly. - Captured
org.freedesktop.Avahi.ServiceBrowserD-Bus traffic for 6+ hours during active reproduction and saw nothing -cups-browsedappears to talk to Avahi vialibavahi-clientdirectly rather than over D-Bus, so this isn't an Avahi re-announcement race visible at that layer.
Reproduction (debug log excerpt, DebugLogging stderr via systemd journal)
A tight self-triggering loop, five on_printer_modified() cycles in about 2 seconds with no external event between them:
Jul 09 00:48:19 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:48:19 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" modified by "cups-browsed".
Jul 09 00:48:21 cups-browsed[1198880]: Settings of printer HP_LaserJet_MFP_M235sdw_DE7C12 got modified, doing backup.
Jul 09 00:48:21 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" modified by "cups-browsed".
Jul 09 00:48:21 cups-browsed[1198880]: Settings of printer HP_LaserJet_MFP_M235sdw_DE7C12 got modified, doing backup.
Jul 09 00:48:21 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" is now available.
Jul 09 00:48:21 cups-browsed[1198880]: Settings of printer HP_LaserJet_MFP_M235sdw_DE7C12 got modified, doing backup.
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state change on printer HP_LaserJet_MFP_M235sdw_DE7C12: Now accepting jobs.
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state reasons: paused
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state change on printer HP_LaserJet_MFP_M235sdw_DE7C12: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" state changed to idle.
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state reasons: none
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state change on printer HP_LaserJet_MFP_M235sdw_DE7C12: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" state changed.
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer state reasons: none
Jul 09 00:48:21 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" modified by "cups-browsed".
Jul 09 00:48:21 cups-browsed[1198880]: Settings of printer HP_LaserJet_MFP_M235sdw_DE7C12 got modified, doing backup.
Jul 09 00:48:21 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:48:21 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" modified by "cups-browsed".
Jul 09 00:48:21 cups-browsed[1198880]: Settings of printer HP_LaserJet_MFP_M235sdw_DE7C12 got modified, doing backup.
About 7 minutes later this escalated into a full delete-and-recreate of the (still perfectly healthy) queue, again with no external trigger:
Jul 09 00:55:07 cups-browsed[1198880]: Printer discovered 1 times:
Jul 09 00:55:07 cups-browsed[1198880]: Printer discovered 0 times:
Jul 09 00:55:07 cups-browsed[1198880]: [CUPS Notification] Printer deleted: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" deleted by "cups-browsed".
Jul 09 00:55:13 cups-browsed[1198880]: on_printer_modified() in THREAD 126351861545856
Jul 09 00:55:13 cups-browsed[1198880]: [CUPS Notification] Printer modified: Printer "HP_LaserJet_MFP_M235sdw_DE7C12" is now available.
We also captured the corresponding org.cups.cupsd.Notifier D-Bus signals directly (via dbus-monitor --system "interface='org.cups.cupsd.Notifier'") confirming cupsd really does emit a fresh PrinterAdded for each recreation, which is what desktop notification daemons key off of:
member=PrinterDeleted: "Printer \"HP_LaserJet_MFP_M235sdw_DE7C12\" deleted by \"cups-browsed\"."
member=PrinterStopped: "Printer \"HP_LaserJet_MFP_M235sdw_DE7C12\" state changed to stopped."
member=PrinterAdded: "Printer \"HP_LaserJet_MFP_M235sdw_DE7C12\" was added."
member=PrinterModified: "Printer \"HP_LaserJet_MFP_M235sdw_DE7C12\" is now available."
Expected behavior
cups-browsed should not treat its own settings-backup side effect as an externally-originated printer modification, and should not repeatedly delete/recreate a queue for a printer whose DNS-SD presence and IPP attributes haven't actually changed.
Impact
Every cycle produces a desktop "Printer Added" notification (observed via GNOME on Wayland, but the underlying mechanism is the CUPS D-Bus notifier, not GNOME-specific), recurring indefinitely at irregular intervals for as long as the printer stays on the network. No print functionality is lost, but the recurring notification is a persistent, unexplained annoyance to end users, and this has previously led to workarounds like disabling cups-browsed or masking avahi-daemon entirely, both of which sacrifice legitimate DNS-SD printer discovery to work around this bug.
- 主要言語
- C
- スター
- 51
- フォーク
- 21
- 平均マージ
- 22時間 49分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenPrinting/cups-browsed のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
OpenPrinting/cups-browsed#82 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
OpenPrinting/cups-browsed#77 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
OpenPrinting/cups-browsed#76 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
OpenPrinting/cups-browsed#75 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
OpenPrinting/cups-browsed#71 ·
OpenPrinting/cups-browsed の issue をすべて見る
似ている issue
-
`sha256()` returns a wrong hash when libsql-ffi is built with gcc 11 or later対応中かも @colinhacks が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tursodatabase/libsql#2333 ·
メンテナーはふだん 11 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenPrinting/cups#1826 ·
メンテナーはふだん 1 日以内に返信
-
Backport to 3.0 advertises a suffix that does not exist対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
389ds/389-ds-base#8152 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RetroAchievements/rcheevos#580 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信