question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute 'resume_reading'

See original GitHub issue

The problem

I am getting a lot of errors related to aiohttp.server.

Environment

  • Home Assistant Core release with the issue: core-2021.1.5
  • Last working Home Assistant Core release (if known): -
  • Operating environment (OS/Container/Supervised/Core): OS in Proxmox VM
  • Integration causing this issue:
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml


Traceback/Error logs

Logger: aiohttp.server
Source: /usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py:393
First occurred: 11:02:05 (3 occurrences)
Last logged: 11:02:05
Unhandled exception

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1152, in _sendfile_fallback
    read = await self.run_in_executor(None, file.readinto, view)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 485, in start
    resp, reset = await task
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 440, in _handle_request
    reset = await self.finish_response(request, resp, start_time)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 591, in finish_response
    await prepare_meth(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_fileresponse.py", line 241, in prepare
    return await self._sendfile(request, fobj, offset, count)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_fileresponse.py", line 96, in _sendfile
    await loop.sendfile(transport, fobj, offset, count)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1131, in sendfile
    return await self._sendfile_fallback(transport, file,
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1161, in _sendfile_fallback
    await proto.restore()
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 263, in restore
    self._transport.resume_reading()
  File "/usr/local/lib/python3.8/asyncio/sslproto.py", line 344, in resume_reading
    self._ssl_protocol._transport.resume_reading()
AttributeError: 'NoneType' object has no attribute 'resume_reading'

Additional information

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:27
  • Comments:44 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mglukhankovcommented, May 12, 2021

I had this error after a recent update. The main problem was http.base_url. It is not supported anymore. So I removed it from the config. I had to add homeassistant.external_url and tts.base_url. Then I got this error. Adding homeassistant.internal_url fixed it.

homeassistant:
  internal_url: https://192.168.1.20:4312
  external_url: https://myac.duckdns.org:4312

tts:
  - platform: google_translate
    service_name: google_say
    base_url: https://myac.duckdns.org:4312

Make sure there is no slash / at the end of URLs.

1reaction
Danifontcommented, Apr 25, 2021

Same problem here, anybody found a solution for this? I can’t access from my duckdns url. only with the internal IP address.

2021-03-25 09:44:49 ERROR (MainThread) [aiohttp.server] Unhandled exception Traceback (most recent call last): File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 1152, in _sendfile_fallback read = await self.run_in_executor(None, file.readinto, view) asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py”, line 485, in start resp, reset = await task File “/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py”, line 440, in _handle_request reset = await self.finish_response(request, resp, start_time) File “/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py”, line 591, in finish_response await prepare_meth(request) File “/usr/local/lib/python3.8/site-packages/aiohttp/web_fileresponse.py”, line 241, in prepare return await self._sendfile(request, fobj, offset, count) File “/usr/local/lib/python3.8/site-packages/aiohttp/web_fileresponse.py”, line 96, in _sendfile await loop.sendfile(transport, fobj, offset, count) File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 1131, in sendfile return await self._sendfile_fallback(transport, file, File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 1161, in _sendfile_fallback await proto.restore() File “/usr/local/lib/python3.8/asyncio/base_events.py”, line 263, in restore self._transport.resume_reading() File “/usr/local/lib/python3.8/asyncio/sslproto.py”, line 344, in resume_reading self._ssl_protocol._transport.resume_reading() AttributeError: ‘NoneType’ object has no attribute ‘resume_reading’

In my case, it was a problem with the service provider, it change me to CGNAT without permission or any advice, and all the packets does not have answer. After some calls and back to no CGNAT all works again. It seems it was a problem of communications, check gateways, firewalls, proxies, etc.

Dani.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attribute Error 'NoneType' object has no attribute
The problem is here: Prep = print(re.sub(r" ?\([^)]+\)", "", result)). You're assigning the return value of print to Prep and then later ...
Read more >
AttributeError: 'NoneType' object has no attribute 'getReleases'
Hi there, I am currently trying to get my experiment to integrate with our Biopac shock hardware via parallel port. I am running...
Read more >
asyncio subprocess AttributeError: 'NoneType' object has no ...
_fileno) AttributeError: 'NoneType' object has no attribute '_remove_reader' ``` The code is the following: ``` import asyncio async def ...
Read more >
Attributeerror: 'Nonetype' Object Has No Attribute '_Root'
Attributeerror : 'Nonetype' Object Has No Attribute '_Root'. But the Python traceback has a wealth of information that can help you diagnose and...
Read more >
AttributeError: 'NoneType' object has no attribute 'drain_events'
AttributeError : 'NoneType' object has no attribute 'drain_events' ... consider building the aggregate curves and maps with the ebrisk calculator instead
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found