lucky启动失败排查:luckyweb.(*Server).GetBaseConfigure(0x40002bc008)

故障

Lucky 在某一次开机后无法启动,查看日志发现了报错。

1
2
3
4
5
6
7
8
9
10
11
12
13
root@route:~# logread | grep lucky
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: panic: runtime error: invalid memory address or nil pointer dereference
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8d1af4]
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]:
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: goroutine 1 [running]:
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: github.com/gdy666/gdylib/luckyweb.(*Server).GetBaseConfigure(0x4000256408)
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: gdy/gdylib/luckyweb/server.go:565 +0x84
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: github.com/gdy666/lucky/webv2.RunAdminWeb(0x0, 0x1235a78)
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: gdy/lucky_own/webv2/webv2.go:60 +0x2c
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: main.run()
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: gdy/lucky_own/main.go:280 +0x4c
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: main.main()
Wed Oct 14 17:13:33 2026 daemon.err lucky[10023]: gdy/lucky_own/main.go:262 +0x604

手动启动尝试

直接在命令行输入 lucky ,成功以默认配置启动。(这会向当前目录写入配置文件,记得在空目录执行)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
root@route:~# lucky -cd /etc/lucky/
2026/10/15 20:36:03 configure dir:/etc/lucky/
2026/10/15 20:36:03 init default base configure
2026/10/15 20:36:03 可以将下面指令加入cron计划任务,每分钟定时检测lucky进程意外退出影响使用。
2026/10/15 20:36:03 */1 * * * * test -z "$(pidof lucky)" && lucky -cd /etc/lucky/ >/dev/null 2>&1
2026/10/15 20:36:03 RunMode:prod
2026/10/15 20:36:03 version:2.27.2 commit da8861d8aa861b34117267202d5303a2a1f91adf, built at 2026-02-02T06:41:29Z
2026/10/15 20:36:03 LuckyWeb Http Listen on http://:16601
2026/10/15 20:36:04 LuckyWeb Https Listen on https://:16601
2026/10/15 20:36:04 thirdPartyAuthManager module started
2026/10/15 20:36:04 ssl module started
2026/10/15 20:36:04 ipfilter module started
2026/10/15 20:36:04 cron module started
2026/10/15 20:36:04 storagemanagement module started
2026/10/15 20:36:04 webterminal module started
2026/10/15 20:36:04 ddns module started
2026/10/15 20:36:04 wol module started
2026/10/15 20:36:04 ftpserver module started
2026/10/15 20:36:04 webdav module started
2026/10/15 20:36:04 portforward module started
2026/10/15 20:36:04 iconlib module started
2026/10/15 20:36:04 reverseproxy module started
2026/10/15 20:36:04 stun module started
2026/10/15 20:36:04 ipdb module started
2026/10/15 20:36:04 LuckyWeb Start success
2026/10/15 20:36:19 exec first ntp sync time
2026/10/15 20:36:19 EnableFireWallPorts Done!

我的配置文件夹在 /etc/lucky ,尝试指定配置文件启动:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@route:~# lucky -cd /etc/lucky`
2026/10/15 20:35:43 configure dir:/etc/lucky/
2026/10/15 20:35:43 initconfigure error:ConfDecryptAny error:ConfDecrypt error:unsupport encryption type:
2026/10/15 20:35:43 可以将下面指令加入cron计划任务,每分钟定时检测lucky进程意外退出影响使用。
2026/10/15 20:35:43 */1 * * * * test -z "$(pidof lucky)" && lucky -cd /etc/lucky/ >/dev/null 2>&1
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8d1af4]

goroutine 1 [running]:
github.com/gdy666/gdylib/luckyweb.(*Server).GetBaseConfigure(0x40002bc008)
gdy/gdylib/luckyweb/server.go:565 +0x84
github.com/gdy666/lucky/webv2.RunAdminWeb(0x0, 0x1235a78)
gdy/lucky_own/webv2/webv2.go:60 +0x2c
main.run()
gdy/lucky_own/main.go:280 +0x4c
main.main()
gdy/lucky_own/main.go:262 +0x604

出现了和日志一致的报错。初步定位是配置文件导致的。

分析报错及解决

由于 lucky 是闭源软件,仅可做有限分析。出现问题的函数是 GetBaseConfigure,故尝试删除 /etc/lucky/lucky_base.lkcf,随后成功启动。

猜测是该文件损坏。

启动后会重新创建默认的该文件,需要使用默认端口 16601 登录 web,账号密码 666,重新填写基础设置。

后记

要养成定期备份配置文件的好习惯。


lucky启动失败排查:luckyweb.(*Server).GetBaseConfigure(0x40002bc008)
https://boyinthesun.cn/posts/3e88cb163352.html
作者
BoyInTheSun
发布于
2026年10月15日
许可协议