【BUG】无法在Linux中启动预打包二进制程序
crrashh1542 opened this issue · comments
请说明问题 / Describe the bug
A clear and concise description of what the bug is.
如何复现 / To Reproduce
在Release v2.4.6中下载Linux的二进制包,或通过Release v2.4.6中提供的源码以GOOS为Linux打包项目后,运行提示错误。
你预期的行为 / Expected behavior
程序在Linux环境下正常启动
贴上你的配置文件 / Program configuration file contents
未生成config.json
日志信息 / Log
Release中下载二进制日志
$ sudo ./pmail -p 14700
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:81]*******************************************************************
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:82]*** Server Start Success
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:83]*** Server Version: v2.4.6
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:84]*** Git Commit Hash: 7a3d056e7703a3f9afc95ebd0d8639b97e9d81e4
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:85]*** Build Date: 2024-04-27 13:02:43
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:86]*** Build GoLang Version: go version go1.22.2 linux/amd64
[info][2024-04-28 00:17:06][/home/runner/work/PMail/PMail/server/main.go:87]*******************************************************************
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x160 pc=0xa69d6a]
goroutine 6 [running]:
pmail/config.(*Config).SetSetupPort(...)
/home/runner/work/PMail/PMail/server/config/config.go:44
pmail/http_server.SetupStart()
/home/runner/work/PMail/PMail/server/http_server/setup_server.go:32 +0x1ea
created by pmail/res_init.Init in goroutine 1
/home/runner/work/PMail/PMail/server/res_init/init.go:26 +0x3a
自打包二进制日志(几乎同上)
$ sudo ./pmail_linux_amd64 -p 14700
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:81]*******************************************************************
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:82]*** Server Start Success
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:83]*** Server Version: TestVersion
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:84]*** Git Commit Hash:
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:85]*** Build Date:
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:86]*** Build GoLang Version:
[info][2024-04-28 00:02:20][E:/PMail-2.4.6/server/main.go:87]*******************************************************************
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x160 pc=0xa69d6a]
goroutine 19 [running]:
pmail/config.(*Config).SetSetupPort(...)
E:/PMail-2.4.6/server/config/config.go:44
pmail/http_server.SetupStart()
E:/PMail-2.4.6/server/http_server/setup_server.go:32 +0x1ea
created by pmail/res_init.Init in goroutine 1
E:/PMail-2.4.6/server/res_init/init.go:26 +0x3a
从源码直接`go run main.go`的日志,一切正常
$ sudo go run main.go
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:81]*******************************************************************
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:82]*** Server Start Success
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:83]*** Server Version: TestVersion
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:84]*** Git Commit Hash:
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:85]*** Build Date:
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:86]*** Build GoLang Version:
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/main.go:87]*******************************************************************
[debug][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/services/setup/ssl/ssl.go:194]SSL Check.
[debug][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/services/setup/ssl/ssl.go:194]SSL Check.
[warning][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/res_init/init.go:54]Config File Info: {"logLevel":"debug","domain":"domain.com","domains":["domain.com"],"webDomain":"mail.domain.com","dkimPrivateKeyPath":"config/dkim/dkim.priv","sslType":"0","SSLPrivateKeyPath":"config/ssl/private.key","SSLPublicKeyPath":"config/ssl/public.crt","dbDSN":"./config/pmail.db","dbType":"sqlite","httpsEnabled":1,"spamFilterLevel":1,"httpPort":80,"httpsPort":443,"weChatPushAppId":"","weChatPushSecret":"","weChatPushTemplateId":"","weChatPushUserId":"","tgBotToken":"","tgChatId":"","isInit":true,"webPushUrl":"","webPushToken":""}
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/pop3_server/pop3server.go:27]POP3 With TLS Server Start On Port :995
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/smtp_server/smtp.go:146]Starting Smtp With SSL Server Port: :465
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/smtp_server/smtp.go:174]Starting Smtp Server Port: :25
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/pop3_server/pop3server.go:46]POP3 Server Start On Port :110
[info][2024-04-28 00:56:17][/home/kotsuki/PMail-2.4.6/server/http_server/https_server.go:77]Https Server Start On Port :443
感谢开发工作
老板,麻烦问下我安装的是2.4.6.1 我想问下配置数据库的时候选择mysql,提示的是Invalid default value for 'id'
Server Version: v2.4.8也是报错,启动时还有配置呢,突然就没了