langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
45.3k stars 6.36k forks source link

can't complete sync with notion #7611

Closed suredream closed 2 weeks ago

suredream commented 2 weeks ago

Self Checks

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
dosubot[bot] commented 2 weeks ago

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.

crazywoola commented 2 weeks ago

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

suredream commented 2 weeks ago

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

sweetkey commented 2 weeks ago

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.

suredream commented 2 weeks ago

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

lumenghz commented 2 weeks ago

@suredream I solved this issue following the comment here

suredream commented 2 weeks ago

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

sweetkey commented 2 weeks ago

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.

suredream commented 2 weeks ago

It is. Many thanks! Life saver.