Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template Rendering Error When Viewing Pull-Requests #18706

Closed
ghost opened this issue Feb 10, 2022 · 5 comments · Fixed by #18713
Closed

Template Rendering Error When Viewing Pull-Requests #18706

ghost opened this issue Feb 10, 2022 · 5 comments · Fixed by #18713
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Feb 10, 2022

Gitea Version

1.16.1

Git Version

No response

Operating System

Linux Debian 11

How are you running Gitea?

We're using the Gitea binary gitea-1.16.1-linux-amd64 from the "Releases" page.
An Nginx reverse proxy communicates with Gitea via http+unix (HTTP over Unix sockets).

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/rtpt-jonaslieb/23ad0a6d873ade04aac7e2ad55f0dfd2

Description

Gitea displays a 500 server error upon viewing an unmerged pull request. The corresponding log is attached to this issue.
It does not happen with pull requests that have been merged or closed.

The underlying issue appears to be that PullRequestWorkInProgressPrefixes is undefined in sidebar.tmpl.
The corresponding render-call is here:

ctx.HTML(http.StatusOK, tplIssueView)

in function ViewIssue:
func ViewIssue(ctx *context.Context) {

The error occurs even if WORK_IN_PROGRESS_PREFIXES = WIP:,[WIP] is explicitly included in the app.ini section repository.pull-request.

I'm not quite sure why the issue cannot be reproduced on the Gitea demo instance.

Screenshots

No response

@ghost
Copy link
Author

ghost commented Feb 10, 2022

This appears to happen only if the PR refers to a broken Git state. In our case, this happened by creating a PR via the API.

zeripath added a commit to zeripath/gitea that referenced this issue Feb 10, 2022
Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix go-gitea#18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.16.2 milestone Feb 10, 2022
zeripath added a commit that referenced this issue Feb 11, 2022
…18713)

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix #18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
@wxiaoguang
Copy link
Contributor

Wait for backport

@wxiaoguang wxiaoguang reopened this Feb 11, 2022
zeripath added a commit to zeripath/gitea that referenced this issue Feb 12, 2022
…o-gitea#18713)

Backport go-gitea#18713

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix go-gitea#18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Feb 12, 2022
…18713) (#18737)

Backport #18713

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix #18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
@lunny lunny closed this as completed Feb 13, 2022
@weezlemsneezle
Copy link

Is there a workaround for this issue? After the weekend all of our Pull-Requests suddenly show this error. All Pull-Request were created through the web-interface.
We would like to continue working with Pull-Requests as soon as possible and not wait for this bugfix to be released

@wxiaoguang
Copy link
Contributor

If you are affected by this bug, you can try to download the latest 1.16-dev from https://dl.gitea.io/gitea/1.16/ , it includes this fix.

If the releases in https://dl.gitea.io/gitea/1.16/ doesn't help, then the bug you meet could be a new one.

@weezlemsneezle
Copy link

Thanks for the quick reply, I tried the dev-build and it indeed fixes the 500 HTTP-Error.
But, as predicted, the Pull-Request just says This pull request is broken due to missing fork information.
I think I should open a new Issue for this but I don't even know what to title it, I can clone the Project without issues, fsck doesn't say anything and the gitea log file also has nothing special even on debug, only the Pull-Requests seem broken

Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
…o-gitea#18713)

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix go-gitea#18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants