Query documents that failed to embed
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.6.5
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
SQL syntax error,the data of "error" cannot be queried:
✔️ Expected Behavior
❌ Actual Behavior
sql syntax correction
It looks like the issue you're encountering with the SQL syntax error might not be directly related to the query syntax you've shared. The code snippet you provided for querying Document records by dataset_id with an indexing_status of either 'error' or 'paused' appears to be syntactically correct for SQLAlchemy ORM usage. Here are a few things to double-check:
- Ensure that your
Documentmodel is correctly defined for SQLAlchemy, as the model needs to accurately map to your database schema for the ORM operations to work as expected. - Verify that the
dataset_idpassed to the function is of the correct type expected by your database schema. If your schema expects a UUID and you're passing a string, there should be compatibility, but it's worth double-checking the expected format. - Confirm that your SQLAlchemy session (
db.session) is properly configured and connected to your database. Issues with session configuration or database connectivity can sometimes manifest as SQL syntax errors.
If these checks don't resolve the issue, the exact error message or further details about the context in which this error occurs could provide more clues.
Details
Sources
- api/services/dataset_service.py
- api/core/rag/models/document.py
- api/models/dataset.py
- api/migrations/versions/64b051264f32_init.py
- api/config.py
- api/controllers/console/datasets/datasets.py
- api/tasks/document_indexing_task.py
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.
To continue the conversation, mention @dosu.