mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-09 21:10:00 -05:00
500 Internal Server Error when creating new pull request #2994
Closed
opened 2025-11-02 04:56:26 -06:00 by GiteaMirror
·
29 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.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-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#2994
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hotbain on GitHub (Mar 2, 2019).
Description
[Macaron] 2019-03-02 09:59:20: Completed POST /hotbain/spring_cloud/compare/master...test_branch 404 Not Found in 175.311212ms
[Macaron] 2019-03-02 09:59:21: Started GET /serviceworker.js for [::1]
Screenshots
@ptman commented on GitHub (Mar 4, 2019):
We're also getting
@lafriks commented on GitHub (Mar 4, 2019):
Are there are any error in gitea.log?
@ptman commented on GitHub (Mar 5, 2019):
No errors. But if I go to /org/proj/pulls and press "New Pull Request" it goes to /org/proj/compare/master...fork:master which gives 404. We did not have this problem with 1.7.2.
@ptman commented on GitHub (Mar 13, 2019):
Still an issue with 1.7.4
@ptman commented on GitHub (Mar 13, 2019):
Are there schema changes between 1.7.2 and 1.7.4 or would downgrade be safe?
@zeripath commented on GitHub (Mar 13, 2019):
@ptman I'm sorry to see this. I've not been following this so I don't completely understand the issue. Are you able to work out what the url should be?
Having seen two PRs touch this endpoint in quick succession because one completely broke I think this endpoint is fairly poorly described. I'm able get 404s on my rather pathological repos on try.
@ptman commented on GitHub (Mar 13, 2019):
The URL should show the diff between the base and the branch to be merged, not 404. I could look closer at the SQL differences if I knew for sure that downgrading to 1.7.2 doesn't break anything.
@zeripath commented on GitHub (Mar 13, 2019):
OK it looks like that compare urls are a bit of mess:
Try comparing any branch with
%in it. https://try.gitea.io/arandomer/pathological/compare/master...foo%25foohttps://try.gitea.io/arandomer/pathological/compare/master...foo%2525foo
https://try.gitea.io/arandomer/pathological/compare/master...foo%252525foo
In particular try thinking about what happens with
%2F:https://try.gitea.io/arandomer/pathological/compare/path%252Fpath...path/path
It's not just
%, preceding-is particularly broken:https://try.gitea.io/arandomer/pathological/compare/--heads...foo%2525foo
https://try.gitea.io/arandomer/pathological/compare/foo%2525foo...--heads
Get the branches the wrong way round causes a 500:
https://try.gitea.io/arandomer/pathological/compare/notsubpath...master
vs:
https://try.gitea.io/arandomer/pathological/compare/master...notsubpath
There is a bug in the diff generation where escaping filenames with quotes in diff generation breaks:
https://try.gitea.io/arandomer/pathological/compare/master...quotebreak
Which is the same one that affects:
08c5f2e47b@mrsdizzie commented on GitHub (Mar 13, 2019):
For reference here is some discussion of why it can 404 when there is a double quote in the filename: https://github.com/go-gitea/gitea/issues/6309. Basic testing says gitea will break on any situation where the diff includes the diff --git section inside double quotes like diff --git "a/file" "b/file". This includes having a backslash in the file name which is perhaps more common (Windows?).
I think this might be one of a few issues that lead to bad compare/pull/etc...
@ptman commented on GitHub (Mar 14, 2019):
In my case the branch names don't contain anything that needs to be encoded. Is it safe to downgrade from 1.7.4 to 1.7.2 or have there been DB schema changes?
@lunny commented on GitHub (Mar 14, 2019):
@ptman that's downgrade should be safe but of course backup before any change of your production environment.
@ptman commented on GitHub (Mar 14, 2019):
Ok, here are some sanitized logs from both 1.7.2 and 1.7.4. It seems that after 1.7.2 (i.e. 1.7.3 & 1.7.4) there's a missing join. You can diff the files side by side to see the difference, but I've also added newlines to point it out: https://gist.github.com/ptman/f76b398d0503e5c50424c1ea8cbfafec
@zeripath commented on GitHub (Mar 15, 2019):
Ok @ptman it looks like your issue is different from the initial issue reported by @hotbain. I'm not certain what's causing that issue as we need more information from @hotbain - If I had to guess, it's likely they're affected by the issue fixed by @mrsdizzie, it's unlikely that they're affected by the remaining branch escaping and preceding hyphen branch issues.
In any case your issue is related to:
5c30817b5fWhich was reverted by:
fe99c9901dNow, you appear to be in the subset for whom the original commit worked and it's reversion breaks.
This is #6302
Ok, so the revision did two things - one was change the url and the other was the permissions change.
So first of all, are the permissions correct - can the proposer read pulls on the base?
And I need to know where you click pull request and what you expect the URL to be. Can you hand change the URL to make it work?
@ptman commented on GitHub (Mar 15, 2019):
so let's take this to #6302
@nicovince commented on GitHub (Mar 26, 2019):
I am also experiencing this kinds of errors when creating pull requests and accepting pull requests.
I have not been able to pinpoint exactly how to produce an error, I tried using the PR url given on the console during the push or manually getting to the pull request page. Sometimes one way gives a 500, sometimes it is the other way around.
My setup is using gitea 1.7.3 built with go1.11.5 : tidb, sqlite3
git version : 2.18.1
Usually when the error 500 appears I have the following error in gitea.log :
Do you need more informations ?
@lunny commented on GitHub (Mar 26, 2019):
@nicovince that's another issue. It caused by your sqlite database and which version are you using?
@nicovince commented on GitHub (Mar 26, 2019):
@lunny I am using sqlite-3.25.3
edit: trying to update to 3.27, I'll let you know if that improves my situation.
@zeripath commented on GitHub (Mar 26, 2019):
@nicovince please open another issue for this. I suspect we will need to move to a pure Gitea serv as client of Gitea web to prevent this.
@nicovince commented on GitHub (Mar 26, 2019):
opened #6435
@lunny commented on GitHub (Apr 25, 2019):
@hotbain could you confirm that this has been resolved on v1.8.0
@stale[bot] commented on GitHub (Jun 24, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@lunny commented on GitHub (Jun 25, 2019):
I think this has been resolved. Please feel free to reopen it.
@jeansergegagnon commented on GitHub (Jun 25, 2019):
Still happens in Gitea Version: 1.9.0+dev-376-ge07ff2f89
logs show:
@zeripath commented on GitHub (Jun 26, 2019):
This is not the same bug as the original.
It has the same overall effect but it is not the same.
@jeansergegagnon how did you cause this?
@rmbleeker commented on GitHub (Aug 28, 2019):
I'm experiencing the same issues as @jeansergegagnon on Gitea version 1.9.2, a simple installation with an sqlite database.
Steps to reproduce:
Log:
If you need me to open a separate issue for this let me know.
@guillep2k commented on GitHub (Aug 28, 2019):
This looks like a different problem too. Please fill in another issue for it. Thank you.
@lunny commented on GitHub (Dec 19, 2019):
OK. Could you reproduce this follow the steps:
1 fork A to B
2 push -f to B
3 click pull request on B
4 500
@artfisica commented on GitHub (Feb 28, 2020):
Dear All,
I found the same issue. After a good installation, simply stop to work.
Please, kindly ask any newer reference. Update the git version is not an option for me.
Thanks!
@6543 commented on GitHub (Sep 17, 2020):
this should be fixed if there is a new issue feel free to open a new issue for it :)