Gitea fails to start on wrong mailer configuration #2682

Closed
opened 2025-11-02 04:44:22 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @byRoadrunner on GitHub (Dec 23, 2018).

  • Gitea version (or commit ref): a06ae0
  • Git version: 2.18.1
  • Operating system: Linux (in Docker)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
server_1  | panic: runtime error: invalid memory address or nil pointer dereference
server_1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xecc2a6]
server_1  |
server_1  | goroutine 82 [running]:
server_1  | code.gitea.io/gitea/models.mailIssueCommentToParticipants(0x18c7160, 0xc0010a2000, 0xc000110160, 0xc00095fc00, 0x0, 0x0, 0xc0028c4000, 0x3535cf8, 0x0, 0x0, ...)
server_1  |     /go/src/code.gitea.io/gitea/models/issue_mail.go:81 +0xa56
server_1  | code.gitea.io/gitea/models.(*Comment).MailParticipants(0xc0028c4000, 0x18c7160, 0xc0010a2000, 0xe, 0xc000110160, 0x1, 0x0)
server_1  |     /go/src/code.gitea.io/gitea/models/issue_comment.go:378 +0x235
server_1  | code.gitea.io/gitea/models.sendCreateCommentAction(0xc0010a2000, 0xc00283fab0, 0xc0028c4000, 0x0, 0x0)
server_1  |     /go/src/code.gitea.io/gitea/models/issue_comment.go:635 +0x78b
server_1  | code.gitea.io/gitea/models.createComment(0xc0010a2000, 0xc00283fab0, 0x0, 0x0, 0xc00283fb30)
server_1  |     /go/src/code.gitea.io/gitea/models/issue_comment.go:533 +0x279
server_1  | code.gitea.io/gitea/models.createStatusComment(0xc0010a2000, 0xc00095fc00, 0xc000110160, 0x0, 0x0, 0x2)
server_1  |     /go/src/code.gitea.io/gitea/models/issue_comment.go:647 +0xc8
server_1  | code.gitea.io/gitea/models.(*Issue).changeStatus(0xc000110160, 0xc0010a2000, 0xc00095fc00, 0x1, 0x0, 0xc000673801)
server_1  |     /go/src/code.gitea.io/gitea/models/issue.go:736 +0x24f
server_1  | code.gitea.io/gitea/models.(*PullRequest).setMerged(0xc000807860, 0x0, 0x0)
server_1  |     /go/src/code.gitea.io/gitea/models/pull.go:565 +0x2a6
server_1  | code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc000807860, 0x0)
server_1  |     /go/src/code.gitea.io/gitea/models/pull.go:605 +0x223
server_1  | code.gitea.io/gitea/models.TestPullRequests()
server_1  |     /go/src/code.gitea.io/gitea/models/pull.go:1328 +0x2c8
server_1  | created by code.gitea.io/gitea/models.InitTestPullRequests
server_1  |     /go/src/code.gitea.io/gitea/models/pull.go:1366 +0x35

Description

If there is an error in the mailer configuration this error occurs and Gitea is not able to start. I don´t think that an wrong configuration of the mailer should stop Gitea completely from starting.

Originally created by @byRoadrunner on GitHub (Dec 23, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): a06ae0 - Git version: 2.18.1 - Operating system: Linux (in Docker) - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` server_1 | panic: runtime error: invalid memory address or nil pointer dereference server_1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xecc2a6] server_1 | server_1 | goroutine 82 [running]: server_1 | code.gitea.io/gitea/models.mailIssueCommentToParticipants(0x18c7160, 0xc0010a2000, 0xc000110160, 0xc00095fc00, 0x0, 0x0, 0xc0028c4000, 0x3535cf8, 0x0, 0x0, ...) server_1 | /go/src/code.gitea.io/gitea/models/issue_mail.go:81 +0xa56 server_1 | code.gitea.io/gitea/models.(*Comment).MailParticipants(0xc0028c4000, 0x18c7160, 0xc0010a2000, 0xe, 0xc000110160, 0x1, 0x0) server_1 | /go/src/code.gitea.io/gitea/models/issue_comment.go:378 +0x235 server_1 | code.gitea.io/gitea/models.sendCreateCommentAction(0xc0010a2000, 0xc00283fab0, 0xc0028c4000, 0x0, 0x0) server_1 | /go/src/code.gitea.io/gitea/models/issue_comment.go:635 +0x78b server_1 | code.gitea.io/gitea/models.createComment(0xc0010a2000, 0xc00283fab0, 0x0, 0x0, 0xc00283fb30) server_1 | /go/src/code.gitea.io/gitea/models/issue_comment.go:533 +0x279 server_1 | code.gitea.io/gitea/models.createStatusComment(0xc0010a2000, 0xc00095fc00, 0xc000110160, 0x0, 0x0, 0x2) server_1 | /go/src/code.gitea.io/gitea/models/issue_comment.go:647 +0xc8 server_1 | code.gitea.io/gitea/models.(*Issue).changeStatus(0xc000110160, 0xc0010a2000, 0xc00095fc00, 0x1, 0x0, 0xc000673801) server_1 | /go/src/code.gitea.io/gitea/models/issue.go:736 +0x24f server_1 | code.gitea.io/gitea/models.(*PullRequest).setMerged(0xc000807860, 0x0, 0x0) server_1 | /go/src/code.gitea.io/gitea/models/pull.go:565 +0x2a6 server_1 | code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc000807860, 0x0) server_1 | /go/src/code.gitea.io/gitea/models/pull.go:605 +0x223 server_1 | code.gitea.io/gitea/models.TestPullRequests() server_1 | /go/src/code.gitea.io/gitea/models/pull.go:1328 +0x2c8 server_1 | created by code.gitea.io/gitea/models.InitTestPullRequests server_1 | /go/src/code.gitea.io/gitea/models/pull.go:1366 +0x35 ``` ## Description If there is an error in the mailer configuration this error occurs and Gitea is not able to start. I don´t think that an wrong configuration of the mailer should stop Gitea completely from starting.
GiteaMirror added the type/bug label 2025-11-02 04:44:22 -06:00
Author
Owner

@benharri commented on GitHub (Jan 26, 2019):

I've started getting this crash two days after upgrading to 1.7.0 (with no additional change to the mailer settings...)

It still won't start with either smtp or using sendmail.

Edit: Starting up fully with the mailer disabled, then re-enabling it seems to have cleared up this error.

@benharri commented on GitHub (Jan 26, 2019): I've started getting this crash two days after upgrading to 1.7.0 (with no additional change to the mailer settings...) It still won't start with either smtp or using sendmail. Edit: Starting up fully with the mailer disabled, then re-enabling it seems to have cleared up this error.
Author
Owner

@lunny commented on GitHub (Feb 7, 2019):

Closed now, Please feel free to reopen it.

@lunny commented on GitHub (Feb 7, 2019): Closed now, Please feel free to reopen it.
Author
Owner

@FloThinksPi commented on GitHub (Feb 11, 2019):

@lunny We are also seeing this.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xecc5e1]
goroutine 49 [running]:
code.gitea.io/gitea/models.mailIssueCommentToParticipants(0x18cdee0, 0xc0032e02c0, 0xc000738000, 0xc00378cc00, 0x0, 0x0, 0xc002741500, 0x3544018, 0x0, 0x0, ...)
        /go/src/code.gitea.io/gitea/models/issue_mail.go:81 +0xa91
code.gitea.io/gitea/models.(*Comment).MailParticipants(0xc002741500, 0x18cdee0, 0xc0032e02c0, 0xe, 0xc000738000, 0x1, 0x0)
        /go/src/code.gitea.io/gitea/models/issue_comment.go:378 +0x235
code.gitea.io/gitea/models.sendCreateCommentAction(0xc0032e02c0, 0xc0038d1ab0, 0xc002741500, 0x0, 0x0)
        /go/src/code.gitea.io/gitea/models/issue_comment.go:635 +0x78b
code.gitea.io/gitea/models.createComment(0xc0032e02c0, 0xc0038d1ab0, 0x0, 0x0, 0xc0038d1b30)
        /go/src/code.gitea.io/gitea/models/issue_comment.go:533 +0x279
code.gitea.io/gitea/models.createStatusComment(0xc0032e02c0, 0xc00378cc00, 0xc000738000, 0x0, 0x0, 0x2)
        /go/src/code.gitea.io/gitea/models/issue_comment.go:647 +0xc8
