Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'get_extra_info' #9762

Closed
runningman84 opened this issue Oct 8, 2017 · 34 comments
Closed

Comments

@runningman84
Copy link
Contributor

Home Assistant release (hass --version):
0.54

Python release (python3 --version):
3.7

Component/platform:
unknown

Description of problem:
My log get spammed with messages like this.

Expected:
Possibility to ignore http/tls errors. No AttributeError

Traceback (if applicable):

Oct 08 20:32:24 hass dockerd[756]: 2017/10/08 20:32:24 http: TLS handshake error from 192.168.178.12:54314: read tcp 192.168.178.12:443->192.168.178.12:54314: read: connection reset by peer
Oct 08 20:32:27 hass dockerd[756]: 2017-10-08 20:32:27 ERROR (MainThread) [aiohttp.access] Error in logging
Oct 08 20:32:27 hass dockerd[756]: Traceback (most recent call last):
Oct 08 20:32:27 hass dockerd[756]:   File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 500, in log
Oct 08 20:32:27 hass dockerd[756]:     for key, value in fmt_info:
Oct 08 20:32:27 hass dockerd[756]:   File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 483, in <genexpr>
Oct 08 20:32:27 hass dockerd[756]:     return ((key, method(args)) for key, method in self._methods)
Oct 08 20:32:27 hass dockerd[756]:   File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 436, in _format_a
Oct 08 20:32:27 hass dockerd[756]:     peername = args[3].get_extra_info('peername')
Oct 08 20:32:27 hass dockerd[756]:   File "/usr/lib/python3.6/asyncio/sslproto.py", line 306, in get_extra_info
Oct 08 20:32:27 hass dockerd[756]:     return self._ssl_protocol._get_extra_info(name, default)
Oct 08 20:32:27 hass dockerd[756]:   File "/usr/lib/python3.6/asyncio/sslproto.py", line 547, in _get_extra_info
Oct 08 20:32:27 hass dockerd[756]:     return self._transport.get_extra_info(name, default)
Oct 08 20:32:27 hass dockerd[756]: AttributeError: 'NoneType' object has no attribute 'get_extra_info'

Additional info:
I guess the connection attempt is from a port check or something like this.

@spektren
Copy link
Contributor

I see these messages as well.

0.56dev and older versions too
Python 3.5
Self signed ssl cert

@jinjeul
Copy link

jinjeul commented Oct 14, 2017

Same error.

Also SSL configured (not using self signed tho)..

@hareeshmu
Copy link
Contributor

Same here...

HA Version: 0.55.0
Python: 3.5

2017-10-16 18:04:04 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 500, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 483, in <genexpr>
    return ((key, method(args)) for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 436, in _format_a
    peername = args[3].get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@sunflowerABB
Copy link

Same here, Python 3.6.0

@getsmokes
Copy link

getsmokes commented Oct 22, 2017

Same also.

RROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 500, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 483, in <genexpr>
    return ((key, method(args)) for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 436, in _format_a
    peername = args[3].get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@jinjeul
Copy link

jinjeul commented Oct 25, 2017

Still present in 0.56.2

:(

@leranp
Copy link
Contributor

leranp commented Oct 25, 2017

I have the same errors

@MuppetOwl
Copy link

Can also confirm same issue still exist in 0.56.2

@jinjeul
Copy link

jinjeul commented Oct 25, 2017

Seems to fix the issue : https://github.com/python/cpython/pull/525/files

@CCOSTAN
Copy link
Contributor

CCOSTAN commented Nov 1, 2017

Slightly different now.. AttributeError: 'NoneType' object has no attribute 'ssl_object'

 Traceback (most recent call last):
Nov 01 17:39:57 Carlo-Pi hass[468]:   File "/usr/local/lib/python3.6/asyncio/events.py", line 127,
in _run
Nov 01 17:39:57 Carlo-Pi hass[468]:     self._callback(*self._args)
Nov 01 17:39:57 Carlo-Pi hass[468]:   File "/usr/local/lib/python3.6/asyncio/sslproto.py", line 666
, in _process_write_backlog
Nov 01 17:39:57 Carlo-Pi hass[468]:     self._on_handshake_complete(exc)
Nov 01 17:39:57 Carlo-Pi hass[468]:   File "/usr/local/lib/python3.6/asyncio/sslproto.py", line 580
, in _on_handshake_complete
Nov 01 17:39:57 Carlo-Pi hass[468]:     sslobj = self._sslpipe.ssl_object
Nov 01 17:39:57 Carlo-Pi hass[468]: AttributeError: 'NoneType' object has no attribute 'ssl_object'

@olskar
Copy link
Contributor

olskar commented Nov 1, 2017

I can confirm that it fixes the issue @jinjeul
I replaced my sslproto.py with the one from the repo you linked and no more errors.

No idea how to get this into home assistant, since it seems to be a bug in python?

@runningman84
Copy link
Contributor Author

@balloob what do you think?

@runningman84
Copy link
Contributor Author

this is my current solution:

# Dockerfile
FROM homeassistant/raspberrypi3-homeassistant

# Fix ssl
ADD https://raw.githubusercontent.com/python/cpython/3.6/Lib/asyncio/sslproto.py /usr/lib/python3.6/asyncio/sslproto.py

@leranp
Copy link
Contributor

leranp commented Nov 22, 2017

This is the fix for the error ? #10741

@aaronwolen
Copy link

I'm still receiving this error on 0.59.1 running Hassbian on a Pi 3:

2017-12-06 08:14:54 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/websocket_api.py", line 328, in handle
    msg = yield from wsock.receive_json()
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_ws.py", line 335, in receive_json
    data = yield from self.receive_str(timeout=timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_ws.py", line 317, in receive_str
    msg = yield from self.receive(timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_ws.py", line 280, in receive
    msg = yield from self._reader.read()
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/streams.py", line 672, in read
    return (yield from super().read())
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/streams.py", line 554, in read
    yield from self._waiter
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 285, in result
    raise CancelledError
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 554, in __get__
    return inst._cache[self.name]
KeyError: 'remote'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 521, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 513, in <genexpr>
    for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 473, in _format_a
    ip = request.remote
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 556, in __get__
    val = self.wrapped(inst)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 319, in remote
    peername = transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@gb53smith
Copy link

gb53smith commented Dec 11, 2017

HA 0.59.2
Python 3.6
My error log is slightly different so I am including here:

2017-12-11 11:30:38 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last): 
  File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 554, in __get__
    return inst._cache[self.name] 
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): 
  File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 521, in log
    for key, value in fmt_info: 
  File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 513, in <genexpr>
    for key, method in self._methods) 
  File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 473, in _format_a
    ip = request.remote 
  File "/usr/lib/python3.6/site-packages/aiohttp/helpers.py", line 556, in __get__
    val = self.wrapped(inst) 
  File "/usr/lib/python3.6/site-packages/aiohttp/web_request.py", line 319, in remote
    peername = transport.get_extra_info('peername') 
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default) 
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 547, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@Daehnie
Copy link

Daehnie commented Dec 20, 2017

HA 0.60

Same here:
Error in logging

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 554, in __get__
    return inst._cache[self.name]
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 521, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 513, in <genexpr>
    for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 473, in _format_a
    ip = request.remote
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 556, in __get__
    val = self.wrapped(inst)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 319, in remote
    peername = transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@gb53smith
Copy link

Daehnie,
Updating to HA 0.60.0 seems to have fixed this error for me. (No errors in 24 hrs)
I am using hass.io and that uses python3.6
I notice you are at python3.5

@valdragas
Copy link

valdragas commented Dec 21, 2017

same error
HA 0.60
python 3.6

2017-12-21 09:08:48 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 554, in __get__
    return inst._cache[self.name]
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 521, in log
    for key, value in fmt_info:
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 513, in <genexpr>
    for key, method in self._methods)
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 473, in _format_a
    ip = request.remote
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/helpers.py", line 556, in __get__
    val = self.wrapped(inst)
  File "/home/osmc/homeassistant/lib/python3.6/site-packages/aiohttp/web_request.py", line 319, in remote
    peername = transport.get_extra_info('peername')
  File "/usr/local/lib/python3.6/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/local/lib/python3.6/asyncio/sslproto.py", line 547, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@donkawechico
Copy link
Contributor

donkawechico commented Jan 16, 2018

I'm seeing this error as well, but I'm still on python 3.5. I'll try upgrading to 3.6 and see if that solves it (using this thread to guide my installation).

HA 0.61
Python 3.5

Tue Jan 16 2018 15:20:03 GMT-0800 (PST)

Error in logging
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 554, in __get__
    return inst._cache[self.name]
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 521, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 513, in <genexpr>
    for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 473, in _format_a
    ip = request.remote
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 556, in __get__
    val = self.wrapped(inst)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 321, in remote
    peername = transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@donkawechico
Copy link
Contributor

I've updated my system to use Python 3.6 and I'm still getting the error.

After further investigation -- if I'm reading github correctly -- it appears you need Python v3.7.0a1 or higher to get the fix commit for this issue:

screenshot 2018-01-16 18 07 45

@donkawechico
Copy link
Contributor

donkawechico commented Jan 17, 2018

I bit the bullet and manually changed the sslproto.py file. Fixed the issue for me.

These were my steps on a raspberry pi (stretch) and python 3.6:

  1. Went to raw version of updated sslproto.py file on github, selected all, and copied contents.

  2. Pasted contents into new sslproto.py file:

$ sudo systemctl stop [email protected]
$ cd /usr/local/lib/python3.6/asyncio
$ sudo mv sslproto.py sslproto.py.bkup
$ sudo nano sslproto.py

# Paste code from clipboard, save file

$ sudo systemctl start [email protected]

@aaronwolen
Copy link

I'm on a Raspberry Pi running Stretch and Python 3.5. I tried @donkawechico's fix and received the following error:

Jan 17 13:55:58 hassbian hass[23002]: Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.sslproto._SSLProtocolTransport object at 0x658c7930>>
Jan 17 13:55:58 hassbian hass[23002]: Traceback (most recent call last):
Jan 17 13:55:58 hassbian hass[23002]:   File "/usr/lib/python3.5/asyncio/sslproto.py", line 335, in __del__
Jan 17 13:55:58 hassbian hass[23002]:     source=self)
Jan 17 13:55:58 hassbian hass[23002]: TypeError: 'source' is an invalid keyword argument for this function

Do we really need to upgrade to 3.6 to resolve this issue?

@MartinHjelmare
Copy link
Member

Please don't post without new info. Use subscribe button and thumbs up the original post.

@home-assistant home-assistant deleted a comment from neuman1812 Jan 27, 2018
@home-assistant home-assistant deleted a comment from ezbe Jan 27, 2018
@milanvo
Copy link
Contributor

milanvo commented Jan 28, 2018

I can confirm it is upstream issue - https://bugs.python.org/issue29742

For Python 3.5 it is fixed in "Python 3.5.4 release candidate 1" onward. For Debian / Raspbian, I decided not to upgrade default Python yet (3.5.3 in Stretch now), updating only sslproto.py worked for me.

@aaronwolen try to replace /usr/lib/python3.5/asyncio/sslproto.py with this version from 3.5 branch:
https://raw.githubusercontent.com/python/cpython/db522dc86294a99f46a63cd5b54c7c4ab8017c96/Lib/asyncio/sslproto.py

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@MuppetOwl
Copy link

I dont have this error msg anymore. So think this issue is fixed and can be closed? :)

@hareeshmu
Copy link
Contributor

I have this error still appearing in the log...
Home Assistant
0.70.1

Jun 05 13:25:06 HASS hass[1521]: 2018-06-05 13:25:06 ERROR (MainThread) [aiohttp.access] Error in logging
Jun 05 13:25:06 HASS hass[1521]: Traceback (most recent call last):
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 501, in get
Jun 05 13:25:06 HASS hass[1521]: return inst._cache[self.name]
Jun 05 13:25:06 HASS hass[1521]: KeyError: 'remote'
Jun 05 13:25:06 HASS hass[1521]: During handling of the above exception, another exception occurred:
Jun 05 13:25:06 HASS hass[1521]: Traceback (most recent call last):
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 465, in log
Jun 05 13:25:06 HASS hass[1521]: for key, value in fmt_info:
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 457, in
Jun 05 13:25:06 HASS hass[1521]: for key, method in self._methods)
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 415, in _format_a
Jun 05 13:25:06 HASS hass[1521]: ip = request.remote
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 503, in get
Jun 05 13:25:06 HASS hass[1521]: val = self.wrapped(inst)
Jun 05 13:25:06 HASS hass[1521]: File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 332, in remote
Jun 05 13:25:06 HASS hass[1521]: peername = self.transport.get_extra_info('peername')
Jun 05 13:25:06 HASS hass[1521]: File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
Jun 05 13:25:06 HASS hass[1521]: return self._ssl_protocol._get_extra_info(name, default)
Jun 05 13:25:06 HASS hass[1521]: File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
Jun 05 13:25:06 HASS hass[1521]: return self._transport.get_extra_info(name, default)
Jun 05 13:25:06 HASS hass[1521]: AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@olenoerby
Copy link

olenoerby commented Jun 8, 2018

Same here on 0.70.1

2018-06-08 08:02:15 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 501, in __get__
    return inst._cache[self.name]
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 465, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 457, in <genexpr>
    for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 415, in _format_a
    ip = request.remote
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 503, in __get__
    val = self.wrapped(inst)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 332, in remote
    peername = self.transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@pointlevel
Copy link

Same for me to, 0.72

