Find answers from the community

Updated 2 months ago

**AttributeError: 'NoneType' object has

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

Plain Text
AttributeError: 'NoneType' object has no attribute 'send'
Exception ignored in: <function _SSLProtocolTransport.__del__ at 0x000001951368DB40>
Traceback (most recent call last):
...character limit...
Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 515, in _check_closed
RuntimeError: Event loop is closed


Relevant code: (defined in a custom class I wrote to link the vector store and ingestion pipeline into a single object where I can access both)
Plain Text
    async def ingest(self, chunks: list[dict]):
        '''Ingests a list of chunks into the vector store asynchronously'''
        
        if hasattr(self, 'ingestion_pipeline') == False:
            self.init_ingestion_pipeline()
        print('################ vector store and ingestion pipeline initialized')
        
        processed_chunks = await process_chunks(chunks)
        print('################ chunks processed')

        return await self.ingestion_pipeline.arun(documents=processed_chunks)


Entrypoint:
Plain Text
vector_store = PFVectorStore() #custom class I was referring to
run(vector_store.ingest(test_data)) #asyncio


Pretty certain this is an async error, or something related to it?
L
n
38 comments
hmmm... PFVectorStore() is a custom class?
Lol so even with this error the data is still being inserted
I'd still like to fix the error
using arun, this gets called
Attachment
image.png
which goes into this
Attachment
image.png
So ... not really sure where the error is that would cause this πŸ˜…
Feels like something is not being awaited?
weird thing is that its working like
the rows are inserted πŸ˜„
So this error is probably happening after the insertion process? idk
yeah, the rows are there
I jsut dont see where in the code .send is being called
If you have the full traceback, can probably track down where that error is happening
Lol I used to be great at leveraging that in R, how might I get a full traceback in Python?
R Studio used to make it so intuitive
Usually the traceback should just be printed in full, unless you are running in a notebook
Plain Text
AttributeError: 'NoneType' object has no attribute 'send'
Exception ignored in: <function _SSLProtocolTransport.__del__ at 0x000001951368DB40>
Traceback (most recent call last):
...character limit...
Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 515, in _check_closed
RuntimeError: Event loop is closed


Did you put ...character limit... here?
Dont have nitro
Gonna have to attach it as a file
oh wow, thats annoying lol
it's like something isn't waiting for the write to the db to finish?
async is ignoring the error, still showing it to us
which is probs why the data still loads
Hmm, not sure what I should do here lol
I could ignore it. Its not throwing a real error
Or rather, the data is being inserted and async is handling the error..
I wonder if it's missing some of the data though... all nodes get inserted?
not really sure how to handle this either
This fixed it:

Plain Text
vector_store = CerebroVectorStore()
set_event_loop_policy(WindowsSelectorEventLoopPolicy()) # this fixed it
run(vector_store.ingest(test_data))


https://stackoverflow.com/questions/68123296/asyncio-throws-runtime-error-with-exception-ignored

Going to have to write an environment sensor because we deploy to Linux (my work laptop is absolute ass and I can't properly use WSL so I stick with Windows, not my preference)
that.... is wild haha
yeah pretty annoying
Ngl though I'm impressed with myself (and you) at how many errors I've been able to work through. Feels good after it
crushing it! πŸ’ͺ
Add a reply
Sign up and join the conversation on Discord