Skip to content

[Bug] WebUI dist 缺失 index/assets 时启动阶段未校验,仍继续启动 #8784

@Cyrene2026

Description

@Cyrene2026

What happened / 发生了什么

我注意到:当 WebUI dist 产物不完整时,AstrBot 仍可能继续启动,且没有明确日志提示当前 data/dist 已损坏,也没有显式 fallback / redownload / fail-fast 行为。
具体表现:

  • data/dist 是空目录时,AstrBot 仍会把它当作 WebUI 目录使用,访问面板返回 404。
  • data/dist/index.html 缺失时,AstrBot 仍会继续启动,访问面板返回 404。
  • data/dist/assets 缺失时,AstrBot 仍会继续启动,并可能输出 WebUI is ready / AstrBot started,但浏览器无法加载 index.html 引用的 JS/CSS 资源。
    目前没有可观察的启动期诊断能说明 WebUI dist 已损坏。

Reproduce / 如何复现?

在干净文件夹clone完整项目,然后,同步依赖后。做以下动作:
1.在项目根目录新建data/dist文件夹,然后输入uv run main.py启动,输入127.0.0.1:6185会返回404
2.然后关掉该进程,删掉dist文件夹,仅留data文件夹,再次输入uv run main.py启动,之后就会正常下载dist.zip,然后正常解压,之后再次访问127.0.0.1:6185,即可正常进入。之后就会正常跳转登录页面。
3.再次关掉该进程,把index.html移动到项目外文件夹,再次输入相同命令启动,,输入127.0.0.1:6185会返回404
4.再次关掉该进程,把刚刚在项目外的index.html复原到原位置,删除assets文件夹,再次启动,输入127.0.0.1:6185,这次进去,你看到的是空白页面(也就是什么内容都没有)

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

v4.25.5 WebUI

OS

Windows

Logs / 报错日志

情况1.
Image
执行结果:
Image
情况2.
Image
执行结果:
Image
正常进入页面
情况3.
Image
执行结果:
Image
情况4.
Image
执行结果:

Image

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

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:webuiThe bug / feature is about webui(dashboard) of astrbot.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