Skip to content

[Bug] 升级应用时容器名冲突导致失败,回滚也失败 #13083

@baoyu0

Description

@baoyu0

环境

  • 1Panel 版本: v2.2.2,stable 模式
  • 应用: MySQL(8.4.9 → 8.4.10)
  • Docker: 容器使用固定名称 1Panel-mysql-OrLW

复现步骤

  1. 在应用商店中对已安装的 MySQL 点击「升级」
  2. 备份、拉取镜像、执行 upgrade 脚本均成功
  3. 「启动应用」阶段报错

实际结果

Container 1Panel-mysql-OrLW Error response from daemon: Conflict.
The container name "/1Panel-mysql-OrLW" is already in use by container "xxxxx".
You have to remove (or rename) that container to be able to reuse that name.

原因分析

升级流程在「启动应用」步骤中,直接 docker create --name 1Panel-mysql-OrLW,但旧容器未被 stop/remove,导致容器名冲突。之后回滚步骤也失败,回滚时备份文件路径拼接异常,提示文件不存在(实际文件存在)。

期望行为

升级流程应在创建新容器前先 stop + remove 旧容器,或使用其他方式避免容器名冲突。

日志

2026/06/19 13:06:08 升级应用 [mysql] 任务开始
2026/06/19 13:06:08 备份应用 [mysql] 成功
2026/06/19 13:06:10 拉取镜像 成功
2026/06/19 13:06:10 执行 upgrade 脚本 成功
2026/06/19 13:06:11 升级应用 [mysql] 失败: 容器名冲突
2026/06/19 13:06:11 应用 mysql 回滚 失败: 备份文件不存在

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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