Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] "Clean Networks" deletes protected system network 1panel-network without checking container bindings, leaving all containers unable to start

未关闭
#13,871 1 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

维护者通常 1 天内回复

@xiaomeinvG 已经在做这个了。

开始于 2026年9月23日。

评估

这个 Issue 还没有评估数据。

描述

type: optimization

Problem Description

Two related defects in the Container → Networks → "Clean Networks" action (v2.3.1):

  1. Contradicts the official docs: the documentation states that none, host, bridge, and 1panel-network are built-in system networks that cannot be deleted, yet "Clean Networks" deletes 1panel-network.
  2. No binding check before deletion: it does not check whether any containers (including stopped ones) are attached to the network — no warning, no consequence shown. Afterwards every app container bound to that network fails to start.

An aggravating case: cleanup is still allowed while the Docker daemon is unhealthy. In our incident dockerd was in a crash loop (root cause same family as #13814: ip_forward=0 with firewall-backend: nftables). After clicking "Clean Networks", a zombie network was persisted: docker network ls still shows 1panel-network, but after the daemon recovers, docker run --network 1panel-network fails with network ... does not exist, and attaching new containers to it fails as well. Recovery required a manual docker network rm followed by recreating the network with the original subnet.

Steps to Reproduce

  1. Have dockerd in a startup-failure loop (in our case: Debian 13 with net.ipv4.ip_forward=0 and the nftables backend — the #13814 scenario)
  2. Panel → Containers → Networks → click "Clean Networks"
  3. 1panel-network is deleted (at the moment of the click, dockerd logs Error handling plugin refcount operation ... legacy plugin: Unable to find plugin without name)
  4. After the daemon recovers, every attached container fails to start:
    failed to set up container networking: failed to create endpoint <name>
    on network 1panel-network: network <id> does not exist
    
  5. docker network ls still lists the network (zombie state); docker network rm + recreating it with the same subnet restores service

Expected Behavior

  • "Clean Networks" treats 1panel-network as protected per the docs; or at minimum:
  • Before deletion, inspect the network's Containers list (including stopped containers) via docker network inspect and block deletion with a clear message when it is non-empty
  • Check daemon health before executing the cleanup and abort when the daemon is not healthy

Environment

  • OS: Debian 13 (trixie), kernel 6.12
  • Docker: 29.8.1, daemon.json contains "firewall-backend": "nftables"
  • 1Panel: v2.3.1
  • Related: #13814 (another defect in the same incident chain)
主要语言
Go
星标
37.1k
派生
3.4k
平均合并
13 小时
30 天内合并 PR
82

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

1Panel-dev/1Panel 的其他 Issue

查看 1Panel-dev/1Panel 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。