Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

bugfix: db insert error when notion page_name too long (#14316)

nickname93a5ffb037b9
diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py
index df38dc3c169..edf51851fb4 100644
--- a/api/services/dataset_service.py
+++ b/api/services/dataset_service.py
@@ -975,6 +975,8 @@ class DocumentService:
"notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,
"type": page.type,
}
+ # Truncate page name to 255 characters to prevent DB field length errors
+ truncated_page_name = page.page_name[:255] if page.page_name else "nopagename"
document = DocumentService.build_document(
dataset,
dataset_process_rule.id, # type: ignore
@@ -985,7 +987,7 @@ class DocumentService:
created_from,
position,
account,
- page.page_name,
+ truncated_page_name,
batch,
knowledge_config.metadata,
)