Skip to content

Migration from 1.16.9 to 1.18.3 or 1.16.9 to 1.17.3. Leads to an error 500 when we create a new pull request #23274

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

Closed
cthed2 opened this issue Mar 3, 2023 · 4 comments
Labels

Comments

@cthed2
Copy link

cthed2 commented Mar 3, 2023

Description

Steps to reproduce in the instance that we have running.

  • Start with version 1.16.9.
  • Change docker-compose file to point to 1.18.3
  • Start server (docker-compose up).
  • Go to personal repo and fork.
  • Change readme in the repo and commit on separate branch (patch-1)
  • Request pull request.
  • Error 500.

we saw the same issue earlier going from 1.16.9 to 1.17.3 and tried to figure out if it was someting in our configuration. But now we can repeat this consistently.

The error does not occur in the curren gitea demo instance.

Gitea Version

1.18.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/cthed2/95e54a7d76721831838638de6131f747

Screenshots

image

Git Version

2.38.1

Operating System

Ubuntu 22.04

How are you running Gitea?

Running from docker

Database

SQLite

@cthed2 cthed2 added the type/bug label Mar 3, 2023
@techknowlogick
Copy link
Member

This may be fixed in 1.18.5, could you update to that?
The error in the logs is server_1 | 2023/03/03 20:42:25 ...s/context/context.go:233:HTML() [E] [64025bb1-59] Render failed: template: repo/issue/view_content/pull:332:69: executing "repo/issue/view_content/pull" at <.Issue.PullRequest.GetDefaultMergeMessage>: can't evaluate field GetDefaultMergeMessage in type *issues.PullRequest

@FvD
Copy link

FvD commented Mar 4, 2023

Thank you @techknowlogick

  • We updated from the failing version 1.18.3 to 1.18.5. We can reproduce the same error.
  • We then did the full update cycle from 1.16.9 to 1.18.5 (just to check if there is something in the database migration that has been fixed) --> same error.

Is there any additional information we can provide to help solve this issue?

@wxiaoguang
Copy link
Contributor

You might be using custom templates? If yes, revert to the official one.

@FvD
Copy link

FvD commented Mar 4, 2023

Yes! Thank you @wxiaoguang. It is a custom template that I did not update that is causing the issue. When I revert to the official once I can consistently solve all error 500 issues that we were seeing.

Thank you very much for your help.

This issue can be closed.

zeripath added a commit to zeripath/gitea that referenced this issue Mar 9, 2023
There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref go-gitea#23274

Signed-off-by: Andrew Thornton <[email protected]>
jolheiser pushed a commit that referenced this issue Mar 20, 2023
There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref #23274

---------

Signed-off-by: Andrew Thornton <[email protected]>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 20, 2023
There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref go-gitea#23274

---------

Signed-off-by: Andrew Thornton <[email protected]>
jolheiser pushed a commit that referenced this issue Mar 20, 2023
Backport #23396 by @zeripath

There are multiple duplicate reports of errors during template rendering
due to broken custom templates.

Unfortunately the error returned here is somewhat difficult for users to
understand and it doesn't return the context of the error.

This PR attempts to parse the error returned by the template renderer to
add in some further context including the filename of the template AND
the preceding lines within that template file.

Ref #23274

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: zeripath <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants