Notion not being authorised (internal integration) #16726

Closed
opened 2026-02-21 19:27:20 -05:00 by yindo · 3 comments
Owner

Originally created by @dolbyzerr on GitHub (Sep 4, 2025).

Originally assigned to: @JohnJyong on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.8.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Create notion private integration

Image

On the fresh clone.

  1. Copy .env.sample -> .env cp .env.sample .env
  2. Update notion env variables as follows
# Configure as "public" or "internal".
# Since Notion's OAuth redirect URL only supports HTTPS,
# if deploying locally, please use Notion's internal integration.
NOTION_INTEGRATION_TYPE=internal
# Notion OAuth client secret (used for public integration type)
NOTION_CLIENT_SECRET=
# Notion OAuth client id (used for public integration type)
NOTION_CLIENT_ID=
# Notion internal integration secret.
# If the value of NOTION_INTEGRATION_TYPE is "internal",
# you need to configure this variable.
NOTION_INTERNAL_SECRET=ntn_...<your token>
  1. Start docker compose up, navigate to "Settings > Data Source > notion", click "Connect"

✔️ Expected Behavior

Notion being authorised.

Actual Behavior

Request pending and times out eventually (browser timeout)

Image
Originally created by @dolbyzerr on GitHub (Sep 4, 2025). Originally assigned to: @JohnJyong on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.8.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Create notion private integration <img width="1060" height="491" alt="Image" src="https://github.com/user-attachments/assets/9ad72eaf-72b7-4097-9f3a-26bd600168d4" /> On the fresh clone. 1. Copy .env.sample -> .env `cp .env.sample .env` 2. Update notion env variables as follows ```env # Configure as "public" or "internal". # Since Notion's OAuth redirect URL only supports HTTPS, # if deploying locally, please use Notion's internal integration. NOTION_INTEGRATION_TYPE=internal # Notion OAuth client secret (used for public integration type) NOTION_CLIENT_SECRET= # Notion OAuth client id (used for public integration type) NOTION_CLIENT_ID= # Notion internal integration secret. # If the value of NOTION_INTEGRATION_TYPE is "internal", # you need to configure this variable. NOTION_INTERNAL_SECRET=ntn_...<your token> ``` 3. Start `docker compose up`, navigate to "Settings > Data Source > notion", click "Connect" ### ✔️ Expected Behavior Notion being authorised. ### ❌ Actual Behavior Request pending and times out eventually (browser timeout) <img width="1365" height="912" alt="Image" src="https://github.com/user-attachments/assets/e60c8d90-a40b-4bce-9a9b-5ae1ea8956e6" />
yindo added the 🐞 bug label 2026-02-21 19:27:20 -05:00
yindo closed this issue 2026-02-21 19:27:20 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 4, 2025):

Hi @dolbyzerr! I'm Dosu and I’m helping the dify team.

This timeout is likely caused by the backend hanging when trying to contact the Notion API with your internal integration secret—there’s no error or timeout handling in the backend for this flow, so if the Notion API is unreachable, slow, or the token is invalid, the frontend just waits and eventually times out. The backend expects the Notion API to always respond quickly and successfully, which isn’t always the case in real-world setups. This is a known gap in Dify’s error handling for Notion internal integration (source).

To troubleshoot:

  • Check your backend/Docker logs for errors when you click “Connect”—look for network errors or Notion API failures.
  • From inside your Docker container, try making a direct API call to Notion using your NOTION_INTERNAL_SECRET to confirm connectivity and token validity.
  • Make sure your Docker environment allows outbound HTTPS requests to api.notion.com.

If you confirm the token and network are fine, but the issue persists, you may need to add error/timeout handling in the backend’s Notion integration code to avoid these indefinite waits (source).

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 4, 2025): <!-- Greeting --> Hi @dolbyzerr! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This timeout is likely caused by the backend hanging when trying to contact the Notion API with your internal integration secret—there’s no error or timeout handling in the backend for this flow, so if the Notion API is unreachable, slow, or the token is invalid, the frontend just waits and eventually times out. The backend expects the Notion API to always respond quickly and successfully, which isn’t always the case in real-world setups. This is a known gap in Dify’s error handling for Notion internal integration [(source)](https://github.com/langgenius/dify/blob/cdf9b674dc45b3efc062793204dafe6563ea8a9b/api/libs/oauth_data_source.py). To troubleshoot: - Check your backend/Docker logs for errors when you click “Connect”—look for network errors or Notion API failures. - From inside your Docker container, try making a direct API call to Notion using your NOTION_INTERNAL_SECRET to confirm connectivity and token validity. - Make sure your Docker environment allows outbound HTTPS requests to api.notion.com. If you confirm the token and network are fine, but the issue persists, you may need to add error/timeout handling in the backend’s Notion integration code to avoid these indefinite waits [(source)](https://github.com/langgenius/dify/blob/cdf9b674dc45b3efc062793204dafe6563ea8a9b/api/libs/oauth_data_source.py). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/89a98e56-d8e0-4500-a977-17534a1c21a4?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/25133)
Author
Owner

@dolbyzerr commented on GitHub (Sep 5, 2025):

@dosu I am testing locally (but it's the same problem deployed), can confirm that api.notion.com is reachable from within the docker container.

Image
@dolbyzerr commented on GitHub (Sep 5, 2025): @dosu I am testing locally (but it's the same problem deployed), can confirm that api.notion.com is reachable from within the docker container. <img width="1200" height="187" alt="Image" src="https://github.com/user-attachments/assets/9ec13c38-4cdf-4177-9e08-9376f177b1a7" />
Author
Owner

@dosubot[bot] commented on GitHub (Oct 6, 2025):

Hi, @dolbyzerr. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that Dify v1.8.1 self-hosted via Docker fails to authorize Notion internal integration, with connection requests hanging and eventually timing out.
  • The problem appears related to missing error and timeout handling in the backend when contacting the Notion API.
  • You confirmed that network connectivity to api.notion.com from inside the Docker container is working, so the issue is not network-related.
  • This issue remains unresolved and may require backend improvements to handle Notion API errors and timeouts properly.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open.
  • If I do not hear back within 15 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Oct 6, 2025): Hi, @dolbyzerr. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that Dify v1.8.1 self-hosted via Docker fails to authorize Notion internal integration, with connection requests hanging and eventually timing out. - The problem appears related to missing error and timeout handling in the backend when contacting the Notion API. - You confirmed that network connectivity to api.notion.com from inside the Docker container is working, so the issue is not network-related. - This issue remains unresolved and may require backend improvements to handle Notion API errors and timeouts properly. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open. - If I do not hear back within 15 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16726