MatthewFlamm / nwsradar

Home assistant custom camera platform for NWS radar loops
MIT License
20 stars 2 forks source link

Repetitive Error in HA Logs #2

Closed chipriley closed 5 years ago

chipriley commented 5 years ago

I am getting the same error repetitively in my HA logs. It seems to be from this integration but I could be mistaken. Here's what keeps repeating:

2019-09-10 15:58:14 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 231, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 128, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 496, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 513, in handle
    image = await camera.async_camera_image()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/nwsradar/camera.py", line 67, in camera_image
    self.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/nwsradar/camera.py", line 79, in update
    self._cam.update()
  File "/usr/local/lib/python3.7/site-packages/nws_radar/nws_radar.py", line 69, in update
    self._warning_files)
  File "/usr/local/lib/python3.7/site-packages/nws_radar/nws_radar.py", line 108, in _update_mult_images
    imag = self.retrieve_image(f)
  File "/usr/local/lib/python3.7/site-packages/nws_radar/nws_radar.py", line 76, in retrieve_image
    return Image.open(res.raw)
  File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2822, in open
    raise IOError("cannot identify image file %r" % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7f774538f0>
2019-09-10 15:58:28 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.ewx is taking over 10 seconds
2019-09-10 15:58:49 WARNING (MainThread) [homeassistant.components.camera] Updating nwsradar camera took longer than the scheduled update interval 0:00:30
2019-09-10 15:59:20 WARNING (MainThread) [homeassistant.components.camera] Updating nwsradar camera took longer than the scheduled update interval 0:00:30
2019-09-10 15:59:51 WARNING (MainThread) [homeassistant.components.camera] Updating nwsradar camera took longer than the scheduled update interval 0:00:30
2019-09-10 16:00:22 WARNING (MainThread) [homeassistant.components.camera] Updating nwsradar camera took longer than the scheduled update interval 0:00:30

Any ideas?

Platform: Hassio 0.98.5 running on a RPi4 (x64) (BETA Image) HassOS 3.4 Hass.io Supervisor 185

MatthewFlamm commented 5 years ago

Thanks for the report. I think this is caused by the file being reported as available, but it doesn't exist when it is requested. I have captured this cryptically in https://github.com/MatthewFlamm/nws_radar/issues/1. It seems like your radar station must have this problem more often than mine.

Are you using the latest version of this integration? If so are you using the standard or enhanced style? I think the enhanced style will also suffer more often from this problem.

Edit: the enhanced style was the only available at first.

chipriley commented 5 years ago

I’m running the latest version and using the enhanced style. That’s probably the issue. Thanks for the info.

MatthewFlamm commented 5 years ago

It's not wrong to use the enhanced style. This helps to know that people are only seeing it in that portion of the code.

PS I like the standard style better anyway, it just isn't as customizable.

On Thu, Sep 12, 2019, 1:44 PM chipriley notifications@github.com wrote:

I’m running the latest version and using the enhanced style. That’s probably the issue. Thanks for the info.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MatthewFlamm/nwsradar/issues/2?email_source=notifications&email_token=AJMEZYLKDGMILXNMMGGEMMTQJJ5WJA5CNFSM4IVMTKP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6SV7HA#issuecomment-530931612, or mute the thread https://github.com/notifications/unsubscribe-auth/AJMEZYPXJ5NVO36LW7NFRKTQJJ5WJANCNFSM4IVMTKPQ .