dify icon indicating copy to clipboard operation
dify copied to clipboard

can't complete sync with notion

Open suredream opened this issue 1 year ago • 6 comments

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

image

❌ Actual Behavior

notion workspace display empty, however, I do have pages in it.

image

suredream avatar Aug 25 '24 06:08 suredream

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:

  1. Error when adding Notion data source in the community version of Dify [1].
  2. 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:

  1. Verify Integration Type: Ensure that you have set the correct integration type in the .env file. It should be either internal or public.

  2. 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
      
  3. 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.
  4. 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.

  5. 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.

dosubot[bot] avatar Aug 25 '24 06:08 dosubot[bot]

We have several fixes related to notion since this version, please try the latest version to see if this issue persists.

crazywoola avatar Aug 25 '24 06:08 crazywoola

@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.

suredream avatar Aug 25 '24 12:08 suredream

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 avatar Aug 25 '24 15:08 sweetkey

@sweetkey then it is not "sync", right? What if you have updated the pages in the notion later?

suredream avatar Aug 26 '24 04:08 suredream

@suredream I solved this issue following the comment here

lumenghz avatar Aug 26 '24 10:08 lumenghz

@lumenghz can you sync pages from notion now? I can link a notion, no errors report but no pages founded.

suredream avatar Aug 28 '24 12:08 suredream

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.

sweetkey avatar Aug 28 '24 14:08 sweetkey

It is. Many thanks! Life saver.

suredream avatar Aug 28 '24 22:08 suredream

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.

SteveMoribe avatar Nov 23 '24 01:11 SteveMoribe