issue: VisionRouter brkken in v.0.9.6 Users.get_user_by_id called without await causes ‘coroutine’ object has no attribute ‘role’ error

用户在 Open WebUI v0.9.6(Docker 部署)中安装了 VisionRouter 插件,配置了一个非视觉模型和一个可用的视觉模型。当向非视觉模型发送图片时,出现错误: 'coroutine' object has no attribute 'role' ,状态消息显示 “Error

issue: VisionRouter brkken in v.0.9.6 Users.get_user_by_id called without await causes 'coroutine' object has no attribute 'role' error

issue: VisionRouter brkken in v.0.9.6 Users.get_user_by_id called without await causes ‘coroutine’ object has no attribute ‘role’ error

快速结论:该报错出现在 Open WebUI v0.9.6 中使用 VisionRouter 插件转发图片到视觉模型时。优先排查 VisionRouter 插件是否已升级到兼容 v0.9.x 的版本,以及插件代码中是否有 await 缺失导致的协程对象属性访问错误。

问题场景

用户在 Open WebUI v0.9.6(Docker 部署)中安装了 VisionRouter 插件,配置了一个非视觉模型和一个可用的视觉模型。当向非视觉模型发送图片时,出现错误:'coroutine' object has no attribute 'role',状态消息显示 “Error processing image 1”。此问题在 OWUI 更新到 v0.9.6 后出现。

报错原文

Error processing image 1: 'coroutine' object has no attribute 'role'

同时,后端日志可能包含类似以下内容的堆栈:

Users.get_user_by_id called without await
coroutine object has no attribute 'role'

原因分析

根据 Issue 讨论,此问题并非 Open WebUI 自身的 bug,而是 VisionRouter 插件未适配 Open WebUI 0.9.x 版本的 API 变更所致。v0.9.0 引入了插件系统迁移(官方文档说明),VisionRouter 插件代码中调用 Users.get_user_by_id 时缺少 await 关键字,导致返回的是一个协程对象(coroutine)而非实际结果,后续访问该对象的 role 属性时报错。

环境排查

  • Open WebUI 版本:v0.9.6(确认是否为最新)
  • VisionRouter 插件版本:确认是否已更新到兼容 v0.9.x 的版本
  • 依赖环境:Docker 部署,操作系统 Debian

解决步骤

  1. 检查 VisionRouter 插件文档或仓库,确认是否有针对 Open WebUI v0.9.0+ 的更新版本。
  2. 如果插件未更新,作为临时方案可回退 Open WebUI 到 v0.8.x 版本(不推荐生产环境)。
  3. 如果自行修复插件代码,找到 Users.get_user_by_id 调用处,添加 await 关键字(如 user = await Users.get_user_by_id(...))——可优先尝试此方法
  4. 参考官方插件迁移指南:https://docs.openwebui.com/features/extensibility/plugin/migration/to-0.9.0

验证方法

修复后,重新向非视觉模型发送图片,观察是否不再出现 “Error processing image” 错误,图片被正确转发到配置的视觉模型处理。

参考来源

open-webui/open-webui #25999

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

celebrityanime
celebrityanime
文章: 7773

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注