code.gitea.io/gitea/models.(*Issue).changeStatus(0xc000738000, 0xc0032e02c0, 0xc00378cc00, 0x1, 0x0, 0xf57470)
        /go/src/code.gitea.io/gitea/models/issue.go:736 +0x24f
code.gitea.io/gitea/models.(*PullRequest).setMerged(0xc0021485b0, 0x0, 0x0)
        /go/src/code.gitea.io/gitea/models/pull.go:602 +0x2a6
code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc0021485b0, 0x0)
        /go/src/code.gitea.io/gitea/models/pull.go:642 +0x223
code.gitea.io/gitea/models.TestPullRequests()
        /go/src/code.gitea.io/gitea/models/pull.go:1365 +0x2c8
created by code.gitea.io/gitea/models.InitTestPullRequests
        /go/src/code.gitea.io/gitea/models/pull.go:1403 +0x35

We are at commit 97dafdc057
The Docker Container automatically restarts and instantly crashes again with above error.
The only solution is, like stated by @benharri to disable the mailer, let the container restart, enable it again and then restart it manually.

@FloThinksPi commented on GitHub (Feb 11, 2019): @lunny We are also seeing this. ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xecc5e1] goroutine 49 [running]: code.gitea.io/gitea/models.mailIssueCommentToParticipants(0x18cdee0, 0xc0032e02c0, 0xc000738000, 0xc00378cc00, 0x0, 0x0, 0xc002741500, 0x3544018, 0x0, 0x0, ...) /go/src/code.gitea.io/gitea/models/issue_mail.go:81 +0xa91 code.gitea.io/gitea/models.(*Comment).MailParticipants(0xc002741500, 0x18cdee0, 0xc0032e02c0, 0xe, 0xc000738000, 0x1, 0x0) /go/src/code.gitea.io/gitea/models/issue_comment.go:378 +0x235 code.gitea.io/gitea/models.sendCreateCommentAction(0xc0032e02c0, 0xc0038d1ab0, 0xc002741500, 0x0, 0x0) /go/src/code.gitea.io/gitea/models/issue_comment.go:635 +0x78b code.gitea.io/gitea/models.createComment(0xc0032e02c0, 0xc0038d1ab0, 0x0, 0x0, 0xc0038d1b30) /go/src/code.gitea.io/gitea/models/issue_comment.go:533 +0x279 code.gitea.io/gitea/models.createStatusComment(0xc0032e02c0, 0xc00378cc00, 0xc000738000, 0x0, 0x0, 0x2) /go/src/code.gitea.io/gitea/models/issue_comment.go:647 +0xc8 code.gitea.io/gitea/models.(*Issue).changeStatus(0xc000738000, 0xc0032e02c0, 0xc00378cc00, 0x1, 0x0, 0xf57470) /go/src/code.gitea.io/gitea/models/issue.go:736 +0x24f code.gitea.io/gitea/models.(*PullRequest).setMerged(0xc0021485b0, 0x0, 0x0) /go/src/code.gitea.io/gitea/models/pull.go:602 +0x2a6 code.gitea.io/gitea/models.(*PullRequest).manuallyMerged(0xc0021485b0, 0x0) /go/src/code.gitea.io/gitea/models/pull.go:642 +0x223 code.gitea.io/gitea/models.TestPullRequests() /go/src/code.gitea.io/gitea/models/pull.go:1365 +0x2c8 created by code.gitea.io/gitea/models.InitTestPullRequests /go/src/code.gitea.io/gitea/models/pull.go:1403 +0x35 ``` We are at commit 97dafdc0578ad24a14370c813c95108c0c41fc5b The Docker Container automatically restarts and instantly crashes again with above error. The only solution is, like stated by @benharri to disable the mailer, let the container restart, enable it again and then restart it manually.
Author
Owner

@pree commented on GitHub (Feb 11, 2019):

I've got this error after someone merged a PR...

@pree commented on GitHub (Feb 11, 2019): I've got this error after someone merged a PR...
Author
Owner

@zeripath commented on GitHub (Feb 11, 2019):

@FloThinksPi and @pree I think this was fixed by #5895

Any chance you could check if backporting that fix fixes your issue?

@zeripath commented on GitHub (Feb 11, 2019): @FloThinksPi and @pree I think this was fixed by #5895 Any chance you could check if backporting that fix fixes your issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2682