#I have this error as well, but its

1 messages Β· Page 1 of 1 (latest)

smoky wasp
#

Hmm, do you tplink enabled? πŸ₯²

tender cargo
#

Nope

#

I can hear the sigh of relief from here

smoky wasp
#

Okay, so we didn't break it, phew. I'd go and just check which enabled integrations do use aiohttp and go from there.

tender cargo
#

πŸ˜‚

smoky wasp
#

Indeed, indeed. Was worried as we started to have aiohttp as a dep just recently.

tender cargo
wispy vector
#

I have 130 integrations enabled, how can I help with this πŸ™‚

tender cargo
#

Like if it came from an integration I'd expect to have a "closed session" more often than an unclosed session

tender cargo
wispy vector
#

Spook

tender cargo
#

Nope

graceful sierra
tender cargo
#

So wait

graceful sierra
#

More like await

tender cargo
#

This would be reproducible by just reloading integrations

#

I'm guessing

smoky wasp
graceful sierra
#

I'd start looking at libraries that implements aenter, it's easy to forget the closing part there πŸ˜…

wispy vector
tender cargo
#

I definitely have less

#

I'm going to get some bananas and head home

oak bobcat
#

I see this error in safe mode as well

tender cargo
#

How much integrations do you have

oak bobcat
#

restarting back out of safe mode at the moment, then I will look them over

#

50 or so

tender cargo
#
jq '.data.entries[].domain' config/.storage/core.config_entries | sort | uniq >> config/test.txt
#

@wispy vector

#

@halcyon acorn

halcyon acorn
#

oh is this for the list issue?

tender cargo
#

no for the unclosed session issue

halcyon acorn
#

oh

tender cargo
#

I saw you responding into it that you had the same problem

halcyon acorn
#

lemme check

#

It's just a list of my integrations.

"alarmo"
"apple_tv"
"august"
"blitzortung"
"bluetooth"
"cloud"
"co2signal"
"delonghi_primadonna"
"dlna_dmr"
"dyson_local"
"esphome"
"forecast_solar"
"generic"
"geo_json_events"
"geonetnz_quakes"
"hacs"
"hassio"
"holiday"
"homeassistant_sky_connect"
"homekit"
"homekit_controller"
"ibeacon"
"imap"
"local_calendar"
"localtuya"
"managemyhealth"
"meridian_energy"
"mobile_app"
"netatmo"
"onvif"
"oralb"
"panasonic_cc"
"private_ble_device"
"profiler"
"raspberry_pi"
"rpi_power"
"samsungtv"
"sma"
"spook"
"sun"
"switch_as_x"
"switch_manager"
"template"
"thread"
"tplink"
"twinkly"
"upnp"
"withings"
"workday"
"xbox"
"xiaomi_ble"
"xiaomi_miot"
"yalexs_ble"
"yeelock"
"zha"

tender cargo
#

I know, one of these is the culprit

halcyon acorn
tender cargo
#

I don't have that one

#

Wait, this might be even my own integration lol

#

@oak bobcat do you use Withings?

oak bobcat
#

I don’t. I can get my list in a few

gilded mortar
#

Checked the georss integration. The current version does not use aiohttp

#

In my case, for example, the error did not occur at all

tender cargo
#

Fun fact, I can't reproduce this anymore

gilded mortar
#

I checked all recent package bumps but couldn't find anything that has caused this

wispy vector
#

I don't have withings, if that helps

wispy vector
tender cargo
#

yes

wispy vector
#
"adguard"
"airthings"
"airthings_ble"
"androidtv"
"androidtv_remote"
"apple_tv"
"blink"
"bluetooth"
"cast"
"cloud"
"coinbase"
"denonavr"
"derivative"
"dlna_dmr"
"dlna_dms"
"dyson_local"
"epson"
"esphome"
"extended_openai_conversation"
"fastdotcom"
"filesize"
"fitbit"
"fully_kiosk"
"gasbuddy"
"generic"
"glances"
"google"
"google_assistant_sdk"
"google_mail"
"google_sheets"
"google_tasks"
"google_translate"
"govee_ble"
"group"
"hacs"
"hass_agent"
"hassio"
"heos"
"homeassistant_sky_connect"
"homekit_controller"
"hue"
"ibeacon"
"imap"
"improv_ble"
"inkbird"
"integration"
"ipp"
"lametric"
"led_ble"
"llama_conversation"
"local_calendar"
"local_todo"
"lutron_caseta"
"matter"
"meater"
"melnor"
"met"
"mobile_app"
"moon"
"mqtt"
"nanoleaf"
"nest"
"nest_protect"
"nexia"
"nfandroidtv"
"nut"
"openai_conversation"
"opower"
"oralb"
"otbr"
"profiler"
"proximity"
"radio_browser"
"raspberry_pi"
"rpi_power"
"samsungtv"
"shelly"
"spook"
"spotify"
"sun"
"switch_as_x"
"switchbot"
"systemmonitor"
"thermopro"
"thread"
"upnp"
"voip"
"wemo"
"wiz"
"workday"
"wyoming"
"xbox"
"yalexs_ble"
"youtube"
"zha"
"zwave_js"
#

interesting your command said I have 97 lines for integrations, but spook says I have 130 integrations....maybe there are some missing

#

but anyways, thats what I get from your command

tender cargo
#

I think those are also including the default stuff like "person" and "script"

#

etc

wispy vector
#

oh, okay thanks

wispy vector
#

so far its not adgaurd, airthings, android tv, generic camera...

tender cargo
#

I'm, not seeing a lot of similarities

#

I also can't reproduce it anymore

wispy vector
#

even on restart?

tender cargo
#

nothing

#

oh and now its back

gilded mortar
#

πŸ˜„

wispy vector
#

probably need this, maybe?
~~```
logger:
default: debug
logs:
aiohttp: access
aiohttp: client
aiohttp: internal
aiohttp: server
aiohttp: web
aiohttp: websocket

graceful sierra
#

Definitly not, that is invalid

wispy vector
#

ahh yes, this:

logger:
  default: debug
  logs:
    aiohttp.access: debug
    aiohttp.client: debug
    aiohttp.internal: debug
    aiohttp.server: debug
    aiohttp.web: debug
    aiohttp.websocket: debug
graceful sierra
#

Which is redudndant, the default covers all those

tender cargo
oak bobcat
#

local_calendar maybe?

tender cargo
#

I'd expect way more people to report this then

#

but it could be

gilded mortar
#

I use local_calendar too, and I don't have this error. And afaik local_calendar has no dependency on aiohttp

oak bobcat
#

I have these in common with the previous lists:
apple_tv
bluetooth
cloud
dlna_dmr
esphome
hacs
hassio
homekit_controller
ibeacon
local_calendar
mobile_app
oralb
sun
switch_as_x
thread
upnp
zha

#

unless I made a mistake comparing them πŸ˜„
Here's my full list:
"adaptive_lighting"
"adguard"
"airvisual"
"alexa_media"
"androidtv_remote"
"apple_tv"
"bluetooth"
"broadlink"
"brother"
"cast"
"cloud"
"dlna_dmr"
"ecowitt"
"elevenlabs_tts"
"esphome"
"eufylife_ble"
"extended_openai_conversation"
"google"
"govee_lan"
"group"
"hacs"
"hassio"
"homeassistant_yellow"
"homekit"
"homekit_controller"
"hue"
"ibeacon"
"improv_ble"
"iqvia"
"lifx"
"local_calendar"
"local_todo"
"mobile_app"
"moon"
"mqtt"
"nest"
"nws"
"opengarage"
"opensprinkler"
"oralb"
"pirateweather"
"plex"
"proximity"
"reolink"
"roku"
"roomba"
"scrypted"
"shelly"
"sonos"
"spotify"
"sun"
"switch_as_x"
"systemmonitor"
"tasmota"
"template"
"thread"
"tod"
"unifi"
"unifiprotect"
"upnp"
"uptime"
"voip"
"webrtc"
"winix"
"wiz"
"wled"
"wyoming"
"xiaomi_ble"
"zha"
"zwave_js"
"adaptive_lighting"
"adguard"
"airvisual"
"alexa_media"
"androidtv_remote"
"apple_tv"
"bluetooth"
"broadlink"
"brother"
"cast"
"cloud"
"dlna_dmr"
"ecowitt"
"elevenlabs_tts"
"esphome"
"eufylife_ble"
"extended_openai_conversation"
"google"
"govee_lan"
"group"
"hacs"
"hassio"
"homeassistant_yellow"
"homekit"
"homekit_controller"
"hue"
"ibeacon"
"improv_ble"
"iqvia"
"lifx"
"local_calendar"
"local_todo"
"mobile_app"
"moon"
"mqtt"
"nest"
"nws"
"opengarage"
"opensprinkler"
"oralb"
"pirateweather"
"plex"
"proximity"
"reolink"
"roku"
"roomba"
"scrypted"
"shelly"
"sonos"
"spotify"
"sun"
"switch_as_x"
"systemmonitor"
"tasmota"
"template"
"thread"
"tod"
"unifi"
"unifiprotect"
"upnp"
"uptime"
"voip"
"webrtc"
"winix"
"wiz"
"wled"
"wyoming"
"xiaomi_ble"
"zha"
"zwave_js"

#

ok I have the error back after a restart with local_calendar disabled.

#

it took a few times

#

I did enable oralb again πŸ€·β€β™‚οΈ No idea

tender cargo
#

But the rest of these integrations sounds widely used so I would expect more people to have this issue

wispy vector
#

had a couple of logs this morning, which may be related to this...not sure:

Logger: homeassistant
Source: runner.py:145
First occurred: February 5, 2024 at 3:34:50 PM (2 occurrences)
Last logged: 5:17:32 AM

Error doing job: Unclosed client session
Error doing job: Task was destroyed but it is pending!
#

and

#
Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 12:26:30 AM (1 occurrences)
Last logged: 12:26:30 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message:
  Data after `Connection: close`:

    b'HELP'
       ^
tender cargo
wispy vector
#

you mean like browser?

#

device?

tender cargo
#

No, a person

#

(for legal reasons, this is a joke)

wispy vector
#

lol

#

i'll tell my wife, she is in the basement

tender cargo
#

😳

wispy vector
#

basement office

tender cargo
#

But can you solidly reproduce it?

wispy vector
#

I think this is the first time I've seen this

#

so I can only keep an eye out for it

#

being at 12:26 am, almost everyone was sleeping...perhaps I was on my phone so it could be related to the android app

tender cargo
wispy vector
#

yes, on every startup

tender cargo
#

Hmm strange

wispy vector
#

FYI still getting it on b9

Logger: homeassistant
Source: runner.py:145
First occurred: 4:54:39 PM (1 occurrences)
Last logged: 4:54:39 PM

Error doing job: Unclosed client session
halcyon acorn
#

still getting it too

halcyon acorn
#

What was that about Withings?

tender cargo
halcyon acorn
#

Is there a straightforward way to enable hass --verbose mode when using HAOS?

graceful sierra
#

Depends, what is β€œverbose mode”?πŸ˜…

halcyon acorn
#

sorry, --debug is the one I am wanting

graceful sierra
halcyon acorn
#

it looks like --debug is passed through from main to the runner then to asyncio which should then give us our traceback

#

I was sure I tried that but let me try again

#

nope

#

I don't get the traceback with that

#

what on earth - my logger is well and truly broken!

*Logger: bleak_esphome.backend.client
Source: custom_components/geo_json_events/manager.py:74
Integration: GeoJSON
First occurred: 19:54:47 (1 occurrences)
Last logged: 19:54:47

esphome-lounge [4C:75:25:XXXXXX]: LI00XXX - 98:1B:B5:XXXXXX: ESPHomeClient bleak client was not properly disconnected before destruction*

graceful sierra
halcyon acorn
#

yes, it's what I was looking at - may well just do that

#

okay

#

so that works and I got a full stack trace

#

simply changed debug=args.debug, to debug=True, and rebooted

#

I found what was causing mine, some moron custom_integrations developer (no prizes for guessing who it was!)

#

If you do the above, you will get a traceback that looks like below which will give you exactly where the cause is:

2024-02-07 20:04:10.172 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session: File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 221, in <module>
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 671, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 638, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1966, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 84, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 963, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1080, in async_create_flow
flow = handler()
File "/config/custom_components/yeelock/config_flow.py", line 51, in init
self._session = aiohttp.ClientSession()

graceful sierra
#

yeelock looks familiar πŸ€”
Was that new in this beta?

halcyon acorn
#

no, I submitted PR for it and immediately got shot down for not having two BLE calls in a standalone library which might be what you are remembering

graceful sierra
#

I doubt it, I dont look much at core PRs anymore πŸ˜›

halcyon acorn
#

ohhhhh - thanks for that too!

#

@tender cargo @wispy vector if you want to repro that unclosed client session, start hass with --debug flags enabled

wispy vector
#

Thanks id be happy to try that...but how do I do that?

#

It doesn't seem to follow the standard logging in config yaml your instructions

graceful sierra
#

You would have to exec into the container, modify the source code directly, and then exit out before restarting.
if any or those words are unfamiliar, do not attempt it

wispy vector
#

Lol you're basically saying I should make another backup of my home assistant

graceful sierra
#

Not at all, Im saying do not do it like at all, if this is not something you know

wispy vector
#

Okay I'll leave it for now as I'm not sure BUT perhaps if joostlek does it he might identify the integration we share

tender cargo
#

Right I'll give this a shot

#

as in

#

I waited since I can't reproduce this consistently

#

but I forgot my medicaiton today so my concentration span is like 5 seconds holy shit

#

so might as well give it a shot

tender cargo
#

yes

#

my head rn

#

and I got distracted again

#

apparently there is a VSCode plugin to show subway surfers on the side

#

to keep the flow of dopamine going when programming

graceful sierra
tender cargo
tender cargo
#
2024-02-07 14:52:07.720 WARNING (MainThread) [asyncio] Executing <Task pending name='Task-7043' coro=<RequestHandler._handle_request() running at /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:452> wait_for=<Future pending cb=[Task.task_wakeup()] created at /usr/local/lib/python3.12/asyncio/base_events.py:447> cb=[Task.task_wakeup()] created at /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:527> took 0.140 seconds
2024-02-07 14:52:08.825 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session:   File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 671, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 638, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1966, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 442, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/hue/__init__.py", line 22, in async_setup_entry
    if not await bridge.async_initialize_bridge():
  File "/usr/src/homeassistant/homeassistant/components/hue/bridge.py", line 76, in async_initialize_bridge
    await self.api.initialize()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 107, in initialize
    await self.fetch_full_state()
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 247, in fetch_full_state
    full_state = await self.request("get", "clip/v2/resource")
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 167, in request
    async with self.create_request(method, path, **kwargs) as resp:
  File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
  File "/usr/local/lib/python3.12/site-packages/aiohue/v2/__init__.py", line 200, in create_request
    self._websession = aiohttp.ClientSession(connector=connector)
oak bobcat
#

@tender cargo ah yes. same with hue here

tender cargo
#

cc @small sphinx

#

But the thing that's strange, hue didn't change much this release

graceful sierra
#

Strickter things in py3.12 probably

tender cargo
#

fair

graceful sierra
wispy vector
#

so its hue? if I try to reload my hue integration it should give the error

tender cargo
#

I guess