mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
View PR in UI always returns 500 #4645
Closed
opened 2025-11-02 05:57:17 -06:00 by GiteaMirror
·
16 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.1
v1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
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#4645
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 @gerritc on GitHub (Jan 14, 2020).
[x]):Description
After upgrading from 1.10.2 we can't open any pull-request. Gitea returns always a 500. The first error appears when opening a merged pull-request. The second error appears when opening a open pull-request. I can't figure out how to reproduce this situation.
Screenshot
@zeripath commented on GitHub (Jan 14, 2020):
What version of git are you running?
@zeripath commented on GitHub (Jan 14, 2020):
Presumably you're running quite an old git and this notation doesn't work on that version. We'll have to figure out the correct call and then send a patch.
@gerritc commented on GitHub (Jan 15, 2020):
git version: 2.17.1
The problem exists also with current (2.25.0) git version.
@zeripath commented on GitHub (Jan 15, 2020):
Ok. I thought that this would be an old syntax problem.
The problem line is here:
25531c71a7/modules/git/repo_compare.go (L70)Right. Do you have access to Gitea's repositories on the server?
If so can you go to the repo and try:
git rev-parse --verify refs/pull/14/head
What I am presuming is that git can't find that unusual ref, if this works we can then try the
git log a6bb53d9d3ae1d78dd55fdd202aec98c62836485...the_sha_you_obtainIf the rev-parse doesn't work I'd like you to check in the refs/pull directory to ensure that the pull does actually have a ref.
If it doesn't then I'm confused as there should be one there - but it would at least explain why there is this problem.
@zeripath commented on GitHub (Jan 15, 2020):
I think the attached pr fixes this because I suspect what is happening is that the queue gets locked and then the branch never gets updated.
Hopefully that is the issue.
@ryan-shaw commented on GitHub (Jan 20, 2020):
@zeripath I'm running into the same issue here
GetRefCommitID(refs/pull/3/head): reference not foundversion 1.10.3, I don't think your patch will fix it as the code you are changing doesn't exist in 1.10.3 > https://github.com/go-gitea/gitea/blob/v1.10.3/modules/sync/unique_queue.go#L47
git show-ref refs/pull/3/headshows no commit when ran (in gitea repos)Let me know if you need any information.
@lunny commented on GitHub (Jan 20, 2020):
@ryan-shaw could you reproduce that on try.gitea.io?
@ryan-shaw commented on GitHub (Jan 20, 2020):
@lunny I'm not sure I could as I don't know how it got into this state.
@lunny commented on GitHub (Jan 20, 2020):
OKay. any log could you found when the 500 happened?
@ryan-shaw commented on GitHub (Jan 20, 2020):
The ref file I'd expect to see in
/data/git/repositories/<owner>/<repo>.git/refs/pull/3/headdoes not exist either so some how Gitea has deleted the references whilst the pull request is still open.The only log entry available is
2020/01/20 15:08:19 routers/repo/pull.go:368:PrepareViewPullInfo() [E] GetRefCommitID(refs/pull/3/head): reference not found@ryan-shaw commented on GitHub (Jan 20, 2020):
It appears the PRs with missing refs were before we migrated to a new host with a backup/restore, in our 14/01/2020 (pre-migration) backup I see the file
refs/pull/3/headbut in the first backup after the restore that file has gone. Could this be restore related?Our restore script does
@guillep2k commented on GitHub (Jan 20, 2020):
@ryan-shaw Not that this is related to your problem, but just in case: if you ever move the
giteaexecutable orgitea-repositories, you need to recreate the hooks and theauthorized_keysfile from the site admin menu.About your script, the question is whether the refs are in the zip file or not. Try extracting one of the refs files directly from the zip and check what it looks like. It should have entries like:
The
refsfile should be found on each repo at:@ryan-shaw commented on GitHub (Jan 20, 2020):
@guillep2k yep, that's already part of our internal restore docs :)
I can find the the
refs/pull/3/headin our pre-migration backup, in all subsequent ones it does not exist@ryan-shaw commented on GitHub (Jan 20, 2020):
@guillep2k
Interestingly, in our pre-migration backup and current state don't have
refs/pull/3/headingitea-repositories/<user>/<repo>.git/info/refsbut the backup does havegitea-repositories/<user>/<repo>.git/refs/pull/3/headI guess the above is because git gc (?)
@ryan-shaw commented on GitHub (Jan 20, 2020):
I think I know what caused the missing ref, we migrated from Gitlab and in doing so we were using
git remote update && git push --mirrorto sync changes from Gitlab to Gitea, before we switched I opened a couple of PRs to test Gitea, I think what happened with thegit push --mirroris it deleted the refs it didn't see locallyhttps://git-scm.com/docs/git-push#Documentation/git-push.txt---mirror
Turns out to be user error :)
edit:
To fix the issue:
@guillep2k commented on GitHub (Jan 20, 2020):
@ryan-shaw Glad you could solve it! 😄