Skip to content

UPnP: demote routine LAN-discovery log lines from critical to debug - #627

Merged
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:fix/upnp-demote-discovery-logs
May 15, 2026
Merged

UPnP: demote routine LAN-discovery log lines from critical to debug#627
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:fix/upnp-demote-discovery-logs

Conversation

@got3nks

@got3nks got3nks commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The SSDP discovery + service-walk paths in UPnPBase.cpp log a handful of routine lines at AddDebugLogLineC (critical — always visible to the user). On busy home LANs (mesh APs forwarding SSDP multicast but blocking HTTP, multi-vlan setups, IoT devices coming and going), these surface as a steady stream of warnings the user can't act on:

!2026-05-15 20:42:46: Universal Plug and Play: error(UPNP_DISCOVERY_ADVERTISEMENT_ALIVE): Error retrieving device description from http://192.168.11.179:49152/description.xml: UPNP_E_SOCKET_CONNECT(-204).
!2026-05-15 20:42:52: Universal Plug and Play: Uninteresting service detected: 'urn:schemas-upnp-org:service:WANDSLLinkConfig:1'. Ignoring.
!2026-05-15 20:42:52: Universal Plug and Play: Error subscribing to service ..., error: UPNP_E_SUBSCRIBE_UNACCEPTED.

Reported by @Stoatwblr in #622. PR #623 already drops the per-leaf-service-NT noise on the receive side; that intentionally lets upnp:rootdevice announcements through because they're opaque from SSDP and amule has to fetch the XML to know whether the source is an IGW. When that fetch fails (which it will for any reachable-by-SSDP / not-reachable-by-HTTP device), the current code logs at critical level — wrong choice for routine LAN noise.

Change

Demote 7 sites to AddDebugLogLineN:

  • "Error retrieving device description from ..." (UPnPBase.cpp:1285) — main spammer
  • "Uninteresting service detected: '...'" (:607)
  • Discovery ErrCode error (:1267)
  • "error(UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE): ..." (:1363)
  • Service-map internal lookup error (:1524)
  • "Error getting SCPD Document from ..." (:1761)
  • Subscribe-error goto error: path (:1768)

Each remains accessible via DebugLogTypes=UPnP for actual debugging.

Left at critical level (user-actionable / success notifications):

  • AddPortMapping / DeletePortMapping failures — port-mapping can't succeed, user should know
  • "Internet Gateway Device Detected" — confirms UPnP is working
  • "WAN Service Detected" / "Successfully retrieved SCPD Document" / "Successfully subscribed" — once-per-router success milestones
  • Programming-error paths (event-handler not implemented, UPnP misuse)

Validation

macOS arm64: monolithic amule rebuilds clean. No behaviour change — only log-level changes; the underlying discovery / port-mapping logic is unchanged.

Refs #622.

The SSDP discovery + service-walk paths log a handful of lines at
AddDebugLogLineC (critical -- always visible to the user), which on
busy home LANs fills stdout with messages the user can't act on:

  - "Error retrieving device description from <url>: ..." -- transient
    HTTP fetch failures from random LAN devices that announce via
    SSDP but block HTTP from amule's subnet (mesh APs, multi-vlan
    setups, IoT devices going offline)
  - "Uninteresting service detected: '...'" -- emitted as amule walks
    a downloaded description.xml; one line per service it doesn't
    consume. Useful for debugging, noise for users
  - "error(UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE): ..." -- BYEBYE event
    parse error, expected during LAN churn
  - "Error getting SCPD Document from ..." / subscribe-error path --
    routine, amule already retries

Demote those to AddDebugLogLineN. They stay accessible with
DebugLogTypes=UPnP enabled, but no longer surface to stdout for
users running the default log level. Keep user-actionable errors
(AddPortMapping/DeletePortMapping failures, "WAN Service not
detected" at port-map time) and success notifications (IGW
detected, SCPD retrieved, subscribed) at critical level so the
"is UPnP working?" UX is unchanged.

Reported by Stoatwblr in amule-project#622 -- a Zyxel mesh WAP that announces
SSDP rootdevice from a subnet whose HTTP is unreachable to amule
generated a steady stream of "Error retrieving device description"
lines. PR amule-project#623 already drops the per-leaf-service-NT noise; this
finishes the cleanup for the rootdevice case that amule-project#623 deliberately
lets through (rootdevice can't be classified without the XML).

Verified locally on macOS arm64: monolithic amule rebuilds clean.
@got3nks got3nks mentioned this pull request May 15, 2026
@Stoatwblr

Copy link
Copy Markdown

That shut it up, thanks :)

@mrjimenez
mrjimenez merged commit 7fb17c3 into amule-project:master May 15, 2026
12 checks passed
@got3nks
got3nks deleted the fix/upnp-demote-discovery-logs branch May 16, 2026 16:02
mrjimenez pushed a commit to mrjimenez/amule that referenced this pull request Jul 27, 2026
…list (amule-project#627)

Clicking a row on the download tab (and the shared-files / clients lists)
tripped a debug-build assert:

  assert "!GetImageList(wxIMAGE_LIST_SMALL)" failed in OnGetItemImage():
  List control has an image list, OnGetItemImage or OnGetItemColumnImage
  should be overridden.

These lists own-draw their rows (OnDrawItem) but inherit a small image
list from CMuleListCtrl. Once they moved to wxLC_VIRTUAL, wx started
querying the per-item image while caching a line (on hit-test/click), and
the generic wxListCtrl asserts when neither OnGetItemColumnImage nor
OnGetItemImage is overridden. Release builds compile the assert out but
still pay the pointless query.

Override both in the base CMuleVirtualListCtrl to report "no image" (-1);
the icons are painted by OnDrawItem, not by wx. Fixes it for all three
virtual lists at once (download, shared files, clients).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants