dify Notion导入失败,

7hiiyaii  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(45)

自我检查

  • 这仅用于提交错误报告,如果您想提问,请访问 Discussions
  • 我已在现有问题中搜索 search for existing issues (包括已关闭的问题)。
  • 我确认我使用英文提交此报告(我已阅读并同意 Language Policy )。
  • 请务必使用英文提交问题,否则会被关闭。谢谢!:)
  • 请不要修改此模板 :) 并填写所有必填字段。

Dify版本

0.6.14

云或自托管

自托管(Docker)

重现步骤

当我设置 Notion - 添加工作区时,它报告“内部服务器错误”。
我按照此文档中的说明操作 - https://docs.dify.ai/guides/knowledge-base/sync-from-notion 并编辑了 .env 文件。
NOTION_INTEGRATION_TYPE=internal
NOTION_INTERNAL_SECRET=secret_dFRK56YmrJZCmMda7J5VfqWDoKDmwlr9FWBCHpIgABC
但它仍然报告相同的问题。

以及以下的 docker log,

✔️ 预期行为

修复该问题。

❌ 实际行为

  • 无响应*
vm0i2vca

vm0i2vca1#

顺便说一下,由于保密原因,我在这里修改了内部秘密代码。

cedebl8k

cedebl8k2#

要解决在Dify版本0.6.14的自托管Docker环境中与Notion集成遇到的"Internal Server Error",请按照以下步骤操作:

  1. 检查环境变量:
    确保您的.env文件中正确设置了以下环境变量:
NOTION_INTEGRATION_TYPE=internal
NOTION_INTERNAL_SECRET=your_actual_internal_secret
  1. 修改NotionOAuth:
    错误信息表明与TypeError相关的vars()函数问题。可以通过确保NotionOAuth类具有__dict__属性来解决此问题。请按照以下方式修改类:
class NotionOAuth:
    def __init__(self, client_id=None, client_secret=None, redirect_uri=None):
        self.client_id = client_id
        self.client_secret = client_secret
        self.redirect_uri = redirect_uri
        # Add other necessary attributes here

如果在类中定义了__slots__,请将其删除:

class NotionOAuth:
    __slots__ = ['client_id', 'client_secret', 'redirect_uri']  # Remove this line if it exists
    def __init__(self, client_id=None, client_secret=None, redirect_uri=None):
        self.client_id = client_id
        self.client_secret = client_secret
        self.redirect_uri = redirect_uri
        # Add other necessary attributes here
  1. 重启Docker容器:
    在进行这些更改后,重启您的Docker容器以应用更新。
    这些步骤应该有助于解决您在使用Notion集成时遇到的内部服务器错误。
  • 要继续与我对话,请提及@dosu。*
uklbhaso

uklbhaso3#

第39行:oauth_provider = OAUTH_DATASOURCE_PROVIDERS.get(provider)
返回Nonetype,因为Vars()无法正常工作。

相关问题