Skip to content

[1.17/1.18] 500 Error viewing branch after PR merge with non-numeric External Issue Tracker enabled #20109

Closed
@jared-nussbaum-frbb

Description

@jared-nussbaum-frbb

Description

When I merge branch through a PR the branch receiving the merge commit seems to be unable to render. The originating branch renders fine. The logs that show up are the following:

2022/06/23 10:26:40 ...s/context/context.go:231:HTML() [E] [62b47820] Render failed: template: repo/view_list:29:105: executing "repo/view_list" at <RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas>: error calling RenderCommitMessageLinkSubject: runtime error: invalid memory address or nil pointer dereference
2022/06/23 10:26:40 [62b47820] router: completed GET /{user}/Gitea-Demo/src/branch/main for REDACTED:42376, 500 Internal Server Error in 502.1ms @ repo/view.go:732(repo.Home)

When I force push on main with a commit before the PR, the rendering of main continues fine. It also doesn't seem to effect traversal into the repository's folders, just the top level view. Edit: This 500 error only occurs when an external issue tracker is used with Alphanumeric selected when the PR is created. I think it might have to do with the (!9) added to the commit name.

500 error can be seen here: https://try.gitea.io/jared-nussbaum-frbb/Gitea-Demo

Steps to reproduce:

  1. Create a new repository in Gitea 1.17 or later
  2. Go into the repository settings and select Use External Issue Tracker
  3. Fill in any URLs for the External Issue Tracker URLs.
  4. Select Alphanumeric
  5. Create a PR with a merge commit that includes the (!<number>) in the commit name.
  6. Navigate to the "Code" section of the repo and go to the branch that you created the merge commit in
  7. You should see the 500 Error on the screen.
  8. Navigate back to the settings URL directly
  9. Change the Alphanumeric setting to Numeric
  10. Navigate to the "Code" section of the repo and go to the branch that you created the merge commit in
  11. You should see your repo page again without a 500 error

Gitea Version

1.17.0+rc1
1.18.0+dev-47-g91b21473a (on demo site)

Can you reproduce the bug on the Gitea demo site?

No YES https://try.gitea.io/jared-nussbaum-frbb/Gitea-Demo

Log Gist

No response

Screenshots

No response

Git Version

git version 2.36.1

Operating System

No response

How are you running Gitea?

I am running Gitea through docker.

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions