agentcloud
agentcloud copied to clipboard
Multithreading issue causes chat functionality to stop working
Description
Attempting to build a RAG on SQL data results in the first collection not being created due to an error in Qdrant local. After making a change to the model selection, the issue seemed resolved, but the chat functionality began to fail intermittently due to a multithreading issue.
Error Message
Received the following error message when the first issue occurred: ERROR vector_db_proxy: [utils] Error: status: InvalidArgument, message: "Validation error in body: [vectors_config.config.map[].size: value 0 invalid, must be from 1.0 to 65536.0]", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Fri, 19 Apr 2024 GMT", "content-length": "0"} }
Steps to Reproduce
- Create a collection in Qdrant local.
- Observe the failure to create the first collection.
- Change the model selection to Fast Embed instead of OpenAI.
- Note that the collection is now created but chat functionality is impacted.
Troubleshooting Steps Taken
- Added more logs to debug the issue.
- Checked the logs of the agent_backend service.
- Attempted to use the service multiple times; issue is intermittent.
Logs
Additional Information
- The issue seems to involve multithreading where values are being overwritten by another thread.
- Problem is intermittent, making it difficult to diagnose precisely.
Temporary Workaround to build a RAG on SQL Data
If you need you can Implement a temporary local fix for the RAG creation issue involving a multithreading problem and a collection not being created in Qdrant:
To resolve the issue I was facing, I had to remove the MongoDB container and volume and build everything from scratch. I feel there must be a bug in the DB CRUD code which might not be updating the foreign key fields properly. Because of which the data might have got corrupted.
This is not a permanent solution. Further investigation is needed to find the root cause and develop a long-term fix.