Skip to content

更新最新版之后,证书列表找不到了,新增证书报错 #1034

@boothua-cloud

Description

@boothua-cloud

Describe the bug
在2.0.0-rc.5创建的证书消失了,新增证书报错

To Reproduce
Steps to reproduce the behavior:

  1. Go to '证书'
  2. Click on '证书列表'
  3. 点击导入
  4. 按照表单提示,输入证书名称,证书路径,证书key路径

Expected behavior
应该新增成功

Screenshots

Image

Info (please complete the following information):

  • Server OS: Ubuntu 24.04
  • Server Arch: x86
  • Nginx UI Version: 在2.0.0-rc.6(418)
  • Your Browser: Chrome

Additional context
后台日志报错信息

2025/05/09 20:03:39 /home/runner/work/nginx-ui/nginx-ui/internal/user/user.go:56
[0.214ms] [rows:1] SELECT * FROM `users` WHERE id=1  AND `users`.`deleted_at` IS NULL LIMIT 1
2025-05-09 20:03:39     ERROR   /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/router/middleware.go:16       interface conversion: interface {} is nil, not string
goroutine 633 [running]:
github.com/uozi-tech/cosy/router.Init.recovery.func2.1()
        /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/router/middleware.go:15 +0x65
panic({0x3d28ee0?, 0xc000364a80?})
        /opt/hostedtoolcache/go/1.24.2/x64/src/runtime/panic.go:792 +0x132
github.com/0xJacky/Nginx-UI/api/certificate.AddCert.func1(0xc000effb08)
        /home/runner/work/nginx-ui/nginx-ui/api/certificate/certificate.go:106 +0x1fb
github.com/uozi-tech/cosy.(*Ctx[...]).beforeExecuteHook(...)
        /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/hook.go:13
github.com/uozi-tech/cosy.(*Ctx[...]).Create(0x5593800)
        /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/create.go:41 +0x657
github.com/0xJacky/Nginx-UI/api/certificate.AddCert(0xc000a0d200)
        /home/runner/work/nginx-ui/nginx-ui/api/certificate/certificate.go:147 +0x7cf
github.com/gin-gonic/gin.(*Context).Next(0xc000a0d200)
        /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 +0x2b
github.com/0xJacky/Nginx-UI/router.InitRouter.Proxy.fu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions