Nmap program was not found in path

Since upgrading to the latest version of HA, I keep getting this in my home-assistant.log

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 693, in async_device_tracker_scan
    found_devices = yield from scanner.async_scan_devices()
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py", line 87, in scan_devices
    self._update_info()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 296, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/nmap_tracker.py", line 110, in _update_info
    scanner = PortScanner()
  File "/home/homeassistant/.homeassistant/deps/nmap/nmap.py", line 131, in __init__
    os.getenv('PATH')
nmap.nmap.PortScannerError: 'nmap program was not found in path. PATH is : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

However

/usr/bin/nmap

PATH contains /usr/bin and NMAP is definitely there because it was working before the upgrade and works from the command line.

Am I missing something in the 0.39 docs or should I report this as a bug?

when I rebuilt my server a few weeks back, I had to re-install nmap. you might want to give that a try.

sudo apt-get install nmap

2 Likes

This is the error I got due to the memory leak in 38.4.

https://github.com/home-assistant/home-assistant/issues/6165