can't complete sync with notion
Self Checks
- [X] This is only for bug report, if you would like to ask a question, 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.16
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Follow https://docs.dify.ai/v/zh-hans/guides/knowledge-base/sync-from-notion
✔️ Expected Behavior
❌ Actual Behavior
notion workspace display empty, however, I do have pages in it.
Hello, @suredream! I'm here to help you with bug reports, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer to join in.
I found two similar unsolved discussions that might be relevant to your issue:
- Error when adding Notion data source in the community version of Dify [1].
- Can't connect to Notion [2].
To resolve the issue of an empty Notion workspace display in Dify version 0.6.16 when syncing with a self-hosted Docker setup, ensure that you have correctly configured the Notion integration in the .env file. Here are the steps to check and configure the integration:
-
Verify Integration Type: Ensure that you have set the correct integration type in the
.envfile. It should be eitherinternalorpublic. -
Set Environment Variables:
- For internal integration:
NOTION_INTEGRATION_TYPE=internal NOTION_INTERNAL_SECRET=your-internal-secret - For public integration:
NOTION_INTEGRATION_TYPE=public NOTION_CLIENT_SECRET=your-client-secret NOTION_CLIENT_ID=your-client-id
- For internal integration:
-
Check Authorization: Make sure that the authorization process is completed successfully. You should have bound the Notion source correctly as described:
- Go to Settings -> Data Source -> Add Data Source and click on Notion to bind and complete the authorization.
-
Import Notion Data: After completing the authorization verification, go to the create dataset page, click Sync from Notion Content, and select the authorized pages you need to import. Choose your segmentation settings and indexing method, then Save and Process.
-
Sync Data: If your Notion content is modified, you can directly click Sync in the Dify dataset Document List Page to perform a one-click data synchronization.
By ensuring these configurations and steps are correctly followed, you should be able to resolve the issue of an empty Notion workspace display [3][4][5][6].
To continue talking to Dosu, mention @dosu.
We have several fixes related to notion since this version, please try the latest version to see if this issue persists.
@crazywoola tks. I followed the instruction here:
https://docs.dify.ai/v/zh-hans/getting-started/install-self-hosted/docker-compose#geng-xin-dify
After the updates, the issues are still the same.
I had the similar incompleted sync issue on some pages in Notion as well, at verson 0.7.1. It seems the import function of dify cannot recognize the "Toggled section" or embedded page in the Notion. I had to export the pages in the Notion then imported to dify knowledge. Just FYI.
@sweetkey then it is not "sync", right? What if you have updated the pages in the notion later?
@suredream I solved this issue following the comment here
@lumenghz can you sync pages from notion now? I can link a notion, no errors report but no pages founded.
At the Notion, the database (may be shown as the page) needs to authorize the connection to Dify. Go to setting at the page, look for the connection setting, choose appropriate dify connection.
Sync Notion function works, just for your information.
It is. Many thanks! Life saver.
I will include a case that I resolved as well. I experienced the same issue, and upon carefully re-checking the NOTION_INTERNAL_SECRET, I found a typo. Even though there was a typo, Dify and Notion displayed a successful connection, which delayed the resolution of the problem. In reality, the SECRET was incorrect, so the connection was not actually successful. Please double-check for any typos.