#13932·1Panel

[Bug] Firewall rules fail to sync correctly, and sync errors cannot be deleted

Author: Deemo119Created Sep 28, 2026Updated Sep 28, 2026
Labelstype: bug

Contact Information

1panelvip交流群7,红烧排骨

1Panel Version

专业版v2.3.2

Problem Description

在 1Panel 主机防火墙中创建了一条规则(放行 TCP 34256,5678),但该规则在列表中显示未同步,且没有删除按钮。

Steps to Reproduce

在防火墙创建了34256,5678

Image

1panel中显示未同步,且规则没有删除按钮

Image

点击同步后日志如下

2026/09/28 11:33:24 同步 f7057a47-a1b6-4e3f-ab4a-0a8609b1f444 [ufw:incoming:ipv6] tcp : -> :25566 accept 已一致,无需变更
2026/09/28 11:33:24 创建 d619a6ae-69db-4b9c-a7cf-9431de1be8e1 [ufw:incoming:ipv4] tcp : -> :34256,5678 accept 成功
2026/09/28 11:33:24 同步操作汇总:删除成功 0 条,创建成功 1 条,失败 0 条,未执行 0 条,已一致无需变更 54 条
2026/09/28 11:33:24 同步规则到 ufw 成功
2026/09/28 11:33:24 [TASK-END]

终端中查询:

root@wuanjun-TS-FL1C:/home/wuanjun# sudo ufw status numbered | grep -E '5678|34256'
[29] 5678,34256/tcp             ALLOW IN    Anywhere                   # 1panel-rule:d619a6ae-69db-4b9c-a7cf-9431de1be8e1
root@wuanjun-TS-FL1C:/home/wuanjun# 

在终端删除规则:

root@wuanjun-TS-FL1C:/home/wuanjun# sudo ufw delete allow 5678,34256/tcp
规则已删除
无法删除不存在的规则 (v6)
root@wuanjun-TS-FL1C:/home/wuanjun# 

返回刷新防火墙,有删除按钮,但删除报错

Image
2026/09/28 11:45:35 删除防火墙规则[主机防火墙] 任务开始 [START]
2026/09/28 11:45:35 rules=1
2026/09/28 11:45:35 [1/1] d619a6ae-69db-4b9c-a7cf-9431de1be8e1 失败 execute UFW rule: firewall rule state is stale: Could not delete non-existent rule
2026/09/28 11:45:35 操作结果:成功 0 条,失败 1 条
2026/09/28 11:45:35 删除防火墙规则[主机防火墙] 失败: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule
2026/09/28 11:45:36 [TASK-END]

尝试重启ufw和重置ufw问题依然存在

但是创建其他规则,功能正常

The expected correct result

能删除这个未同步规则

Related log output

bash

Additional Information

1penal系统日志


[2026-09-28 00:00:00] [INFO] clear monitor website log  task has completed  
[2026-09-28 00:00:00] [INFO] clean tamper orphan task has completed  
[2026-09-28 00:00:00] [INFO] clear waf log  task has completed  
[2026-09-28 00:00:00] [INFO] Website scheduled task in progress ...  
[2026-09-28 00:00:00] [INFO] Website scheduled task has completed  
[2026-09-28 00:00:00] [INFO] The scheduled certificate update task is currently in progress ...  
[2026-09-28 00:00:00] [INFO] The scheduled certificate update task has completed  
[2026-09-28 00:21:00] [INFO] AppStore scheduled task in progress ...  
[2026-09-28 00:21:00] [INFO] [AppStore] sync app from remote task create start  
[2026-09-28 00:21:00] [INFO] [AppStore] sync app from remote task create ok  
[2026-09-28 00:21:00] [INFO] AppStore scheduled task has completed  
[2026-09-28 00:21:00] [INFO] [AppStore] download file from https://apps-assets.fit2cloud.com/stable/1panel.json.zip  
[2026-09-28 00:21:00] [INFO] [AppStore] Appstore is up to date  
[2026-09-28 00:21:00] [INFO] [AppStore] meta sync skipped: no update needed  
[2026-09-28 06:00:00] [INFO] The scheduled certificate update task is currently in progress ...  
[2026-09-28 06:00:00] [INFO] The scheduled certificate update task has completed  
[2026-09-28 11:19:47] [ERROR] firewall deletion task 33c3605c-a501-4520-bcc5-49ca6cb02e74 failed: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule  
[2026-09-28 11:22:58] [ERROR] firewall deletion task 77915383-12d8-426a-b952-c86ec34ca97a failed: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule  
[2026-09-28 11:23:06] [ERROR] firewall deletion task 335652a2-4e7e-4009-88b6-04b8f5420a37 failed: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule  
[2026-09-28 11:31:24] [ERROR] firewall deletion task cf425e3b-ea3a-4d02-8fea-ac1d987dd5c2 failed: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule  
[2026-09-28 11:45:36] [ERROR] firewall deletion task 4e89aa98-bab6-4ba3-a78c-f468282c69fd failed: execute UFW rule: firewall rule state is stale: Could not delete non-existent rule