Comments (2)
🤖
The error you're encountering, "Error while creating the brain" with a 'PGRST200' code indicating no relationship found between 'brains_users' and 'brains' in the schema cache, is likely due to a missing or incorrect relationship between these two entities in your database schema.
In the Quivr codebase, the create_new_brain
function in brain_routes.py
is responsible for creating a new brain. After creating a new brain, it also creates a new brain-user relationship using the create_brain_user
function from the BrainUserService
.
new_brain = brain_service.create_brain(
brain=brain,
user_id=current_user.id,
)
logger.info(f"Creating default brain for user {current_user.id}.")
brain_user_service.create_brain_user(
user_id=current_user.id,
brain_id=new_brain.brain_id,
rights=RoleEnum.Owner,
is_default_brain=True,
)
If the relationship between 'brains_users' and 'brains' is not properly defined in your database schema, this could lead to the error you're seeing. You should check your database schema to ensure that the relationship between these two entities is correctly defined.
Unfortunately, without the database schema or the implementation details of the BrainUserService
and BrainService
, I can't provide a more specific solution.
As for the structure of the 'brains_users' and 'brains' tables in the database schema, the 'brains_users' table should have the following structure:
- id (Integer, primary key)
- user_id (Integer, ForeignKey referencing "users.user_id")
- brain_id (Integer, ForeignKey referencing "brains.brain_id")
- rights (String)
And the 'brains' table should have the following structure:
- brain_id (Integer, primary key)
- name (String)
You can find these details in the supabase/seed.sql and backend/models/sqlalchemy_repository.py files in the Quivr repository.
Please verify that your database schema matches this structure and that the foreign key relationships are correctly defined. If the issue persists, please provide more details about your setup, including the version of Quivr you're using, your database setup, and any changes you've made to the codebase.
Sources
- backend/modules/brain/controller/brain_routes.py
- supabase/seed.sql
- backend/models/sqlalchemy_repository.py
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from quivr.
Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion.
from quivr.
Related Issues (20)
- Invariant SQL scripts HOT 1
- Notion pages upload bug HOT 1
- [Feature]: i18n support HOT 1
- BUG task crawler HOT 1
- BUG same file multiple user HOT 1
- Sync should use notifier service HOT 1
- Use documents metadata to improve the retrieval HOT 1
- Automatically extract document metadata HOT 1
- Enable filtering on extracted document metadata HOT 1
- Switching to LangGraph in the ingestion pipeline HOT 1
- Improving user experience in long conversations HOT 1
- [Bug]: the knowledge counter is stuck at 1000 HOT 3
- [Bug]: Document ...once loaded (by mistake) cannot be unloaded....and has to be embedded HOT 2
- [Bug]: pnly one file show up as loaded for ingestion even when multiple files are dragged for addition HOT 2
- fix celery notifier update status exception HOT 1
- Fix generate url knowledge in multiple brain HOT 1
- [Bug]: ✘ worker Error pull access denied for quivr-backend-api, repository does not exist or may require 'docker login' HOT 5
- [Feature]: csv file uploaded in the knowledge base should not be downloadable (via sources) HOT 2
- [Bug]: Can't Add Ollama Using Supabase HOT 4
- [Backend] Remove SyncFile and SyncActive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quivr.