当前位置: 首页 > news >正文

Dify 部署问题处理

Dify介绍

Dify 是一款开源的大语言模型(LLM) 应用开发平台。它融合了后端即服务(Backend as Service)和 LLMOps 的理念,使开发者可以快速搭建生产级的生成式 AI 应用。即使你是非技术人员,也能参与到 AI 应用的定义和数据运营过程中。

问题1:docker_api_1 、docker_worker_1 服务和docker_sandbox_1 组件一直处于restarting

docker_api_1           /bin/bash /entrypoint.sh         Restarting
docker_db_1            docker-entrypoint.sh postg ...   Up (healthy)   5432/tcp
docker_nginx_1         sh -c cp /docker-entrypoin ...   Up             0.0.0.0:444->443/tcp,:::444->443/tcp, 0.0.0.0:7002->80/tcp,:::7002->80/tcp
docker_plugin_daemon_1 /bin/bash -c /app/entrypoi ...   Up          0.0.0.0:5003->5003/tcp    
docker_redis_1         docker-entrypoint.sh redis ...   Up (healthy)   6379/tcp
docker_sandbox_1       /main                            Restarting
docker_ssrf_proxy_1    sh -c cp /docker-entrypoin ...   Up             3128/tcp
docker_weaviate_1      /bin/weaviate --host 0.0.0 ...   Up
docker_web_1           /bin/sh ./entrypoint.sh          Up             3000/tcp
docker_worker_1        /bin/bash /entrypoint.sh         Restarting

刚开始按照 https://github.com/langgenius/dify/discussions/12312 将docker-compose.yaml 配置文件中LOG_FILE: ${LOG_FILE:-/app/logs/server.log} 调整为LOG_FILE: /app/logs/server.log 然后重启后,docker_api_1 暂时恢复正常,另外两个仍然异常。(为何是暂时,因为后面docker_api_1 又处于restarting状态)

这时查看服务日志

docker logs docker_sandbox_1
docker logs docker_worker_1

错误内容提示:

OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 4: Operation not permitted
runtime/cgo: pthread_create failed :Operation not permitted


解决方法:添加特权运行配置

推测是容器权限不够,准备在docker-compose.yaml中添加特权运行配置内容。需要将docker_api_1 、docker_worker_1 docker_sandbox_1 都添加特权运行。

docker_api_1

  api:image: langgenius/dify-api:1.4.1restart: alwaysprivileged: true

docker_worker_1

  worker:image: langgenius/dify-api:1.4.1restart: alwaysprivileged: true

docker_sandbox_1

  sandbox:image: langgenius/dify-sandbox:0.2.12restart: alwaysprivileged: true

然后重新启动

docker compose down
docker compose up -d

重新查看服务都起来了,若是其他服务查看日志也是权限问题,按照此方法添加特权运行即可。

问题2:安装模型供应商提示【init environment for plugin langgenius/openai:0.0.26 failed too many times you should consider the package is corrupted or your network is unstable】

不论是在线安装还是离线安装都是安装失败。

查看docker_plugin_daemon_1 组件日志,

docker logs docker_plugin_daemon_1 

错误显示 operation not permitted,还是权限问题

解决方法: docker_plugin_daemon 添加特权配置内容

在docker-compose.yaml 对docker_plugin_daemon_1 添加特权运行配置

  plugin_daemon:image: langgenius/dify-plugin-daemon:0.1.1-localrestart: alwaysprivileged: true

然后重启

docker-compose down  
docker-compose up -d

这时重新安装还是失败,重新查看ocker_plugin_daemon_1 日志,提示

[ERROR]init environment failed: failed to install dependencies: exit status 2, output: error: Failed to unzip wheel: openai-1.64.0-py3-none-any.whlCaused by: an upstream reader returned an error: io error occurred: HTTP status client error (403 Forbidden) for url (https://pypi.tuna.tsinghua.edu.cn/packages/9a/e6d503e1ea474522b2a15a904bb/openai-1.64.0-py3-none-any.whl)Caused by: io error occurred: HTTP status client error (403 Forbidden) for url (https://pypi.tuna.tsinghua.edu.cn/packages/9a/1a/e62718f311daa26d208800976d7944e5ee64.0-py3-none-any.whl)Caused by: HTTP status client error (403 Forbidden) for url (https://pypi.tuna.tsinghua.edu.cn/packages/9a/1a/e62718f311daa26d208800976d7944e5ee6d503e1ea474522b2a15l)

之前修改过.env 配置的 PIP_MIRROR_URL 内容,看报错是这个配置导致的,调整pip源

解决方法:修改 .env配置文件中 PIP_MIRROR_URL值

PIP_MIRROR_URL 设置为:https://mirrors.aliyun.com/pypi/simple/

然后重新启动Dify

docker compose down
docker compose up -d

这时安装模型供应商插件安装成功
在这里插入图片描述

http://www.xdnf.cn/news/776017.html

相关文章:

  • 本地部署 DeepSeek R1(最新)【从下载、安装、使用和调用一条龙服务】
  • MySQL触发器与视图
  • 什么是阻抗匹配
  • Python训练营---Day43
  • 一键解决Github无法访问或时断时续的问题-Linux环境
  • 页岩油开采的阶段
  • 无畏契约 directx runtime修复
  • 【CATIA的二次开发18】根对象Application涉及用户交互相关方法
  • MyBatis04:SpringBoot整合MyBatis——多表关联|延迟加载|MyBatisX插件|SQL注解
  • 《棒球万事通》棒球特长生升学方向·棒球1号位
  • 【CF】Day73——Codeforces Round 887 (Div. 2) B (思维 + 模拟)
  • 【基于阿里云搭建数据仓库(离线)】DataWorks中删除节点
  • 【C语言预处理详解(上)】--预定义符号,#define定义常量,#define定义宏,带有副作用的宏参数,宏替换的规则,宏和函数的对比
  • 【MIMO稳定裕度】基于数据驱动的多输入多输出系统稳定裕度分析
  • 【HW系列】—安全设备介绍(开源蜜罐的安装以及使用指南)
  • Ubuntu20.04 LTS 升级Ubuntu22.04LTS 依赖错误 系统崩溃重装 Ubuntu22.04 LTS
  • Qt共享内存(QSharedMemory)使用指南
  • openai-java
  • 白银价格查询接口如何用Java进行调用?
  • 【nm】nm命令的使用:查看.so中的符号信息
  • ps自然饱和度调整
  • 江科大RTC实时时钟hal库实现
  • 模块二:C++核心能力进阶(5篇)第三篇:《异常安全:RAII与异常传播的最佳实践》
  • 性能测试的概念和场景设计
  • 【LLM】AI Agents vs. Agentic AI(概念应用挑战)
  • 污痕圣杯:阿瓦隆的陨落 整合包 离线版
  • vite构建工具
  • Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String
  • 基于springboot的家政服务预约系统
  • LINUX62软链接;核心目录;错题:rpm -qa |grep<包名> 、rpm -ql<包名>;rm -r rm -rf;合并 cat