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.

Home Page:https://dify.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to obtain page information in notice

360troubleWind opened this issue · comments

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.12-fix1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I deployed dify locally and configured the integration of notion, I could not obtain the contents of the notion:

  1. If it is an internal notion, there will be no response when clicking configure.
    image

  2. If it is a public notion, an error will be reported when clicking on the configuration.
    image

✔️ Expected Behavior

Solved the problem and successfully obtained the content of my notice

❌ Actual Behavior

No response

@360troubleWind Hello there! I'm here to help you with any bugs, questions, or contributions you might have. Let's work together to solve the issue you're encountering.

To resolve the issue of not being able to obtain page information in Notion when using Dify version 0.6.12-fix1, self-hosted via Docker, you need to ensure that the Notion integration configuration is correctly set up. Specifically, you should check the following environment variables:

  1. NOTION_INTEGRATION_TYPE: This should be set to "internal" if you are using Notion's internal integration or "public" if you are using a public integration.
  2. NOTION_INTERNAL_SECRET: This should be configured with the Notion internal integration secret if NOTION_INTEGRATION_TYPE is set to "internal".
  3. NOTION_CLIENT_ID and NOTION_CLIENT_SECRET: These should be configured with the Notion client ID and client secret if NOTION_INTEGRATION_TYPE is set to "public".
  4. CONSOLE_API_URL and CONSOLE_WEB_URL: Ensure these URLs are correctly set to your backend and frontend URLs respectively, as they are used to concatenate the authorization callback and for CORS configuration.

Here is an example configuration for internal integration:

NOTION_INTEGRATION_TYPE=internal
NOTION_INTERNAL_SECRET=your_notion_internal_integration_secret
CONSOLE_API_URL=https://your-api-url
CONSOLE_WEB_URL=https://your-web-url

And for public integration:

NOTION_INTEGRATION_TYPE=public
NOTION_CLIENT_ID=your_client_id
NOTION_CLIENT_SECRET=your_client_secret
CONSOLE_API_URL=https://your-api-url
CONSOLE_WEB_URL=https://your-web-url

Make sure these variables are correctly set in your environment configuration file or Docker environment variables. This should resolve the issues with internal Notion pages not responding and the "Missing or invalid redirect_uri" error for public Notion pages.

Additionally, ensure that the redirect_uri parameter in your OAuth configuration matches the URL set in your Notion integration settings. The redirect_uri should be correctly formatted and should be the same as the one registered in your Notion OAuth application [1][2][3].

For more detailed steps on setting up the integration, you can refer to the Dify documentation on importing data from Notion [4].

Example Docker Configuration

Here is an example snippet from the docker-compose.yaml file that includes the relevant environment variables:

SENTRY_PROFILES_SAMPLE_RATE: 1.0
# Notion import configuration, support public and internal
NOTION_INTEGRATION_TYPE: public
NOTION_CLIENT_SECRET: your-client-secret
NOTION_CLIENT_ID: your-client-id
NOTION_INTERNAL_SECRET: your-internal-secret
# The sandbox service endpoint.
CODE_EXECUTION_ENDPOINT: "http://sandbox:8194"
CODE_EXECUTION_API_KEY: dify-sandbox
CODE_MAX_NUMBER: 9223372036854775807
CODE_MIN_NUMBER: -9223372036854775808
CODE_MAX_STRING_LENGTH: 80000
TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
CODE_MAX_STRING_ARRAY_LENGTH: 30
CODE_MAX_OBJECT_ARRAY_LENGTH: 30
CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
# SSRF Proxy server
SSRF_PROXY_HTTP_URL: 'http://ssrf_proxy:3128'
SSRF_PROXY_HTTPS_URL: 'http://ssrf_proxy:3128'
# Indexing configuration
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
depends_on:
  - db
  - redis
volumes:
  # Mount the storage directory to the container, for storing user files.
  - ./volumes/app/storage:/app/api/storage
# uncomment to expose dify-api port to host
# ports:
#   - "5001:5001"
networks:
  - ssrf_proxy_network
  - default

Ensure that these configurations are correctly set in your docker-compose.yaml file to avoid any issues with Notion integration [5].

To continue talking to Dosu, mention @dosu.