ACME User Addition Bug
Alcorio opened this issue · comments
Describe the bug
A few days ago, I used the ACME feature of nginx-ui to issue a certificate (let’s call it Certificate 1) for one of my internal websites. Everything worked fine. However, today, when I attempted to register a new ACME account to issue Certificate 2 for another website, I encountered the error:
send on closed channel
Additionally, in another attempt, my ACME server StepCA reported the following error:
The server could not connect to validation target
Furthermore, when I tried to renew Certificate 1, I encountered this error:
renew cert error: error: one or more domains had a problem: [mail.tbird.com] [mail.tbird.com] acme: error presenting token: could not start HTTP server for challenge: listen tcp :9180: bind: address already in use
To Reproduce
- Add a new ACME user (I tested using both my own StepCA and https://acme-v02.api.letsencrypt.org/directory, and both resulted in the same issue).
- Open Certificate 1 (issued under the previous ACME account) and click Renew. The renewal works fine.
- Go back to ACME Users, try to modify or add a new user, and the error
send on closed channel
occurs. - At this point, updating certificates via Certificates List still works fine.
- Navigate to Managed Sites → Sites List → Modify and toggle the Encrypt website with Let's Encrypt option (enable it if disabled, or disable it if enabled), then attempt to obtain a new certificate. nginx-ui keeps trying indefinitely, and StepCA logs the error:
The server could not connect to validation target
- Attempt to renew the certificate via Certificates List and encounter the error:
9180: bind: address already in use
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
nginx-ui
2月 19 17:41:30 p6 nginx-ui[2500254]: 2025-02-19 17:41:30 ERROR router/middleware.go:16 send on closed channel
2月 19 17:41:30 p6 nginx-ui[2500254]: goroutine 5599 [running]:
2月 19 17:41:30 p6 nginx-ui[2500254]: github.com/uozi-tech/cosy/router.Init.recovery.func2.1()
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.14.4/router/middleware.go:15 +0x65
2月 19 17:41:30 p6 nginx-ui[2500254]: panic({0x39be620?, 0x4f5f930?})
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.6.linux-amd64/src/runtime/panic.go:785 +0x132
2月 19 17:41:30 p6 nginx-ui[2500254]: github.com/0xJacky/Nginx-UI/internal/cert.(*ChannelWriter).Write(0xc000f24c18, {0xc005e54b40?, 0x48, 0xc000086f08?})
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/work/nginx-ui/nginx-ui/internal/cert/channel_writer.go:17 +0x55
2月 19 17:41:30 p6 nginx-ui[2500254]: log.(*Logger).output(0xc0055eaf30, 0x0, 0x2, 0xc000087030)
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.6.linux-amd64/src/log/log.go:245 +0x45a
2月 19 17:41:30 p6 nginx-ui[2500254]: log.(*Logger).Printf(0xc0009c3bf0?, {0xc0068a1860?, 0x20?}, {0xc005e0f450?, 0x415fcb?, 0x72ddaf8cdd78?})
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.6.linux-amd64/src/log/log.go:268 +0x65
2月 19 17:41:30 p6 nginx-ui[2500254]: github.com/go-acme/lego/v4/log.Printf(...)
2月 19 17:41:30 p6 nginx-ui[2500254]: /home/runner/go/pkg/mod/github.com/go-acme/lego/v4@v4.21.0/log/logger.go:48
2月 19 17:41:30 p6 nginx-ui[2500254]: github.com/go-acme/lego/v4/log.Infof
Info (please complete the following information):
- Server OS: Ubuntu 24.10
- Server Arch: x86_64
- Nginx UI Version: Version: 2.0.0-rc.2 (384)
Additional context
Add any other context about the problem here.
Restarting nginxui didn't help; the channel still closes after a certificate update. I've tried many times with no success.
Copy that, I will try to resolve it.
Thanks! Were you able to reproduce this issue? I'm not sure if it's only happening on my side."
Thank you for your report, this is a very secret bug that has existed for a long time, now it has been fixed, and has been tested many times, and will be released in the next version.