Traceback (most recent call last):
  File "aiohttp/_helpers.pyx", line 24, in aiohttp._helpers.reify.__get__
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 466, in log
    for key, value in fmt_info:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 458, in <genexpr>
    for key, method in self._methods)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/helpers.py", line 416, in _format_a
    ip = request.remote
  File "aiohttp/_helpers.pyx", line 32, in aiohttp._helpers.reify.__get__
  File "aiohttp/_helpers.pyx", line 26, in aiohttp._helpers.reify.__get__
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_request.py", line 338, in remote
    peername = self.transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

@cgarwood
Copy link
Member

I've been getting this a lot in 0.72 and 0.73.

Log Details (ERROR)
Tue Jul 10 2018 12:25:01 GMT-0400 (Eastern Daylight Time)

Error in logging
Traceback (most recent call last):
  File "aiohttp/_helpers.pyx", line 24, in aiohttp._helpers.reify.__get__
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 466, in log
    for key, value in fmt_info:
  File "/srv/hass/hass_venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 458, in <genexpr>
    for key, method in self._methods)
  File "/srv/hass/hass_venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 416, in _format_a
    ip = request.remote
  File "aiohttp/_helpers.pyx", line 32, in aiohttp._helpers.reify.__get__
  File "aiohttp/_helpers.pyx", line 26, in aiohttp._helpers.reify.__get__
  File "/srv/hass/hass_venv/lib/python3.5/site-packages/aiohttp/web_request.py", line 338, in remote
    peername = self.transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'

Using nginx as a reverse proxy. Not sure if that would be related?

@Adminiuga
Copy link
Contributor

Getting the same with 0.74.2. Not using nginx, but do use a self signed certificate. Happens when I reload the page in Chrome 68.0.3440.
Using new username/password auth option.

2018-08-02 17:01:32 INFO (MainThread) [homeassistant.components.http.view] Serving /api/history/period/2018-08-02T21:01:12.002Z to 192.168.192.153 (auth: True)
2018-08-02 17:01:37 INFO (MainThread) [homeassistant.components.http.view] Serving /states to 192.168.1.3 (auth: False)
2018-08-02 17:01:37 ERROR (MainThread) [aiohttp.access] Error in logging
Traceback (most recent call last):
  File "aiohttp/_helpers.pyx", line 24, in aiohttp._helpers.reify.__get__
KeyError: 'remote'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lex/lex/src/ac-hass/venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 466, in log
    for key, value in fmt_info:
  File "/home/lex/lex/src/ac-hass/venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 458, in <genexpr>
    for key, method in self._methods)
  File "/home/lex/lex/src/ac-hass/venv/lib/python3.5/site-packages/aiohttp/helpers.py", line 416, in _format_a
    ip = request.remote
  File "aiohttp/_helpers.pyx", line 32, in aiohttp._helpers.reify.__get__
  File "aiohttp/_helpers.pyx", line 26, in aiohttp._helpers.reify.__get__
  File "/home/lex/lex/src/ac-hass/venv/lib/python3.5/site-packages/aiohttp/web_request.py", line 338, in remote
    peername = self.transport.get_extra_info('peername')
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_info
    return self._ssl_protocol._get_extra_info(name, default)
  File "/usr/lib/python3.5/asyncio/sslproto.py", line 546, in _get_extra_info
    return self._transport.get_extra_info(name, default)
AttributeError: 'NoneType' object has no attribute 'get_extra_info'
2018-08-02 17:01:37 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.1.3 (auth: False)
2018-08-02 17:01:37 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.3 (auth: False)
2018-08-02 17:01:38 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.1.3 (auth: False)
2018-08-02 17:01:38 INFO (MainThread) [homeassistant.components.http.view] Serving /api/history/period/2018-07-23T21:01:38.239Z to 192.168.1.3 (auth: True)

@Adminiuga
Copy link
Contributor

some extra info:

  • I can see this exception when I reload the page in chrome while logged into hass using https
  • I don't get this exception if I just connect to hass using https and presented the user login page
  • I don't get this exception when I reload the user login page

@awarecan
Copy link
Contributor

awarecan commented Aug 7, 2018

asyncio issue (sslproto.py) has been fixed in Python 3.5.4, 3.6.2, 3.7.0. Any version below those will have this issue.

The workaround is applying following patch (v3.5.3):

diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 7ad28d6aa008..ab7ff0bf93d0 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -543,8 +543,10 @@ def eof_received(self):
     def _get_extra_info(self, name, default=None):
         if name in self._extra:
             return self._extra[name]
-        else:
+        elif self._transport is not None:
             return self._transport.get_extra_info(name, default)
+        else:
+            return default
 
     def _start_shutdown(self):
         if self._in_shutdown:

Home-assistant is unable to fix the issue. I am going to close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests