Error 500 when closing already closed issue from pull request #4625

Closed
opened 2025-11-02 05:56:42 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @giteaUser on GitHub (Jan 10, 2020).

  • Gitea version (or commit ref): v1.11.0-rc1
  • Git version: not relevant
  • Operating system: not relevant
  • 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:

Description

Making a pull request referencing an issue with keyword "closes" on an already closed issue will return error page 500 when the pull request is merged.
...

Screenshots

Originally created by @giteaUser on GitHub (Jan 10, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) 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): v1.11.0-rc1 - Git version: not relevant - Operating system: not relevant - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Making a pull request referencing an issue with keyword "closes" on an already closed issue will return error page 500 when the pull request is merged. ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the skip-changelogtype/bug labels 2025-11-02 05:56:42 -06:00
Author
Owner

@guillep2k commented on GitHub (Jan 10, 2020):

@giteaUser I'm unable to reproduce. Could you check you server logs in order to get the actual error message?

@guillep2k commented on GitHub (Jan 10, 2020): ~~@giteaUser I'm unable to reproduce. Could you check you server logs in order to get the actual error message?~~
Author
Owner

@guillep2k commented on GitHub (Jan 10, 2020):

@giteaUser I'm unable to reproduce. Could you check you server logs in order to get the actual error message?~

Never mind. I could reproduce it. It happens when the issue will be closed by the PR and one of its commits.

@guillep2k commented on GitHub (Jan 10, 2020): > > > @giteaUser I'm unable to reproduce. Could you check you server logs in order to get the actual error message?~ Never mind. I could reproduce it. It happens when the issue will be closed by the PR and one of its commits.
Author
Owner

@giteaUser commented on GitHub (Jan 10, 2020):

Never mind. I could reproduce it. It happens when the issue will be closed by the PR and one of its commits.

Do you mean if the merge commit message also has the 'closes" reference? If so, the default merge commit was not touched: "Merge branch 'branchName' of test/test into master"

Here's the relevant trace log:

2020/01/10 11:32:40 routers/repo/pull.go:698:MergePullRequest() [E] Merge: Issue [1] 0 was already closed
2020/01/10 11:32:40 ...ervices/pull/pull.go:172:AddTestPullRequestTask() [T] AddTestPullRequestTask [head_repo_id: 1, head_branch: master]: finding pull requests
2020/01/10 11:32:40 ...s/context/context.go:138:HTML() [D] Template: status/500
2020/01/10 11:32:40 ...ervices/pull/pull.go:202:func1() [T] AddTestPullRequestTask [base_repo_id: 1, base_branch: master]: finding pull requests
2020/01/10 11:32:40 ...rvices/pull/check.go:146:manuallyMerged() [E] PullRequest[3].setMerged : Issue.changeStatus: Pull request [6] 0 was already closed
2020/01/10 11:32:40 ...rvices/pull/patch.go:123:TestPatch() [D] PullRequest[3]: Patch is empty - ignoring

it seems to be fine now with #9696, thanks a lot

@giteaUser commented on GitHub (Jan 10, 2020): > Never mind. I could reproduce it. It happens when the issue will be closed by the PR and one of its commits. Do you mean if the merge commit message also has the 'closes" reference? If so, the default merge commit was not touched: "Merge branch 'branchName' of test/test into master" Here's the relevant trace log: ``` 2020/01/10 11:32:40 routers/repo/pull.go:698:MergePullRequest() [E] Merge: Issue [1] 0 was already closed 2020/01/10 11:32:40 ...ervices/pull/pull.go:172:AddTestPullRequestTask() [T] AddTestPullRequestTask [head_repo_id: 1, head_branch: master]: finding pull requests 2020/01/10 11:32:40 ...s/context/context.go:138:HTML() [D] Template: status/500 2020/01/10 11:32:40 ...ervices/pull/pull.go:202:func1() [T] AddTestPullRequestTask [base_repo_id: 1, base_branch: master]: finding pull requests 2020/01/10 11:32:40 ...rvices/pull/check.go:146:manuallyMerged() [E] PullRequest[3].setMerged : Issue.changeStatus: Pull request [6] 0 was already closed 2020/01/10 11:32:40 ...rvices/pull/patch.go:123:TestPatch() [D] PullRequest[3]: Patch is empty - ignoring ``` it seems to be fine now with #9696, thanks a lot
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4625