HelloZeroNet/ZeroNet · error · AnnounceError
Udp disabled by config
Error message
Udp disabled by config
What it means
announceTrackerUdp in the AnnounceBitTorrent plugin raises AnnounceError before creating a UdpTrackerClient when config.disable_udp is set. The UDP announce path is explicitly disabled by configuration, so the announce request for a udp:// tracker cannot proceed.
Source
Thrown at plugins/AnnounceBitTorrent/AnnounceBitTorrentPlugin.py:49
trackers = [tracker for tracker in trackers if not tracker.startswith("udp://")]
return trackers
def getTrackerHandler(self, protocol):
if protocol == "udp":
handler = self.announceTrackerUdp
elif protocol == "http":
handler = self.announceTrackerHttp
elif protocol == "https":
handler = self.announceTrackerHttps
else:
handler = super(SiteAnnouncerPlugin, self).getTrackerHandler(protocol)
return handler
def announceTrackerUdp(self, tracker_address, mode="start", num_want=10):
s = time.time()
if config.disable_udp:
raise AnnounceError("Udp disabled by config")
if config.trackers_proxy != "disable":
raise AnnounceError("Udp trackers not available with proxies")
ip, port = tracker_address.split("/")[0].split(":")
tracker = UdpTrackerClient(ip, int(port))
if helper.getIpType(ip) in self.getOpenedServiceTypes():
tracker.peer_port = self.fileserver_port
else:
tracker.peer_port = 0
tracker.connect()
if not tracker.poll_once():
raise AnnounceError("Could not connect")
tracker.announce(info_hash=self.site.address_sha1, num_want=num_want, left=431102370)
back = tracker.poll_once()
if not back:
raise AnnounceError("No response after %.0fs" % (time.time() - s))
elif type(back) is dict and "response" in back:
peers = back["response"]["peers"]View on GitHub (pinned to 454c0b2e7e)
Solutions
- Set disable_udp = False in the Tribler configuration to enable UDP announces.
- Remove udp:// trackers from the torrent, or prefer HTTP(S) trackers.
- Update the plugin/config so UDP trackers are filtered out when disabled.
Example fix
# before (Tribler config) disable_udp = True # after disable_udp = False
Defensive patterns
Strategy: try-catch
Validate before calling
def can_announce_udp(config):
return not getattr(config, 'disable_udp', False)
# call before announceTrackerUdp
Try / catch
try:
self.announceTrackerUdp(tracker_address, mode)
except AnnounceError as e:
if "Udp disabled by config" in str(e):
logger.warning("Skipping UDP announce: disabled by config")
else:
raise Prevention
- Check config.disable_udp before scheduling UDP announces.
- Filter udp:// trackers out of the tracker list when UDP is disabled.
- Document the disable_udp setting for deployment ops.
When it happens
Trigger: Announcing to a UDP tracker (announceTrackerUdp) while the app config has disable_udp = True.
Common situations: Deployment or docker config where UDP was turned off (firewall/NAT problems, server hardening) while torrents still have udp:// trackers; users hitting UDP announces after an ops config change.
Related errors
- Udp trackers not available with proxies
- Could not connect
- No response after %.0fs
- Invalid response: %r
- Invalid response: %s
AI-assisted analysis of HelloZeroNet/ZeroNet@454c0b2e7e (2026-09-02).
Data as JSON: /api/errors/9dcf1a390804e6f4.
Report an issue: GitHub.