runtime error: invalid memory address or nil pointer dereference
zhuxiaole opened this issue · comments
项目启动后,一直报这个错,也不知道是不是我配置有问题,能不能请大大看看什么问题,谢谢。
欢迎使用HotGo!
当前运行环境:windows, 运行根路径为:H:\Go\workspace\SupManagement
HotGo版本:v2.9.8, gf版本:v2.5.5
2023-11-04 22:49:33.433 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 8 ms] [default] [sup_mng] [rows:13 ] SHOW FULL COLUMNS FROM `hg_sys_config`
2023-11-04 22:49:33.436 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 2 ms] [default] [sup_mng] [rows:8 ] SELECT `key`,`value`,`type` FROM `hg_sys_config` WHERE `group`='wechat'
2023-11-04 22:49:33.438 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 2 ms] [default] [sup_mng] [rows:14 ] SELECT `key`,`value`,`type` FROM `hg_sys_config` WHERE `group`='pay'
2023-11-04 22:49:33.441 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 2 ms] [default] [sup_mng] [rows:28 ] SELECT `key`,`value`,`type` FROM `hg_sys_config` WHERE `group`='upload'
2023-11-04 22:49:33.445 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 1 ms] [default] [sup_mng] [rows:15 ] SELECT `key`,`value`,`type` FROM `hg_sys_config` WHERE `group`='sms'
2023-11-04 22:49:33.449 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 3 ms] [default] [sup_mng] [rows:13 ] SHOW FULL COLUMNS FROM `hg_admin_role`
2023-11-04 22:49:33.451 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 2 ms] [default] [sup_mng] [rows:1 ] SELECT * FROM `hg_admin_role` WHERE `key`='super' LIMIT 1
2023-11-04 22:49:33.455 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 4 ms] [default] [sup_mng] [rows:28 ] SHOW FULL COLUMNS FROM `hg_admin_member`
2023-11-04 22:49:33.459 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 4 ms] [default] [sup_mng] [rows:1 ] SELECT `id` FROM `hg_admin_member` WHERE `role_id`='1'
2023-11-04 22:49:33.460 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/cmd/cmd.go:53: starting all server
2023-11-04 22:49:33.461 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/cmd/queue.go:27: start queue consumer..
2023-11-04 22:49:33.461 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/cmd/queue.go:29: start queue consumer success..
2023-11-04 22:49:33.462 [DEBU] SetServerRoot path: H:\Go\workspace\SupManagement\resource\public
2023-11-04 22:49:33.464 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/websocket/init.go:29: start websocket..
2023-11-04 22:49:33.465 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 5 ms] [default] [sup_mng] [rows:12 ] SHOW FULL COLUMNS FROM `hg_sys_cron`
2023-11-04 22:49:33.469 [DEBU] {f41b520df9729417c1bb9240202e210e} [ 4 ms] [default] [sup_mng] [rows:6 ] SHOW FULL COLUMNS FROM `hg_sys_addons_install`
2023-11-04 22:49:33.474 [DEBU] {f41b520df9729417c1bb9240202e210e} [ 5 ms] [default] [sup_mng] [rows:1 ] SELECT `id`,`version`,`status`,`created_at`,`updated_at` FROM `hg_sys_addons_install` WHERE `name`='hgexample' LIMIT 1
2023-11-04 22:49:33.477 [DEBU] {f41b520df9729417c1bb9240202e210e} [ 3 ms] [default] [sup_mng] [rows:1 ] SELECT `id`,`version`,`status`,`created_at`,`updated_at` FROM `hg_sys_addons_install` WHERE `name`='hgexample' LIMIT 1
2023-11-04 22:49:33.479 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 10 ms] [default] [sup_mng] [rows:0 ] SELECT `id`,`group_id`,`name`,`params`,`pattern`,`policy`,`count`,`sort`,`remark`,`status`,`created_at`,`updated_at` FROM `hg_sys_cron` WHERE `status`=1 ORDER BY `sort` asc,`id` desc
2023-11-04 22:49:33.479 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/library/cron/cron.go:136: load cron success..
2023-11-04 22:49:33.479 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/logic/tcpclient/cron.go:37: CronClient start..
2023-11-04 22:49:33.480 [DEBU] {dca8d410f9729417c5bb924017dd1235} H:/Go/workspace/SupManagement/internal/library/network/tcp/client.go:166: connect to 127.0.0.1:8099 error: net.DialTimeout failed with network "tcp", address "127.0.0.1:8099", timeout "10s": dial tcp 127.0.0.1:8099: connectex: No connection could be made because the target machine actively refused it.
2023-11-04 22:49:33.496 [DEBU] {0c94b311f9729417c8bb9240dd439637} [ 2 ms] [default] [sup_mng] [rows:2 ] SHOW FULL COLUMNS FROM `hg_admin_role_menu`
2023-11-04 22:49:33.501 [DEBU] {9829d311f9729417c9bb9240e6b333c6} [ 5 ms] [default] [sup_mng] [rows:26 ] SHOW FULL COLUMNS FROM `hg_admin_menu`
2023-11-04 22:49:33.503 [DEBU] {48bc1712f9729417cabb9240916a600b} [ 2 ms] [default] [sup_mng] [rows:87 ] SELECT r.key,m.permissions FROM `hg_admin_role` r LEFT JOIN `hg_admin_role_menu` rm ON (r.id=rm.role_id) LEFT JOIN `hg_admin_menu` m ON (rm.menu_id=m.id) WHERE (`r`.`status`=1) AND (`m`.`status`=1) AND (m.permissions !='') AND (r.key !='super')
2023-11-04 22:49:33.505 [DEBU] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/logic/tcpserver/server.go:36: TCPServer start..
2023-11-04 22:49:33.508 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 3 ms] [default] [sup_mng] [rows:6 ] SHOW FULL COLUMNS FROM `hg_sys_blacklist`
2023-11-04 22:49:33.511 [DEBU] {4c46f80cf9729417c0bb924046989fc0} [ 2 ms] [default] [sup_mng] [rows:4 ] SELECT `ip` FROM `hg_sys_blacklist` WHERE `status`=1
2023-11-04 22:49:33.543 [INFO] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/cmd/http.go:113: swagger ui is serving at address: http://127.0.0.1:8000/swagger/
2023-11-04 22:49:33.544 [INFO] {4c46f80cf9729417c0bb924046989fc0} H:/Go/workspace/SupManagement/internal/cmd/http.go:113: openapi specification is serving at address: http://127.0.0.1:8000/api.json
2023-11-04 22:49:33.544 [INFO] pid[5996]: http server started listening on [:8000]
2023-11-04 22:49:33.565 [DEBU] {8009c115f9729417ccbb92407c84adeb} H:/Go/workspace/SupManagement/internal/library/token/token.go:265: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:33.565 [DEBU] {8009c115f9729417ccbb92407c84adeb} H:/Go/workspace/SupManagement/internal/library/token/token.go:147: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:33.566 [INFO] {8009c115f9729417ccbb92407c84adeb} H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:36: hook accessLog err:runtime error: invalid memory address or nil pointer dereference
1. runtime error: invalid memory address or nil pointer dereference
1). hotgo/internal/logic/sys.(*sSysLog).AutoLog.func1
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:113
2). hotgo/internal/logic/sys.(*sSysLog).AutoLog
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:104
3). hotgo/internal/logic/hook.(*sHook).accessLog.func1
H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:35
4). hotgo/utility/simple.SafeGo.func1
H:/Go/workspace/SupManagement/utility/simple/simple.go:92
2023-11-04 22:49:33.566 {8009c115f9729417ccbb92407c84adeb} 200 "GET http 10.11.12.10:8000 /socket?authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicGlkIjowLCJkZXB0SWQiOjEwMCwicm9sZUlkIjoxLCJyb2xlS2V5Ijoic3VwZXIiLCJ1c2VybmFtZSI6IueMquWwj-S5kCIsInJlYWxOYW1lIjoi54yq5bCP5LmQIiwiYXZhdGFyIjoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL2F0dGFjaG1lbnQvMjAyMy0xMS0wNC9jd3B3dmY0c2s3YW9mcTZkN2wuanBnIiwiZW1haWwiOiIiLCJtb2JpbGUiOiIiLCJhcHAiOiJhZG1pbiIsImxvZ2luQXQiOiIyMDIzLTExLTA0IDIyOjMwOjExIn0.1oLbEGcWLkvSwNo8jysw7WibmaAhcEnfNbxH7HwGcqk HTTP/1.1" 0.004, 10.11.12.10, "", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76"
2023-11-04 22:49:35.551 [DEBU] {0ccd458cf9729417cdbb924098ac9245} H:/Go/workspace/SupManagement/internal/library/token/token.go:265: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:35.551 [DEBU] {0ccd458cf9729417cdbb924098ac9245} H:/Go/workspace/SupManagement/internal/library/token/token.go:147: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:35.552 [INFO] {0ccd458cf9729417cdbb924098ac9245} H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:36: hook accessLog err:runtime error: invalid memory address or nil pointer dereference
1. runtime error: invalid memory address or nil pointer dereference
1). hotgo/internal/logic/sys.(*sSysLog).AutoLog.func1
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:113
2). hotgo/internal/logic/sys.(*sSysLog).AutoLog
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:104
3). hotgo/internal/logic/hook.(*sHook).accessLog.func1
H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:35
4). hotgo/utility/simple.SafeGo.func1
H:/Go/workspace/SupManagement/utility/simple/simple.go:92
2023-11-04 22:49:35.551 {0ccd458cf9729417cdbb924098ac9245} 200 "GET http 10.11.12.10:8000 /socket?authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicGlkIjowLCJkZXB0SWQiOjEwMCwicm9sZUlkIjoxLCJyb2xlS2V5Ijoic3VwZXIiLCJ1c2VybmFtZSI6IueMquWwj-S5kCIsInJlYWxOYW1lIjoi54yq5bCP5LmQIiwiYXZhdGFyIjoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL2F0dGFjaG1lbnQvMjAyMy0xMS0wNC9jd3B3dmY0c2s3YW9mcTZkN2wuanBnIiwiZW1haWwiOiIiLCJtb2JpbGUiOiIiLCJhcHAiOiJhZG1pbiIsImxvZ2luQXQiOiIyMDIzLTExLTA0IDIyOjMwOjExIn0.1oLbEGcWLkvSwNo8jysw7WibmaAhcEnfNbxH7HwGcqk HTTP/1.1" 0.000, 10.11.12.10, "", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76"
2023-11-04 22:49:37.551 [DEBU] {8c1b7803fa729417cebb9240a8f28ae6} H:/Go/workspace/SupManagement/internal/library/token/token.go:265: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:37.551 [DEBU] {8c1b7803fa729417cebb9240a8f28ae6} H:/Go/workspace/SupManagement/internal/library/token/token.go:147: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:37.552 [INFO] {8c1b7803fa729417cebb9240a8f28ae6} H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:36: hook accessLog err:runtime error: invalid memory address or nil pointer dereference
1. runtime error: invalid memory address or nil pointer dereference
1). hotgo/internal/logic/sys.(*sSysLog).AutoLog.func1
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:113
2). hotgo/internal/logic/sys.(*sSysLog).AutoLog
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:104
3). hotgo/internal/logic/hook.(*sHook).accessLog.func1
H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:35
4). hotgo/utility/simple.SafeGo.func1
H:/Go/workspace/SupManagement/utility/simple/simple.go:92
2023-11-04 22:49:37.551 {8c1b7803fa729417cebb9240a8f28ae6} 200 "GET http 10.11.12.10:8000 /socket?authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicGlkIjowLCJkZXB0SWQiOjEwMCwicm9sZUlkIjoxLCJyb2xlS2V5Ijoic3VwZXIiLCJ1c2VybmFtZSI6IueMquWwj-S5kCIsInJlYWxOYW1lIjoi54yq5bCP5LmQIiwiYXZhdGFyIjoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL2F0dGFjaG1lbnQvMjAyMy0xMS0wNC9jd3B3dmY0c2s3YW9mcTZkN2wuanBnIiwiZW1haWwiOiIiLCJtb2JpbGUiOiIiLCJhcHAiOiJhZG1pbiIsImxvZ2luQXQiOiIyMDIzLTExLTA0IDIyOjMwOjExIn0.1oLbEGcWLkvSwNo8jysw7WibmaAhcEnfNbxH7HwGcqk HTTP/1.1" 0.000, 10.11.12.10, "", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76"
2023-11-04 22:49:38.486 [DEBU] {e8b2f73afa729417cfbb9240f845ff61} [ 4 ms] [default] [sup_mng] [rows:17 ] SHOW FULL COLUMNS FROM `hg_sys_serve_license`
2023-11-04 22:49:38.491 [DEBU] {e8b2f73afa729417cfbb9240f845ff61} [ 5 ms] [default] [sup_mng] [rows:1 ] SELECT `id`,`group`,`name`,`appid`,`secret_key`,`remote_addr`,`online_limit`,`login_times`,`last_login_at`,`last_active_at`,`routes`,`allowed_ips`,`end_at`,`remark`,`status`,`created_at`,`updated_at` FROM `hg_sys_serve_license` WHERE `appid`='1002' LIMIT 1
2023-11-04 22:49:38.498 [DEBU] {e8b2f73afa729417cfbb9240f845ff61} [ 7 ms] [default] [sup_mng] [rows:1 ] UPDATE `hg_sys_serve_license` SET `remote_addr`='127.0.0.1:54516',`login_times`=48,`last_login_at`='2023-11-04 22:49:38',`last_active_at`='2023-11-04 22:49:38',`updated_at`='2023-11-04 22:49:38' WHERE `id`=1
2023-11-04 22:49:38.498 [DEBU] {e8b2f73afa729417cfbb9240f845ff61} H:/Go/workspace/SupManagement/internal/logic/tcpserver/server_handle.go:130: onServerLogin succeed. appid:1002, group:cron, name:cron1
2023-11-04 22:49:38.498 [DEBU] {d808f23bfa729417d2bb924045dced02} H:/Go/workspace/SupManagement/internal/logic/tcpclient/cron.go:95: CronClient login succeed.
2023-11-04 22:49:39.553 [DEBU] {38c6d17afa729417d3bb924059d55a46} H:/Go/workspace/SupManagement/internal/library/token/token.go:265: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:39.553 [DEBU] {38c6d17afa729417d3bb924059d55a46} H:/Go/workspace/SupManagement/internal/library/token/token.go:147: parseToken err:token signature is invalid: signature is invalid
2023-11-04 22:49:39.553 [INFO] {38c6d17afa729417d3bb924059d55a46} H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:36: hook accessLog err:runtime error: invalid memory address or nil pointer dereference
1. runtime error: invalid memory address or nil pointer dereference
1). hotgo/internal/logic/sys.(*sSysLog).AutoLog.func1
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:113
2). hotgo/internal/logic/sys.(*sSysLog).AutoLog
H:/Go/workspace/SupManagement/internal/logic/sys/log.go:104
3). hotgo/internal/logic/hook.(*sHook).accessLog.func1
H:/Go/workspace/SupManagement/internal/logic/hook/access_log.go:35
4). hotgo/utility/simple.SafeGo.func1
H:/Go/workspace/SupManagement/utility/simple/simple.go:92
应该是日志配置有问题,检查一下