You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @xlight! 👋 I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together!
The error you're encountering is due to the 'name' field in the 'documents' table exceeding the maximum allowed length of 255 characters. This is causing a StringDataRightTruncation error when trying to insert the data into the database.
To resolve this issue, you can implement a validation or truncation mechanism for the 'name' field before attempting to insert it into the database. This can be done by ensuring that the 'name' does not exceed 255 characters. You can either truncate the name to fit within this limit or raise an error if the name is too long.
Here's a simple example of how you might truncate the name:
deftruncate_name(name, max_length=255):
returnname[:max_length]
# Usagedocument_name="Your long document name here..."document_name=truncate_name(document_name)
Make sure to apply this logic in the part of your code where the document name is being set or processed before the database insertion. This will prevent the SQL error from occurring.
xlight
changed the title
SQL error cause by page.name too long when Sync Notion pages
SQL error cause by page_name too long when Sync Notion pages
Feb 25, 2025
xlight
added a commit
to xlight/dify
that referenced
this issue
Feb 25, 2025
Self Checks
Dify version
0.15.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
create a new Knowlege, and connect to notion,
sync notion pages,
save & process
✔️ Expected Behavior
Knowlege created success.
❌ Actual Behavior
http request error
API URL: /console/api/datasets/05bad57c-64be-4829-88d8-b424d04b8468/documents
error message
service log
The text was updated successfully, but these errors were encountered: