Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Try to create namespace before Shared-Data is initialized<title> #1075

Open
2 tasks
yulink1981 opened this issue Mar 13, 2025 · 4 comments
Open
2 tasks
Labels
question Further information is requested

Comments

@yulink1981
Copy link

Do you need to ask a question?

  • I have searched the existing question and discussions and this question is not already answered.
  • I believe this is a legitimate question, not just a bug or feature request.

Your Question

INPUT_FILE: book.txt
WORKING_DIR: index_default
INFO: Started server process [19648]
INFO: Waiting for application startup.
INFO: Process 19648 Shared-Data created for Single Process
INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': 'index_default\vdb_entities.json'} 0 data
INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': 'index_default\vdb_relationships.json'} 0 data
INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': 'index_default\vdb_chunks.json'} 0 data
ERROR: Traceback (most recent call last):
File "D:\lightrag\LightRAG\Lib\site-packages\starlette\routing.py", line 692, in lifespan
async with self.lifespan_context(app) as maybe_state:
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\examples\lightrag_api_ollama_demo.py", line 62, in lifespan
rag = await init()
^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\examples\lightrag_api_ollama_demo.py", line 53, in init
await rag.initialize_storages()
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\lightrag.py", line 469, in initialize_storages
await asyncio.gather(*tasks)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 385, in __wakeup
future.result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\asyncio\tasks.py", line 314, in __step_run_and_handle_result
result = coro.send(None)
^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\kg\json_kv_impl.py", line 37, in initialize
self.storage_updated = await get_update_flag(self.namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\kg\shared_storage.py", line 311, in get_update_flag
raise ValueError("Try to create namespace before Shared-Data is initialized")
ValueError: Try to create namespace before Shared-Data is initialized

ERROR: Application startup failed. Exiting.

Additional Context

No response

@yulink1981 yulink1981 added the question Further information is requested label Mar 13, 2025
@yulink1981
Copy link
Author

init namespace failure

@yulink1981
Copy link
Author

Thank you for your reply.

@danielaskdd
Copy link
Collaborator

I think you are not starting the API server in a correct way. Please refer to README of API Server, install and run it with lightrag-server command. https://github.com/HKUDS/LightRAG/blob/main/lightrag/api/README.md

@yulink1981
Copy link
Author

I think you are not starting the API server in a correct way. Please refer to README of API Server, install and run it with lightrag-server command. https://github.com/HKUDS/LightRAG/blob/main/lightrag/api/README.md

The problem still exists.

INFO: Process 26864 Shared-Data created for Single Process
INFO: Created new empty graph
INFO:nano-vectordb:Init {'embedding_dim': 1024, 'metric': 'cosine', 'storage_file': 'D:\lightrag\LightRAG\rag_storage\vdb_entities.json'} 0 data
INFO:nano-vectordb:Init {'embedding_dim': 1024, 'metric': 'cosine', 'storage_file': 'D:\lightrag\LightRAG\rag_storage\vdb_relationships.json'} 0 data
INFO:nano-vectordb:Init {'embedding_dim': 1024, 'metric': 'cosine', 'storage_file': 'D:\lightrag\LightRAG\rag_storage\vdb_chunks.json'} 0 data
Starting Uvicorn server in single-process mode on 0.0.0.0:9621
INFO: Started server process [26864]
INFO: Waiting for application startup.
ERROR: Traceback (most recent call last):
File "D:\lightrag\LightRAG\Lib\site-packages\starlette\routing.py", line 692, in lifespan
async with self.lifespan_context(app) as maybe_state:
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\Lib\site-packages\fastapi\routing.py", line 133, in merged_lifespan
async with original_context(app) as maybe_original_state:
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\Lib\site-packages\fastapi\routing.py", line 133, in merged_lifespan
async with original_context(app) as maybe_original_state:
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\Lib\site-packages\fastapi\routing.py", line 133, in merged_lifespan
async with original_context(app) as maybe_original_state:
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\Lib\site-packages\fastapi\routing.py", line 133, in merged_lifespan
async with original_context(app) as maybe_original_state:
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\api\lightrag_server.py", line 143, in lifespan
await rag.initialize_storages()
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\lightrag.py", line 469, in initialize_storages
await asyncio.gather(*tasks)
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\kg\json_kv_impl.py", line 37, in initialize
self.storage_updated = await get_update_flag(self.namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\lightrag\LightRAG\LightRAG-main\lightrag\lightrag\kg\shared_storage.py", line 311, in get_update_flag
raise ValueError("Try to create namespace before Shared-Data is initialized")
ValueError: Try to create namespace before Shared-Data is initialized

ERROR: Application startup failed. Exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants