core icon indicating copy to clipboard operation
core copied to clipboard

hass startup error with ipv6 disabled <OSError: illegal IP address string passed to inet_pton>

Open centeljon opened this issue 1 year ago • 2 comments

The problem

homeassistant 2024.10.1 startup error only if ipv6 is disabled

homeassistant | 2024-10-05 18:29:28.286 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None) homeassistant | Traceback (most recent call last): homeassistant | File "/usr/src/homeassistant/homeassistant/components/dhcp/init.py", line 149, in _async_initialize homeassistant | await aiodhcpwatcher.async_init() homeassistant | File "/usr/local/lib/python3.12/site-packages/aiodhcpwatcher/init.py", line 217, in async_init homeassistant | await asyncio.get_running_loop().run_in_executor(None, _init_scapy) homeassistant | File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run homeassistant | result = self.fn(*self.args, **self.kwargs) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/aiodhcpwatcher/init.py", line 242, in _init_scapy homeassistant | from scapy.layers.dhcp import ( homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/dhcp.py", line 43, in homeassistant | from scapy.layers.inet import UDP, IP homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/inet.py", line 2541, in homeassistant | import scapy.layers.inet6 homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/inet6.py", line 110, in homeassistant | import scapy.route6 # noqa: F401 homeassistant | ^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 333, in homeassistant | conf.route6 = Route6() homeassistant | ^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 47, in init homeassistant | self.resync() homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 64, in resync homeassistant | self.routes = read_routes6() homeassistant | ^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 961, in read_routes6 homeassistant | cset = scapy.utils6.construct_source_candidate_set(prefix, plen, devaddrs) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 75, in construct_source_candidate_set homeassistant | if in6_isgladdr(addr) or in6_isuladdr(addr): homeassistant | ^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 784, in in6_isgladdr homeassistant | return in6_isincluded(str, '2000::', 3) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 714, in in6_isincluded homeassistant | temp = inet_pton(socket.AF_INET6, addr) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/pton_ntop.py", line 92, in inet_pton homeassistant | return socket.inet_pton(af, addr) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | OSError: illegal IP address string passed to inet_pton

What version of Home Assistant Core has the issue?

core-2024.10.1

What was the last working version of Home Assistant Core?

core-2024.9.2

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

homeassistant | 2024-10-05 18:29:28.286 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None) homeassistant | Traceback (most recent call last): homeassistant | File "/usr/src/homeassistant/homeassistant/components/dhcp/init.py", line 149, in _async_initialize homeassistant | await aiodhcpwatcher.async_init() homeassistant | File "/usr/local/lib/python3.12/site-packages/aiodhcpwatcher/init.py", line 217, in async_init homeassistant | await asyncio.get_running_loop().run_in_executor(None, _init_scapy) homeassistant | File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run homeassistant | result = self.fn(*self.args, **self.kwargs) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/aiodhcpwatcher/init.py", line 242, in _init_scapy homeassistant | from scapy.layers.dhcp import ( homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/dhcp.py", line 43, in homeassistant | from scapy.layers.inet import UDP, IP homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/inet.py", line 2541, in homeassistant | import scapy.layers.inet6 homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/layers/inet6.py", line 110, in homeassistant | import scapy.route6 # noqa: F401 homeassistant | ^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 333, in homeassistant | conf.route6 = Route6() homeassistant | ^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 47, in init homeassistant | self.resync() homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/route6.py", line 64, in resync homeassistant | self.routes = read_routes6() homeassistant | ^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/arch/linux/rtnetlink.py", line 961, in read_routes6 homeassistant | cset = scapy.utils6.construct_source_candidate_set(prefix, plen, devaddrs) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 75, in construct_source_candidate_set homeassistant | if in6_isgladdr(addr) or in6_isuladdr(addr): homeassistant | ^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 784, in in6_isgladdr homeassistant | return in6_isincluded(str, '2000::', 3) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/utils6.py", line 714, in in6_isincluded homeassistant | temp = inet_pton(socket.AF_INET6, addr) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/scapy/pton_ntop.py", line 92, in inet_pton homeassistant | return socket.inet_pton(af, addr) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | OSError: illegal IP address string passed to inet_pton

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

no error with ipv6 enabled

i see this error only with ipv6 disabled

i disabled ipv6 via: /boot/firmware/cmdline.txt .... ipv6.disable=1 .....

centeljon avatar Oct 05 '24 16:10 centeljon

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (dhcp) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of dhcp can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign dhcp Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


dhcp documentation dhcp source (message by IssueLinks)

home-assistant[bot] avatar Oct 06 '24 21:10 home-assistant[bot]

Same here with 2024.10.2

cyberdie avatar Oct 14 '24 09:10 cyberdie

Hi. This is a bug in Scapy 2.6.0 which was fixed in Scapy 2.6.1, sorry about that. You should be able to work around it by using either 2.5.0 or 2.6.1.

gpotter2 avatar Nov 05 '24 09:11 gpotter2

Next build should use 2.6.1

Thanks

bdraco avatar Nov 05 '24 19:11 bdraco