Skip to content

[Bug] Astrbot启动时报错KeyError: 'type' #8275

@heerxingen

Description

@heerxingen

What happened / 发生了什么

启动时提示KeyError: 'type',搜索相关issue后发现可能和config文件有关,挨个移除config文件排查无结果(data/config下文件全部移除也继续报错)

Reproduce / 如何复现?

启动Astrbot

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

报告时/目前的版本为v4.25.1,但这个bug从我用v4.24.2就开始出现了并且一直没消失
使用uv包部署管理器部署在Ubuntu 26.04

OS

Linux

Logs / 报错日志

[2026-05-21 22:08:17.783] [Core]
[ERRO]
[v4.25.1] [provider.manager:283]: Traceback (most recent call last):
File "/home/heerxingen/.local/share/uv/tools/astrbot/lib/python3.12/site-packages/astrbot/core/provider/manager.py", line 281, in initialize
await self.load_provider(provider_config)
File "/home/heerxingen/.local/share/uv/tools/astrbot/lib/python3.12/site-packages/astrbot/core/provider/manager.py", line 582, in load_provider
provider_config["type"],
~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'type'
[2026-05-21 22:08:17.783] [Core]
[ERRO]
[v4.25.1] [provider.manager:284]: 'type'

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreThe bug / feature is about astrbot's core, backendarea:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions