-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Opening a PR in 1.17.0 results in a 500 error #20621
Comments
From what version of Gitea were you migrating from? How old was the fork? Was the fork working on the previous version? Are there any other forks affected? Do you have a backup of your db from before the migration that you could check the contents of the repo_units table for that repository? There are no migrations in 1.17 that would cause the repo_units here to change - although we may now actually be testing for the presence. So it's probably that the repo_unit for PullRequests was never set and the repo should never been allowed to do PRs in the first place!! If the repo does not have the PullRequest unit set, whilst we should not 500 the best we could do in that situation is send a forbidden - which doesn't get the user much further. |
…wedToUpdate Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net>
…wedToUpdate (#20839) Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix #20621 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
…wedToUpdate (go-gitea#20839) Backport go-gitea#20621 Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net>
…wedToUpdate (#20839) (#20848) Backport #20621 Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix #20621 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
…wedToUpdate (go-gitea#20839) Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Description
After migrating to version 1.17.0, some newly created PRs as well as some PRs that were previously created in version 1.16.9 now won't open and always result in a 500 error.
The logs always show the same error when trying to open an affected PR:
This seems to be the case for all PRs that originate from the fork of a user where, at least after migrating to 1.17.0, 'Enable Repository Pull Requests' is no longer enabled in the fork's Repository settings.
After (re-)enabling this option, the 500 error no longer occurs for PRs originating from that specific fork.
Gitea Version
1.17.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Official Docker image on Ubuntu Server
Database
No response
The text was updated successfully, but these errors were encountered: