🐛 Bug Report: Panic when sending test email #441

Closed
opened 2025-10-08 00:08:47 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @renevo on GitHub.

Reproduction steps

Configure SMTP with a potentially incorrect user/password.

Expected behavior

Send an email, or return an error

Actual Behavior

Application panics in the logs:

2024/11/27 19:06:21 [Recovery] 2024/11/27 - 19:06:21 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:262 (0x47405f)
/usr/local/go/src/runtime/signal_unix.go:917 (0x47402c)
/usr/local/go/src/net/smtp/smtp.go:83 (0x9b75c8)
/usr/local/go/src/net/smtp/smtp.go:416 (0x9b8aff)
/app/backend/internal/service/email_service.go:115 (0x9de5e7)
/app/backend/internal/service/email_service.go:54 (0x9d169b)
/app/backend/internal/controller/app_config_controller.go:186 (0xa7b743)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f)
/app/backend/internal/middleware/jwt_auth.go:56 (0xa7a3eb)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f)
/app/backend/internal/middleware/jwt_auth.go:56 (0xa8e7fb)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa7943b)
/app/backend/internal/middleware/rate_limit.go:39 (0xa793e8)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f)
/app/backend/internal/middleware/error_handler.go:23 (0xa8ea4f)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f)
/app/backend/internal/middleware/cors.go:31 (0xa8ea0b)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6ec07)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xa6ebe4)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6f89b)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xa6f87c)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6ec07)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xa6ebe4)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6e043)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xa6dbcc)
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xa6d7f3)
/usr/local/go/src/net/http/server.go:3210 (0x71039b)
/usr/local/go/src/net/http/server.go:2092 (0x6f171b)
/usr/local/go/src/runtime/asm_arm64.s:1223 (0x47a083)
Originally created by @renevo on GitHub. ### Reproduction steps Configure SMTP with a potentially incorrect user/password. ### Expected behavior Send an email, or return an error ### Actual Behavior Application panics in the logs: ``` 2024/11/27 19:06:21 [Recovery] 2024/11/27 - 19:06:21 panic recovered: runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:262 (0x47405f) /usr/local/go/src/runtime/signal_unix.go:917 (0x47402c) /usr/local/go/src/net/smtp/smtp.go:83 (0x9b75c8) /usr/local/go/src/net/smtp/smtp.go:416 (0x9b8aff) /app/backend/internal/service/email_service.go:115 (0x9de5e7) /app/backend/internal/service/email_service.go:54 (0x9d169b) /app/backend/internal/controller/app_config_controller.go:186 (0xa7b743) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f) /app/backend/internal/middleware/jwt_auth.go:56 (0xa7a3eb) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f) /app/backend/internal/middleware/jwt_auth.go:56 (0xa8e7fb) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa7943b) /app/backend/internal/middleware/rate_limit.go:39 (0xa793e8) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f) /app/backend/internal/middleware/error_handler.go:23 (0xa8ea4f) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6263f) /app/backend/internal/middleware/cors.go:31 (0xa8ea0b) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6ec07) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xa6ebe4) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6f89b) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102 (0xa6f87c) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6ec07) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249 (0xa6ebe4) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185 (0xa6e043) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633 (0xa6dbcc) /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589 (0xa6d7f3) /usr/local/go/src/net/http/server.go:3210 (0x71039b) /usr/local/go/src/net/http/server.go:2092 (0x6f171b) /usr/local/go/src/runtime/asm_arm64.s:1223 (0x47a083) ```
OVERLORD added the bug label 2025-10-08 00:08:47 +03:00
Author
Owner

@renevo commented on GitHub:

This looks like it might also be an issue with my email postfix server not being TLS/StarTLS

https://github.com/stonith404/pocket-id/blob/main/backend/internal/service/email_service.go#L100-L112

@renevo commented on GitHub: This looks like it might also be an issue with my email postfix server not being TLS/StarTLS https://github.com/stonith404/pocket-id/blob/main/backend/internal/service/email_service.go#L100-L112
Author
Owner

@renevo commented on GitHub:

Thanks!

@renevo commented on GitHub: Thanks!
Author
Owner

@stonith404 commented on GitHub:

This should be fixed in v0.18.0.

@stonith404 commented on GitHub: This should be fixed in `v0.18.0`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#441