Self Checks
Dify version
1.13.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
- Setup a Notion knowledge base.
- Modify a page on Notion.
- Click the "Sync" button in the Dify Knowledge base interface.
✔️ Expected Behavior
The synchronization should complete successfully, and the knowledge base content should be updated to the latest version.
❌ Actual Behavior
The sync finishes instantly without updating content. The docker-worker-1 log shows:
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'dict'
[Identified Cause & Fix]
The error occurs because data_source_info is passed as a dict type to the DB update in api/tasks/document_indexing_sync_task.py (around line 128). It must be serialized to a JSON string.
Proposed code changes:
- Add
import json at the top of the file.
- Modify the assignment around line 128 as follows:
Before
document.data_source_info = data_source_info
After
document.data_source_info = json.dumps(data_source_info)
Applying this fix resolves the issue and allows the synchronization to complete normally.
This solution was generated with the assistance of Gemini 3 Flash.
Self Checks
Dify version
1.13.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
The synchronization should complete successfully, and the knowledge base content should be updated to the latest version.
❌ Actual Behavior
The sync finishes instantly without updating content. The docker-worker-1 log shows:
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'dict'
[Identified Cause & Fix]
The error occurs because data_source_info is passed as a dict type to the DB update in api/tasks/document_indexing_sync_task.py (around line 128). It must be serialized to a JSON string.
Proposed code changes:
import jsonat the top of the file.Before
document.data_source_info = data_source_info
After
document.data_source_info = json.dumps(data_source_info)
Applying this fix resolves the issue and allows the synchronization to complete normally.
This solution was generated with the assistance of Gemini 3 Flash.