Testing SMTP from /admin/config results in ISE 500 #1144

Closed
opened 2025-11-02 03:49:57 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @ptman on GitHub (Oct 12, 2017).

  • Gitea version (or commit ref): 1.2.0 docker image
  • Git version: Gitea reports 2.11.3
  • Operating system: debian
  • Database (use [x]):
    • PostgreSQL
  • Can you reproduce the bug at https://try.gitea.io:
    • No (no admin?)
  • Log: (sorry, not a gist, because I think it is quite short)
Oct 12 08:20:01 hostname docker/50025be31439[409]: [Macaron] 2017-10-12 08:20:01: Started POST /admin/config/test_mail for <ip redacted>
Oct 12 08:20:01 hostname docker/50025be31439[409]: 2017/10/12 08:20:01 #033[1;32m[I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "description", "num_teams", "num_members", "diff_view_style" FROM "user" WHERE "id"=$1 LIMIT 1 []interface {}{2}#033[0m
Oct 12 08:20:01 hostname docker/50025be31439[409]: 2017/10/12 08:20:01 #033[1;32m[I] [SQL] SELECT count(*) FROM "notification" WHERE user_id = $1 AND status = $2 []interface {}{2, 0x1}#033[0m
Oct 12 08:20:01 hostname docker/50025be31439[409]: [Macaron] PANIC: runtime error: slice bounds out of range
Oct 12 08:20:01 hostname docker/50025be31439[409]: /usr/lib/go/src/runtime/panic.go:491 (0x55f554fd41a6)
Oct 12 08:20:01 hostname docker/50025be31439[409]: /usr/lib/go/src/runtime/panic.go:35 (0x55f554fd2ebf)
Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/modules/mailer/mailer.go:44 (0x55f5556ae3e5)
Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/modules/mailer/mailer.go:60 (0x55f5556ae48e)
Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/models/mail.go:43 (0x55f555868896)
Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/routers/admin/admin.go:186 (0x55f555bb1e6b)

Description

I remember being able to send test emails before, and I haven't changed the config as I upgraded from 1.1.4 to 1.2.0

Originally created by @ptman on GitHub (Oct 12, 2017). - Gitea version (or commit ref): 1.2.0 docker image - Git version: Gitea reports 2.11.3 - Operating system: debian - Database (use `[x]`): - [X] PostgreSQL - Can you reproduce the bug at https://try.gitea.io: - [X] No (no admin?) - Log: (sorry, not a gist, because I think it is quite short) ``` Oct 12 08:20:01 hostname docker/50025be31439[409]: [Macaron] 2017-10-12 08:20:01: Started POST /admin/config/test_mail for <ip redacted> Oct 12 08:20:01 hostname docker/50025be31439[409]: 2017/10/12 08:20:01 #033[1;32m[I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_creation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", "use_custom_avatar", "num_followers", "num_following", "num_stars", "num_repos", "description", "num_teams", "num_members", "diff_view_style" FROM "user" WHERE "id"=$1 LIMIT 1 []interface {}{2}#033[0m Oct 12 08:20:01 hostname docker/50025be31439[409]: 2017/10/12 08:20:01 #033[1;32m[I] [SQL] SELECT count(*) FROM "notification" WHERE user_id = $1 AND status = $2 []interface {}{2, 0x1}#033[0m Oct 12 08:20:01 hostname docker/50025be31439[409]: [Macaron] PANIC: runtime error: slice bounds out of range Oct 12 08:20:01 hostname docker/50025be31439[409]: /usr/lib/go/src/runtime/panic.go:491 (0x55f554fd41a6) Oct 12 08:20:01 hostname docker/50025be31439[409]: /usr/lib/go/src/runtime/panic.go:35 (0x55f554fd2ebf) Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/modules/mailer/mailer.go:44 (0x55f5556ae3e5) Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/modules/mailer/mailer.go:60 (0x55f5556ae48e) Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/models/mail.go:43 (0x55f555868896) Oct 12 08:20:01 hostname docker/50025be31439[409]: /srv/app/src/code.gitea.io/gitea/routers/admin/admin.go:186 (0x55f555bb1e6b) ``` ## Description I remember being able to send test emails before, and I haven't changed the config as I upgraded from 1.1.4 to 1.2.0
GiteaMirror added the issue/duplicate label 2025-11-02 03:49:57 -06:00
Author
Owner

@lunny commented on GitHub (Oct 12, 2017):

Could you test it on https://try.gitea.io ?

@lunny commented on GitHub (Oct 12, 2017): Could you test it on https://try.gitea.io ?
Author
Owner

@ptman commented on GitHub (Oct 12, 2017):

No, I don't have admin access (to /admin/config)

@ptman commented on GitHub (Oct 12, 2017): No, I don't have admin access (to /admin/config)
Author
Owner

@tboerger commented on GitHub (Oct 12, 2017):

Sending the test mail on https://try.gitea.io works without an issue.

@tboerger commented on GitHub (Oct 12, 2017): Sending the test mail on https://try.gitea.io works without an issue.
Author
Owner

@ptman commented on GitHub (Oct 12, 2017):

I have ENABLE_HTML_ALTERNATIVE = false. How about try.gitea.io?

The line in the stack trace seems to be:

if strings.Contains(body[:100], "<html>") {
@ptman commented on GitHub (Oct 12, 2017): I have `ENABLE_HTML_ALTERNATIVE = false`. How about try.gitea.io? The line in the stack trace seems to be: if strings.Contains(body[:100], "<html>") {
Author
Owner

@ptman commented on GitHub (Oct 12, 2017):

So this is actually https://github.com/go-gitea/gitea/pull/2479

Please backport?

@ptman commented on GitHub (Oct 12, 2017): So this is actually https://github.com/go-gitea/gitea/pull/2479 Please backport?
Author
Owner

@lunny commented on GitHub (Oct 13, 2017):

duplicated with #2472

@lunny commented on GitHub (Oct 13, 2017): duplicated with #2472
Author
Owner

@lunny commented on GitHub (Oct 13, 2017):

see #2696

@lunny commented on GitHub (Oct 13, 2017): see #2696
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1144