Skip to content

[Bug] Node promotion & demotion fails due to database errors #12173

@Eric-ZhehanZ

Description

@Eric-ZhehanZ

Contact Information

fit2cloud@zhehanz.com

1Panel Version

2.1.4

Problem Description

Running the promote subcommand for Core database recovery fails with a panic:
load encrypt key from db failed, err: SQL logic error: no such table: settings (1)
The settings table is missing from core.db, preventing the encryption key from being loaded.
Reproduced on two independent machines with clean installations.

No error logs are visible on either machine; the child node disconnects on the error (1panel-agent stops running and a full reconfiguration of connection details is required).

Steps to Reproduce

root@REDACTED:~# 1panel-migrator version
Version: v2.0.12

root@REDACTED:~# 1panel-migrator promote

注意事项:
在将当前节点升级为主节点前,请务必阅读:

1. 升级过程中会暂停当前节点的 1Panel Agent 服务
2. 升级成功后,节点管理列表中的原主节点信息将被移除
3. 原主节点可降级为从节点,再重新添加至节点列表作为从节点使用

是否确认将当前节点升级为主节点?(y/n): y
即将自动下载 V2 安装包,请耐心等待并勿关闭终端。
2026/03/15 18:26:59 安装文件下载成功!
设置 1Panel 端口 (默认是 37282): REDACTED
您设置的端口是: REDACTED
正在打开防火墙端口 REDACTED
设置 1Panel 安全入口 (默认是 gfll440x1a): REDACTED
您设置的面板安全入口是: REDACTED
设置 1Panel 面板用户 (默认是 0lj2ykw284): REDACTED
您设置的面板用户是: REDACTED
设置 1Panel 面板密码,(默认是 tkc7jfz3qm): REDACTED
Core 数据库数据恢复失败,错误信息:load encrypt key from db failed, err: SQL logic error: no such table: settings (1)
Error: load encrypt key from db failed, err: SQL logic error: no such table: settings (1)
Usage:
   promote [flags]

Flags:
  -h, --help   help for promote

panic: load encrypt key from db failed, err: SQL logic error: no such table: settings (1)

goroutine 1 [running]:
main.main()
        ./main.go:9 +0x30

The expected correct result

Successful promotion/demotion of the node.

Related log output

Additional Information

Issue observed across multiple servers and operating systems:

  • 主节点 专业版 v2.1.4 Debian GNU/Linux 13 6.12.57+deb13-cloud-amd64
  • 从节点 社区版 v2.1.4 Ubuntu 24.04.1 LTS 6.8.0-48-generic
  • 从节点 社区版 v2.1.4 Debian GNU/Linux 13 6.12.57+deb13-cloud-amd64
  • 从节点 社区版 v2.1.4 Debian GNU/Linux 13 6.12.38+deb13-amd64

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions