[GH-ISSUE #357] 修改配置报错runtime error: invalid memory address or nil pointer dereference #4633

Closed
opened 2026-03-01 15:34:48 +03:00 by kerem · 29 comments
Owner

Originally created by @Sanbobo1 on GitHub (Apr 26, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/357

新增了【环境】配置中的一台节点机器,可以看到该机器的监控信息,目录下的配置文件,但是点击修改后报错runtime error: invalid memory address or nil pointer dereference
image

image
image

Originally created by @Sanbobo1 on GitHub (Apr 26, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/357 新增了【环境】配置中的一台节点机器,可以看到该机器的监控信息,目录下的配置文件,但是点击修改后报错runtime error: invalid memory address or nil pointer dereference ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/9923f017-2856-4d62-b72b-ae3e3d38bcd3) ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/e2313ee3-f1cf-4878-a569-f987af378246) ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/2f7356b6-fbc0-43d2-83f4-71188a8c5430)
kerem 2026-03-01 15:34:48 +03:00
Author
Owner

@Sanbobo1 commented on GitHub (Apr 26, 2024):

但是修改本机的配置是可以正常操作的

<!-- gh-comment-id:2078900649 --> @Sanbobo1 commented on GitHub (Apr 26, 2024): 但是修改本机的配置是可以正常操作的
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2024):

可否提供一下被控的机器上nginx ui的日志

<!-- gh-comment-id:2078908002 --> @0xJacky commented on GitHub (Apr 26, 2024): 可否提供一下被控的机器上nginx ui的日志
Author
Owner

@Sanbobo1 commented on GitHub (Apr 26, 2024):

bash <(curl -L -s https://mirror.ghproxy.com/https://raw.githubusercontent.com/0xJacky/nginx-ui/master/install.sh) install -r https://mirror.ghproxy.com/ 我是以这种方式部署的,请问nginx ui的日志在哪个路径下

<!-- gh-comment-id:2078927005 --> @Sanbobo1 commented on GitHub (Apr 26, 2024): bash <(curl -L -s https://mirror.ghproxy.com/https://raw.githubusercontent.com/0xJacky/nginx-ui/master/install.sh) install -r https://mirror.ghproxy.com/ 我是以这种方式部署的,请问nginx ui的日志在哪个路径下
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2024):

使用 journalctl -u nginx-ui -f 获取实时日志

<!-- gh-comment-id:2078978085 --> @0xJacky commented on GitHub (Apr 26, 2024): 使用 `journalctl -u nginx-ui -f` 获取实时日志
Author
Owner

@Sanbobo1 commented on GitHub (Apr 26, 2024):

image
点击链接进来后第一个报错:
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:20:14 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 226 [running]:
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1()
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?})
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: gorm.io/gorm.(*DB).getInstance(0x31d4a60?)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/gorm.io/gorm@v1.25.7/gorm.go:399 +0x12
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: gorm.io/gorm.(*DB).Model(...)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/gorm.io/gorm@v1.25.7/chainable_api.go:19
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).result(0x47c1740)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:66 +0x39a
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).PagingListData(0x47c1740)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:107 +0x36
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).PagingList(0x0)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:156 +0x1c
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/notification.GetList(0xc00222f300)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/notification/notification.go:29 +0xa5
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-goni
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 500 | 231.264µs | 192.168.5.167 | GET "/api/notifications"
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:20:14 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 232 [running]:
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1()
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?})
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/internal/environment.RetrieveEnvironmentList()
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/internal/environment/environment.go:11 +0x21
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cluster.GetEnvironmentList(0xc001c41900)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cluster/environment.go:30 +0x1c
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc001c41900)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc001c41900)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc001c41900)
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 500 | 99.106µs | 192.168.5.167 | GET "/api/environments"
Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 200 | 4.703579ms | 192.168.5.167 | GET "/api/analytic/init"

<!-- gh-comment-id:2078988459 --> @Sanbobo1 commented on GitHub (Apr 26, 2024): ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/ae914dff-cd21-40b1-8398-3d309fa17b2a) 点击链接进来后第一个报错: Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:20:14 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 226 [running]: Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1() Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?}) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: gorm.io/gorm.(*DB).getInstance(0x31d4a60?) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/gorm.io/gorm@v1.25.7/gorm.go:399 +0x12 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: gorm.io/gorm.(*DB).Model(...) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/gorm.io/gorm@v1.25.7/chainable_api.go:19 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).result(0x47c1740) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:66 +0x39a Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).PagingListData(0x47c1740) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:107 +0x36 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cosy.(*Ctx[...]).PagingList(0x0) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cosy/list.go:156 +0x1c Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/notification.GetList(0xc00222f300) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/notification/notification.go:29 +0xa5 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-goni Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 500 | 231.264µs | 192.168.5.167 | GET "/api/notifications" Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:20:14 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 232 [running]: Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1() Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?}) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/internal/environment.RetrieveEnvironmentList() Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/internal/environment/environment.go:11 +0x21 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/cluster.GetEnvironmentList(0xc001c41900) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/cluster/environment.go:30 +0x1c Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc001c41900) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc001c41900) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145 Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc001c41900) Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 500 | 99.106µs | 192.168.5.167 | GET "/api/environments" Apr 26 17:20:14 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:20:14 | 200 | 4.703579ms | 192.168.5.167 | GET "/api/analytic/init"
Author
Owner

@Sanbobo1 commented on GitHub (Apr 26, 2024):

点击修改时的报错日志:
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:21:18 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 215 [running]:
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1()
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?})
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/config.GetConfig(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/config/get.go:34 +0x17b
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func5(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:48 +0xcf
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500)
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/g
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:21:18 | 500 | 189.175µs | 192.168.5.167 | GET "/api/config/bdzsbeta.cxmuc.com.conf"
Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:21:18 | 200 | 83.637µs | 192.168.5.167 | POST "/api/nginx/test"

<!-- gh-comment-id:2078989499 --> @Sanbobo1 commented on GitHub (Apr 26, 2024): 点击修改时的报错日志: Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: 2024-04-26 17:21:18 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: goroutine 215 [running]: Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1() Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65 Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: panic({0x3402e20?, 0x6f510d0?}) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132 Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/api/config.GetConfig(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/api/config/get.go:34 +0x17b Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145 Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func5(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:48 +0xcf Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: github.com/gin-gonic/gin.(*Context).Next(0xc00205b500) Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: /home/runner/go/pkg/mod/github.com/g Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:21:18 | 500 | 189.175µs | 192.168.5.167 | GET "/api/config/bdzsbeta.cxmuc.com.conf" Apr 26 17:21:18 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[26999]: [GIN] 2024/04/26 - 17:21:18 | 200 | 83.637µs | 192.168.5.167 | POST "/api/nginx/test"
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2024):

ok. 有进展会通知你

<!-- gh-comment-id:2079005214 --> @0xJacky commented on GitHub (Apr 26, 2024): ok. 有进展会通知你
Author
Owner

@Sanbobo1 commented on GitHub (Apr 26, 2024):

ERROR analytic/analytic.go:82 write tcp 10.10.6.193:9002->192.168.5.167:51412: write: broken pipe
ERROR analytic/nodes.go:64 write tcp 10.10.6.193:9002->192.168.5.167:51410: write: broken pipe
还有这些报错 是有需要开放的端口吗

<!-- gh-comment-id:2079010215 --> @Sanbobo1 commented on GitHub (Apr 26, 2024): ERROR analytic/analytic.go:82 write tcp 10.10.6.193:9002->192.168.5.167:51412: write: broken pipe ERROR analytic/nodes.go:64 write tcp 10.10.6.193:9002->192.168.5.167:51410: write: broken pipe 还有这些报错 是有需要开放的端口吗
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2024):

这个没事,websocket我没处理好

<!-- gh-comment-id:2079014416 --> @0xJacky commented on GitHub (Apr 26, 2024): 这个没事,websocket我没处理好
Author
Owner

@0xJacky commented on GitHub (Apr 26, 2024):

被控的机器上看一下 /usr/local/etc/nginx-ui 目录下有没有 database.db 然后试下在被控机重启 systemctl restart nginx-ui

这个问题看起来是像是数据库相关的,我这边复现不了

<!-- gh-comment-id:2079452668 --> @0xJacky commented on GitHub (Apr 26, 2024): 被控的机器上看一下 /usr/local/etc/nginx-ui 目录下有没有 database.db 然后试下在被控机重启 systemctl restart nginx-ui 这个问题看起来是像是数据库相关的,我这边复现不了
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

/usr/local/etc/nginx-ui 目录下没有 database.db

<!-- gh-comment-id:2081294332 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): /usr/local/etc/nginx-ui 目录下没有 database.db
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

/usr/local/etc/nginx-ui 目录下没有 database.db

那你先访问被控机器的 ip:port/install 安装并初始化数据库,这个问题应该就解决了,或者直接copy主sever上的 db 过去也可以,重启 nginx-ui

<!-- gh-comment-id:2081298074 --> @0xJacky commented on GitHub (Apr 28, 2024): > /usr/local/etc/nginx-ui 目录下没有 database.db 那你先访问被控机器的 ip:port/install 安装并初始化数据库,这个问题应该就解决了,或者直接copy主sever上的 db 过去也可以,重启 nginx-ui
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

cp主sever上的 db 过去,重启被控的nginx-ui,还是有报错。
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: 2024-04-28 10:56:47 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: goroutine 93 [running]:
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1()
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: panic({0x3402e20?, 0x6f510d0?})
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/api/config.GetConfig(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/api/config/get.go:34 +0x17b
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func5(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:48 +0xcf
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700)
Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gi

<!-- gh-comment-id:2081304025 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): cp主sever上的 db 过去,重启被控的nginx-ui,还是有报错。 Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: 2024-04-28 10:56:47 ERROR router/middleware.go:24 runtime error: invalid memory address or nil pointer dereference Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: goroutine 93 [running]: Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.recovery.func2.1() Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:23 +0x65 Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: panic({0x3402e20?, 0x6f510d0?}) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /opt/hostedtoolcache/go/1.22.1/x64/src/runtime/panic.go:770 +0x132 Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/api/config.GetConfig(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/api/config/get.go:34 +0x17b Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.proxy.func6(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/proxy.go:18 +0x145 Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/0xJacky/Nginx-UI/router.InitRouter.authRequired.func5(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/work/nginx-ui/nginx-ui/router/middleware.go:48 +0xcf Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: github.com/gin-gonic/gin.(*Context).Next(0xc001c0c700) Apr 28 10:56:47 cx-beta-upgrade-php-7-4-33-10-10-6-193 nginx-ui[28880]: /home/runner/go/pkg/mod/github.com/gi
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

那试一下webui能初始化吗

<!-- gh-comment-id:2081305335 --> @0xJacky commented on GitHub (Apr 28, 2024): 那试一下webui能初始化吗
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

ip:port/install

<!-- gh-comment-id:2081305411 --> @0xJacky commented on GitHub (Apr 28, 2024): ip:port/install
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

ip:port/install 用这个初始化之后,web界面登录报错了。登入后一瞬间,马上弹出authentication failed

image

<!-- gh-comment-id:2081309580 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): ip:port/install 用这个初始化之后,web界面登录报错了。登入后一瞬间,马上弹出authentication failed ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/800fb600-0b27-414b-aa01-3d0add4bb68b)
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

image

<!-- gh-comment-id:2081309639 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): ![image](https://github.com/0xJacky/nginx-ui/assets/138869963/01acc166-9b97-4842-b67b-df8d9eaf3e2e)
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

清一下浏览器的缓存再试一下?
https://github.com/0xJacky/nginx-ui/issues/342
看起来很像是这个问题,但是我没法复现

<!-- gh-comment-id:2081309942 --> @0xJacky commented on GitHub (Apr 28, 2024): 清一下浏览器的缓存再试一下? https://github.com/0xJacky/nginx-ui/issues/342 看起来很像是这个问题,但是我没法复现
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

目前只能被控机器只能通过ip:port/install的方式吗,我内网的机器都是linux的。如果都需要这样方式的话,每台被控机器都要配一个公网/域名去转发进行初始化,很麻烦

<!-- gh-comment-id:2081367366 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): 目前只能被控机器只能通过ip:port/install的方式吗,我内网的机器都是linux的。如果都需要这样方式的话,每台被控机器都要配一个公网/域名去转发进行初始化,很麻烦
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

理论上是不需要的,只要有 database.db 就可以,哦对了还有 app.ini 里面的 JwtSecret 要配置,这样数据库应该就能正常初始化了

<!-- gh-comment-id:2081373142 --> @0xJacky commented on GitHub (Apr 28, 2024): 理论上是不需要的,只要有 database.db 就可以,哦对了还有 app.ini 里面的 JwtSecret 要配置,这样数据库应该就能正常初始化了
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

配好 app.ini 和 database.db 一起复制过去应该就可以,事实上我开发环境做迁移的时候也是这么干的😂

<!-- gh-comment-id:2081373340 --> @0xJacky commented on GitHub (Apr 28, 2024): 配好 app.ini 和 database.db 一起复制过去应该就可以,事实上我开发环境做迁移的时候也是这么干的😂
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

嗯 配好 app.ini 和 database.db 一起复制过去 可以了。
登录的问题,换个浏览器可以了,应该是缓存问题。

<!-- gh-comment-id:2081403555 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): 嗯 配好 app.ini 和 database.db 一起复制过去 可以了。 登录的问题,换个浏览器可以了,应该是缓存问题。
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

提个问题:目前我在配置管理里面看到,只能针对conf对应目录的conf文件进行修改,如果我有新增配置需求,是否只能在【新增站点】功能下进行配置。并且该功能只能进行填写相关信息进行配置,如果我有多台负载均衡的机器,则需要配置多次。这里是否有直接编写conf 反向代理配置文件,并下发到多台机器的功能呢

<!-- gh-comment-id:2081404442 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): 提个问题:目前我在配置管理里面看到,只能针对conf对应目录的conf文件进行修改,如果我有新增配置需求,是否只能在【新增站点】功能下进行配置。并且该功能只能进行填写相关信息进行配置,如果我有多台负载均衡的机器,则需要配置多次。这里是否有直接编写conf 反向代理配置文件,并下发到多台机器的功能呢
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

对,目前还不支持新增 conf,等我把 ssl 部分改完再看看

<!-- gh-comment-id:2081409860 --> @0xJacky commented on GitHub (Apr 28, 2024): 对,目前还不支持新增 conf,等我把 ssl 部分改完再看看
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

提个建议:有一个机器组的概念,这样我新增conf或修改后(同名覆盖二次确认)就可以下发到多台负载均衡的机器,不用逐一配置。

<!-- gh-comment-id:2081410785 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): 提个建议:有一个机器组的概念,这样我新增conf或修改后(同名覆盖二次确认)就可以下发到多台负载均衡的机器,不用逐一配置。
Author
Owner

@0xJacky commented on GitHub (Apr 28, 2024):

开新的 issue 吧

<!-- gh-comment-id:2081411108 --> @0xJacky commented on GitHub (Apr 28, 2024): 开新的 issue 吧
Author
Owner

@Sanbobo1 commented on GitHub (Apr 28, 2024):

好的

<!-- gh-comment-id:2081411164 --> @Sanbobo1 commented on GitHub (Apr 28, 2024): 好的
Author
Owner

@jearton commented on GitHub (May 2, 2024):

我也遇到了,被控机器没有初始化用户导致的。但是被控机器,本来就不需要用户名+密码登录,而是通过key+api控制的,那初始化用户是否多余呢? @0xJacky

<!-- gh-comment-id:2091061004 --> @jearton commented on GitHub (May 2, 2024): 我也遇到了,被控机器没有初始化用户导致的。但是被控机器,本来就不需要用户名+密码登录,而是通过key+api控制的,那初始化用户是否多余呢? @0xJacky
Author
Owner

@0xJacky commented on GitHub (May 3, 2024):

我也遇到了,被控机器没有初始化用户导致的。但是被控机器,本来就不需要用户名+密码登录,而是通过key+api控制的,那初始化用户是否多余呢? @0xJacky

这个确实要改进

<!-- gh-comment-id:2092040992 --> @0xJacky commented on GitHub (May 3, 2024): > 我也遇到了,被控机器没有初始化用户导致的。但是被控机器,本来就不需要用户名+密码登录,而是通过key+api控制的,那初始化用户是否多余呢? @0xJacky 这个确实要改进
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#4633
No description provided.