1Panel-dev / 1Panel-dev/1Panel

[Bug] App upgrade fails due to container-name conflict, and rollback also fails

Open
#13,083 1 comment 0 reactions 1 assignee View on GitHub

@wanghe-fit2cloud is already working on this.

Since Jun 22, 2026.

type: question
Dominant language
Go
Stars
37k
Forks
3.4k
Avg merge
9h 16m
Merged PRs (30d)
105

Description

环境

  • 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 回滚 失败: 备份文件不存在

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.