-
Notifications
You must be signed in to change notification settings - Fork 71
ERROR: Creating a client session outside of coroutine #10
Comments
You shouldn't have to instantiate the client inside a coroutine - the example code in If not, could you please share the code that you are using? Thanks! |
My code looks like this:
Looking into the code I find:
That's run during the creation of the connection which happens during the creation of the transport (in elasticsearch-py) which happens during the creation of the client - no matter the configuration. |
Full stacktrace:
|
This is very weird because this code works for me just fine:
|
From looking at the code (0) it looks like the message should have been a 0 - http://aiohttp.readthedocs.io/en/stable/_modules/aiohttp/client.html |
Ya, it's a warning, it still works. But I'm afraid I'll run into strange bugs sometime, don't want to ignore that. The stacktrace is printed when enabling debug mode for asyncio |
And your code gives me the same warning. Plus, I first entered the wrong hostname, which (of course) raised an exception. During handling that this error occurred.
Should I open a ticket for that? |
Ah, I see. I am unfortunately not that familiar with Maybe @asvetlov could help? |
oh, the missing duration is the result of |
This issue is fixed in |
I'm using elasticsearch-py-async in a web application. The client gets instantiated during startup and is shared across requests. The whole startup process is synchronous, hence, there is no loop involved. As a result I get an "ERROR: Creating a client session outside of coroutine".
My understanding is, that during the creation of the client no connection / session should be opened. How am I supposed to do this correctly?
The text was updated successfully, but these errors were encountered: