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

Render failed when opening PR with conversation #29885

Closed
fhennig42 opened this issue Mar 18, 2024 · 4 comments · Fixed by #29888
Closed

Render failed when opening PR with conversation #29885

fhennig42 opened this issue Mar 18, 2024 · 4 comments · Fixed by #29888
Labels
Milestone

Comments

@fhennig42
Copy link

Description

I upgraded my gitea instance to version 1.21.7.
When I open certain PR's which already have a conversation/comments attached, I get the following error:

Render failed, failed to render template: repo/pulls/files, error: template error: builtin(bindata):repo/diff/conversation:4:45 : executing "repo/diff/conversation" at <0>: nil pointer evaluating *issues.Review.Type

{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}

^

Since this looked similar to #29773 I also tried the newer versions 1.21.9 and even nightly with the same results.

Gitea Version

1.21.7

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/fhennig42/7247399e2e87f6d7050414633661ff46

Screenshots

image

Git Version

2.40.1

Operating System

Ubuntu 22.04

How are you running Gitea?

docker (official docker image managed by doker-compose)

Database

None

@silverwind
Copy link
Member

@wxiaoguang
Copy link
Contributor

It is not related to 29773, I think the root cause is that some database records are deleted then the template fails to render.

My guess is that the "review" is deleted.

I could remember a recent PR: Workaround to clean up old reviews on creating a new one (#28554) #29264

@6543 do you have more ideas?

@wxiaoguang
Copy link
Contributor

A quick and dirty fix could be like this: Fix template error when comment review doesn't exist #29888

@fhennig42
Copy link
Author

Wow, that was quite fast. I just built the docker image with the fix on your branch before it was merged. As far as I can tell it worked like a charm. I'm able to see the conversation and inline comments in the PR files view.
I will test this again when the official 1.12.9 is out and then close the issue.

Thanks a lot for looking into this so fast 🚀

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 17, 2024
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.

3 participants