Skip to content

KeyError: 'netmask' during the device discovery #223

@illya-laifu

Description

@illya-laifu

Distribution

6.13.5-artix1-1

Package version

1.8.8

Frequency

Always

Bug description

Warpinator is unable to discover remote devices. When it is ran in the debug mode, an error is shown:

Traceback (most recent call last):
  File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "src/zeroconf/_services/browser.py", line 811, in zeroconf._services.browser.ServiceBrowser.run
  File "src/zeroconf/_services/browser.py", line 730, in zeroconf._services.browser._ServiceBrowserBase._fire_service_state_changed_event
  File "src/zeroconf/_services/browser.py", line 740, in zeroconf._services.browser._ServiceBrowserBase._fire_service_state_changed_event
  File "src/zeroconf/_services/__init__.py", line 56, in zeroconf._services.Signal.fire
  File "src/zeroconf/_services/browser.py", line 305, in zeroconf._services.browser._on_change_dispatcher
  File "/usr/lib/warpinator/server.py", line 183, in add_service
    if not self.netmon.same_subnet(remote_ip_info):
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/warpinator/networkmonitor.py", line 151, in same_subnet
    self.current_ip_info.ip4["netmask"]))
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'netmask'

To be sure that this was the exact problem, I modified the same_subnet function, to early return with True - and was able to discover the android device.

Steps to reproduce

  1. Start remote Warpinator instance (in my case Warpinator client)
  2. Start local instance of Warpinator in debug mode.
  3. When the local instance of Warpinator discovers the remote device, a KeyError is thrown originating from networkmonitor.py:151

Expected behavior

Device discovery works, and I am able to discover devices on my network.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions