LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

[Bug]: rag.insert()出错,1.2.3版本之前好的,升级到最新版本错误,无法更新

Open aiwenForGit opened this issue 9 months ago • 2 comments

Do you need to file an issue?

  • [ ] I have searched the existing issues and this bug is not already filed.
  • [ ] I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

@@今天升级到了1.2.6版本,发觉insert方法出错 错误信息: File "..\fastApiServer.py", line 375, in insert_endpoint result = rag.insert(request.text,ids=unique_id) File "..\lib\site-packages\lightrag\lightrag.py", line 565, in insert loop.run_until_complete( File "\lib\site-packages\nest_asyncio.py", line 98, in run_until_complete return f.result() File "..\lib\asyncio\futures.py", line 201, in result raise self._exception.with_traceback(self._exception_tb) File "..\lib\asyncio\tasks.py", line 232, in __step result = coro.send(None) File "..\lib\site-packages\lightrag\lightrag.py", line 590, in ainsert await self.apipeline_enqueue_documents(input, ids, file_paths) File "..\lib\site-packages\lightrag\lightrag.py", line 772, in apipeline_enqueue_documents unique_new_doc_ids = await self.doc_status.filter_keys(all_new_doc_ids) File "..\lib\site-packages\lightrag\kg\json_doc_status_impl.py", line 56, in filter_keys async with self._storage_lock: AttributeError: aenter

insert核心方法是这么写的: # 生成唯一ID import uuid unique_id = str(uuid.uuid4()) print(unique_id)

    #await loop.run_in_executor(None, lambda: rag.insert(request.text))
    result = await loop.run_in_executor(
        None, lambda: rag.ainsert(request.text,ids=unique_id)
    )
    print(unique_id)
    print(result)

我回退到1.2.3版本是正常的,但最新版出错,还请各位大拿帮忙下!

Steps to reproduce

No response

Expected Behavior

No response

LightRAG Config Used

Paste your config here

Logs and screenshots

No response

Additional Information

  • LightRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:

aiwenForGit avatar Mar 24 '25 13:03 aiwenForGit

请升级到v1.3.0或最新版

danielaskdd avatar Mar 28 '25 20:03 danielaskdd

请升级到v1.3.0或最新版

你好,我在1.2.3用openai_compatible_demo.py的时候是正常的,但是一来到1.3.0,对于同一个文件,却报错了,openai_compatible_demo.py也是用了最新的版本来跑,还是报错fail to extract entities and relationships

Buzeg avatar Mar 30 '25 10:03 Buzeg

Please verify if the issue is resolved with the latest version.

danielaskdd avatar Jul 20 '25 01:07 danielaskdd