dify plugin_daemon 安装插件失败、无法添加模型、添加模型连接无响应卡死等问题

7,191 阅读1分钟

问题原因: 由于dify的plugin_daemon安装插件依赖时访问的时候境外源,可以从plugin_daemon日志看出来

image.png

解决方案: 设置境内源,如阿里、清华等

在dify/docker/.env 文件新增两个参数

PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn

在dify/docker/docker-compose.yaml文件 引用在x-shared-env,并在services调用参数

在x-shared-env:引用配置

  PIP_INDEX_URL: ${PIP_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}
  PIP_TRUSTED_HOST: ${PIP_TRUSTED_HOST:-pypi.tuna.tsinghua.edu.cn}

image.png

在plugin_daemon的environment调用配置

      PIP_TRUSTED_HOST: $PIP_TRUSTED_HOST
      PIP_INDEX_URL: $PIP_INDEX_URL

image.png

最后保存重启即可

docker compose down
docker compose up -d

查看日志可以看到使用国内源了,插件问题已经解决了

image.png