Comments (1)
Hey @plaethosai! Great to see you back. Hope you're doing well!
The TypeError: 'NoneType' object is not iterable
error in the celery_worker.process_integration_brain_sync
task likely occurs because the integration.get_integration_brain_by_type_integration("notion")
call returns None
instead of an iterable object (like a list). This can happen if the method get_integration_brain_by_type_integration
does not find any integrations of type "notion" and returns None
instead of an empty list or if there's an issue within the method itself that leads to an unexpected None
return.
To resolve this issue, ensure that get_integration_brain_by_type_integration
always returns an iterable object, even when no integrations are found. This can be done by returning an empty list if no results are found or by adding a check before iterating over integrations
to ensure it is not None
. Here's a quick example of how you might modify the process_integration_brain_sync
task to include such a check:
@celery.task
def process_integration_brain_sync():
integration = IntegrationBrain()
integrations = integration.get_integration_brain_by_type_integration("notion")
if integrations is None:
logger.info("No integrations found.")
return
time = datetime.now(timezone.utc)
for integration in integrations:
print(f"last_synced: {integration.last_synced}")
last_synced = datetime.strptime(
integration.last_synced, "%Y-%m-%dT%H:%M:%S.%f%z"
)
if last_synced < time - timedelta(hours=12):
process_integration_brain_sync_user_brain.delay(
brain_id=integration.brain_id, user_id=integration.user_id
)
Regarding the issue of the backend core failing to import BaseSettings
from pydantic
, this could be due to several reasons such as an incorrect Pydantic version where BaseSettings
is not available, or a misconfiguration in the environment. To resolve this, ensure that you have the correct version of Pydantic installed where BaseSettings
is available. BaseSettings
is a class provided by Pydantic for settings management, so you should ensure that your Pydantic installation is not corrupted and is up to date. You can update Pydantic using pip:
pip install -U pydantic
If the issue persists, check your import statements to ensure they are correct and that there are no circular dependencies or other import-related issues in your project.
The celery_worker.process_integration_brain_sync
task in the quivr codebase is designed to synchronize user brains with their Notion integrations. It retrieves all integrations of type "notion" from the database and checks if the last synchronization time for each integration is more than 12 hours ago. If so, it triggers the process_integration_brain_sync_user_brain
task for each of those integrations, passing the brain_id
and user_id
as arguments. This task is scheduled to run every 5 minutes. You can find more details in the backend/celery_worker.py file.
Sources
About Dosu
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.
Related Issues (20)
- [Bug]: Api Not authenticated HOT 2
- [Bug]: Setting up locally shows screen "Talk to Quivr Unpaid users have access to a free and limited demo of Quivr" HOT 16
- [Bug]: Unable to Access Login Page and Enter Credentials HOT 6
- [Bug]: While creating a new brain in localhost instance of Quivr, I am getting error HOT 16
- [Bug]: HOT 5
- [Bug]:
- [Bug]: error /app/node_modules/sharp: Command failed. HOT 2
- LocalAI support HOT 3
- [Bug]: GPT4 Brain code is not clean
- [Bug]: Unable to start backend-core HOT 8
- [Bug]: "error":"model 'llama2' not found, try pulling it first" HOT 6
- [Bug]: How to use the embedding model of ollama HOT 2
- [Bug]: runtime error: slice bounds out of range [1:0] HOT 1
- [Bug]: No model on ollama was used to answer HOT 16
- [Bug]: Not able to create brain on AWS Linux HOT 1
- [Epic]: Where does the user change the language? HOT 3
- How to set up the groq api? HOT 3
- [Bug]: it's still using OpenAI after set Ollama in .env file HOT 2
- [Feature]: azure open ai vs OpenAI key
- [Bug]: UnpickleableExceptionWrapper('postgrest.exceptions', 'APIError', ('{\'code\': \'42P01\', \'details\': None, \'hint\': None, \'message\': \'relation "public.syncs_active" does not exist\'}',), 'Error 42P01:\nMessage: relation "public.syncs_active" does not exist') HOT 3
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.