Zwave timeout error cleanup issue with 0.45.1

I have a couple of devices I am adding to my z-stick that are at the very edge of connectivity. When I renamed them, I get the following timeout error. Since this is truly an “edge” condition and won’t be hit very often, it’s not something I’m worried about getting fixed, but I thought you might like to see the explosion that happens when the error happens. it might be good to trap the condition just in the interest of saving a couple of gig of disk space. :slight_smile:

2017-06-02 12:34:44 INFO (MainThread) [homeassistant.components.http] Serving /api/zwave/config/56 to 192.168.2.105 (auth: True)
**2017-06-02 12:34:44** INFO (MainThread) [homeassistant.components.http] Serving /api/zwave/groups/56 to 192.168.2.105 (auth: True)

Note the time difference

**2017-06-02 12:36:38** WARNING (Thread-14) [pychromecast.socket_client] Heartbeat timeout, resetting connection
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.components.http] Serving /api/zwave/usercodes/56 to 192.168.2.105 (auth: True)
2017-06-02 12:36:38 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.components.http] Serving /api/camera_proxy/camera.camera1 to 192.168.2.105 (auth: True)

2017-06-02 12:36:38 ERROR (MainThread) [haffmpeg.core] FFmpeg fails 
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/haffmpeg/core.py", line 114, in open
    stderr=stderr
  File "/usr/lib/python3.4/asyncio/subprocess.py", line 226, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 866, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/lib/python3.4/asyncio/unix_events.py", line 174, in _make_subprocess_transport
    yield from transp._post_init()
  File "/usr/lib/python3.4/asyncio/base_subprocess.py", line 106, in _post_init
    proc.stdin)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 797, in connect_write_pipe
    yield from waiter
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
concurrent.futures._base.CancelledError
2017-06-02 12:36:38 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/aiohttp/web_protocol.py", line 421, in start
    resp = yield from self._request_handler(request)
  File "/home/homeassistant/.homeassistant/deps/aiohttp/web.py", line 303, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 424, in handle
    result = yield from result
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 249, in get
    response = yield from self.handle(request, camera)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 269, in handle
    image = yield from camera.async_camera_image()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/ffmpeg.py", line 60, in async_camera_image
    extra_cmd=self._extra_arguments)
  File "/home/homeassistant/.homeassistant/deps/haffmpeg/tools.py", line 78, in get_image
    image, _ = yield from self._proc.communicate()
AttributeError: 'NoneType' object has no attribute 'communicate'
2017-06-02 12:36:38 ERROR (MainThread) [haffmpeg.core] FFmpeg fails 
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/haffmpeg/core.py", line 114, in open
    stderr=stderr
  File "/usr/lib/python3.4/asyncio/subprocess.py", line 226, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 866, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/lib/python3.4/asyncio/unix_events.py", line 174, in _make_subprocess_transport
    yield from transp._post_init()
  File "/usr/lib/python3.4/asyncio/base_subprocess.py", line 106, in _post_init
    proc.stdin)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 797, in connect_write_pipe
    yield from waiter
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
concurrent.futures._base.CancelledError
2017-06-02 12:36:38 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/aiohttp/web_protocol.py", line 421, in start
    resp = yield from self._request_handler(request)
  File "/home/homeassistant/.homeassistant/deps/aiohttp/web.py", line 303, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 424, in handle
    result = yield from result
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 249, in get
    response = yield from self.handle(request, camera)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/__init__.py", line 269, in handle
    image = yield from camera.async_camera_image()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/camera/ffmpeg.py", line 60, in async_camera_image
    extra_cmd=self._extra_arguments)
  File "/home/homeassistant/.homeassistant/deps/haffmpeg/tools.py", line 78, in get_image
    image, _ = yield from self._proc.communicate()
AttributeError: 'NoneType' object has no attribute 'communicate'
2017-06-02 12:36:38 INFO (Thread-10) [homeassistant.components.zwave] Renamed Z-Wave node 56 to shed_flood_lights
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.time=12:34; icon=mdi:clock, friendly_name=Time @ 2017-06-02T12:34:29.748830-05:00>, new_state=<state sensor.time=12:36; icon=mdi:clock, friendly_name=Time @ 2017-06-02T12:36:38.869470-05:00>, entity_id=sensor.time>
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.components.http] Serving /api/camera_proxy/camera.generic_camera to 192.168.2.105 (auth: True)
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1978856720-135>
2017-06-02 12:36:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.since_last_boot=1:26:44.756213; icon=mdi:clock, friendly_name=Since Last Boot @ 2017-06-02T12:34:29.785437-05:00>, new_state=<state sensor.since_last_boot=1:28:53.501664; icon=mdi:clock, friendly_name=Since Last Boot @ 2017-06-02T12:36:38.983930-05:00>, entity_id=sensor.since_last_boot>
2017-06-02 12:36:39 ERROR (MainThread) [haffmpeg.core] FFmpeg fails 
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/haffmpeg/core.py", line 114, in open
    stderr=stderr
  File "/usr/lib/python3.4/asyncio/subprocess.py", line 226, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 866, in subprocess_exec
    bufsize, **kwargs)
  File "/usr/lib/python3.4/asyncio/unix_events.py", line 174, in _make_subprocess_transport
    yield from transp._post_init()
  File "/usr/lib/python3.4/asyncio/base_subprocess.py", line 106, in _post_init
    proc.stdin)
  File "/usr/lib/python3.4/asyncio/base_events.py", line 797, in connect_write_pipe
    yield from waiter
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
concurrent.futures._base.CancelledError

And so on and so on for quite a while.