mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-16 04:42:51 -05:00
Pull request overview page getting 404 (?repo=) #2836
Closed
opened 2025-11-02 04:50:22 -06:00 by GiteaMirror
·
32 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.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.0-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
No Label
issue/confirmed
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#2836
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 @ntimo on GitHub (Jan 29, 2019).
3fa49f3)[x]):Description
When I go to
mygitea.com/pulls?type=all&repo=9&sort=&state=openI get a white page in Safari, Chrome simply shows the Chrome 404 page. When I change the ?repo= to be 0 it works and shows the correct repo. All other repos work fine. When I go to the Pull-Request page in the top menu and I select this one repo that is in my namespace I get this crazy error, but all other repos work fine.No custom 404 Gitea page is shown.
Log
Screenshots
@zeripath commented on GitHub (Jan 29, 2019):
There's no route tosee below/pullsdefined inrouters/routes/routes.go. There are/username/repo/pullsroutes but not a/pulls. It should therefore be a 404. Where did you get directed to/pullsfrom?@adelowo commented on GitHub (Jan 29, 2019):
@zeripath That route actually exists
2569363204/routers/routes/routes.go (L188)@adelowo commented on GitHub (Jan 29, 2019):
I was following this bug on Discord but it's past 12am here and I am exhausted, could have tested and sent a fix potentially
@zeripath commented on GitHub (Jan 29, 2019):
Ugh my bad. I just scanned that file and missed that ...
It's past 11 here too so won't be able to look at it myself further.
@techknowlogick commented on GitHub (Jan 29, 2019):
Go get some rest you two!
@zeripath commented on GitHub (Jan 29, 2019):
2569363204/routers/user/home.go (L150)is probably the misbehaving function@adelowo commented on GitHub (Jan 30, 2019):
Do you actually have a repository with an
idof 9.By the way, I think it is better we return a 404 in this instance rather than a 500
@ntimo commented on GitHub (Jan 30, 2019):
I just checked and the repo id of the repo is indeed 9. So trying to open
mygitea.com/pulls?type=all&repo=9&sort=&state=openshould not result in a 404.@zeripath commented on GitHub (Jan 30, 2019):
Sorry @ntimo . Just looking at your screenshots the likely place you're getting the 404 from is: https://github.com/go-gitea/gitea/blob/v1.7.0/routers/user/home.go#L296
That line sets the status as 404 without sending the gitea 404 page. So it seems that the ctxUser doesn't have permission to read that repository... This is odd.
@ntimo commented on GitHub (Jan 31, 2019):
@zeripath Thanks for reopening. But why would the ctxUser not have permissions to read the repo? I created it with my user and its also in my namespace ntimo/reponame. Also I can commits code changes, create pull requests, etc in this repo.
@zeripath commented on GitHub (Jan 31, 2019):
I'm not sure. That line is the only place that the 404 could be set. (It's also wrong - we should never just set a status of 404 without sending the 404 page!)
Looking at the code leading to that point I can't quite see what the problem could be - I don't think it's the clearest code but I'm not certain it's definitely wrong.
The only thing I can think of is that the internal cache on line is incorrect somehow and the repo returned on https://github.com/go-gitea/gitea/blob/master/routers/user/home.go#L300 is wrong.
Can you reproduce your problem on try or give me a script of exactly what to do to replicate it?
@ntimo commented on GitHub (Jan 31, 2019):
I can't replicate it on try. Well the steps I follow to reproduce the issue on my installation are quite simple:
Then it opens the url:
mygitea.com/pulls?type=all&repo=9&sort=&state=openwhich shows the white page.I can make a video later and send it to you via Discord if that would help?
@stale[bot] commented on GitHub (Apr 1, 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 (Apr 1, 2019):
@ntimo can you still reproduce it on v1.7.5?
@ntimo commented on GitHub (Apr 1, 2019):
@lunny I am using 1.8.0-rc2 at the moment and I can still reproduce it :(
@yanOnGithub commented on GitHub (Apr 30, 2019):
reproduced in 1.8.0, win7 64 bit, sqlite
@lunny commented on GitHub (Apr 30, 2019):
I think this should be fixed by #6754@Ahaus314 commented on GitHub (Nov 20, 2019):
We're experiencing the same issue with the version 1.9.4.
@guillep2k commented on GitHub (Nov 21, 2019):
@Ahaus314 This can happen if the repository is private and you somehow lost the session, e.g. you save a link for later, then open the browser and try to use the link without getting logged in first. If that's not your case, please:
@Ahaus314 commented on GitHub (Nov 29, 2019):
@guillep2k Thanks for the reply and sorry for the delay. This behavior still happen with v1.10.0.
@guillep2k commented on GitHub (Nov 30, 2019):
@Ahaus314 In my company I have 1.10.0 with a setting at first glance similar to yours but I can't reproduce, so there must be some subtle difference. I'm assuming that the user in the example you've detailed doesn't have an expired session (i.e. it's a recent login), so let's put that aside.
I'm suspecting there's some specific combination of permissions that leads to this problem, but I can't imagine what is it. In my case all repos are private by site policy, so there's that, but I've tested the following scenarios:
In all cases the user was either able to navigate normally or the repo wasn't listed at all (i.e. the user had not enough permissions).
Maybe the list above will give you some ideas to try yourself or some insight about the problem that could help us find it.
@jolheiser commented on GitHub (Nov 30, 2019):
As well, it seems some logging has been added to the spot @zeripath mentioned up above where a 404 status is set without a page.
Would you mind setting your logging to trace and sending some log lines around when you experience the blank page? (Apologies for having to sift through a logger set to
TRACE)For reference on the
release/v1.9branch:https://github.com/go-gitea/gitea/blob/release/v1.9/routers/user/home.go#L311-L321
@Ahaus314 commented on GitHub (Nov 30, 2019):
@guillep2k I"m pretty sure I already did those tests (I did a lot and cannot remember), but to be sure, I'll do those. I highly think it's a permission related issue. As @jolheiser said, some logging was added and I remember seeing those "Permission denied" messages in the log.
@jolheiser I already setup a dev environment which is an exact replica from the prod environment. So I can do any tests without impacting the prod. I already changed the log level to trace on that instance. I'll join some log next week when I'll get back to office.
Thanks for your help!
@6543 commented on GitHub (Nov 30, 2019):
@Ahaus314 can you test https://github.com/go-gitea/gitea/pull/8741?
-> I'll have a similar problem and solved it at the PR
@lunny commented on GitHub (Nov 30, 2019):
Maybe https://github.com/go-gitea/gitea/blob/v1.7.0/routers/user/home.go#L290 should be
Because

ctxUsermeansbut not the login user.
@davidsvantesson commented on GitHub (Dec 2, 2019):
With recent PRs this behavior has changed. However there are some small problems left:
Small nit in routers/user/home.go:313:
The check is always for unit type issues also for pull request page. Maybe the repository should also be filtered out and not be displayed in this case?
Currently you only see repositories where you are a team member, not repositories where you are collaborator of. Shouldn't the database query use the access table instead?
@Ahaus314 commented on GitHub (Dec 3, 2019):
Here's the log when I try to access the Pull Request from the top menu.
2019/12/03 10:46:49 routers/user/home.go:315:Issues() [T] Permission Denied: User 824758234000:usrTest cannot read 824758234064:UnitTypeIssues of repo 824758234112:orgTest/repoTest User in repo has Permissions: AccessMode: 824758234672:write, 5 Units, 5 UnitsMode(s): [ Units[0]: ID: 824758234208 RepoID: 824758234240 Type: 824758234704:UnitTypeExternalTracker Config: {"ExternalTrackerURL":"https://<OUR_TICKET_MANAGER_ADDRESS>","ExternalTrackerFormat":"","ExternalTrackerStyle":""} Units[1]: ID: 824758234304 RepoID: 824758234336 Type: 824758234736:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":true,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true} Units[2]: ID: 824758234400 RepoID: 824758234432 Type: 824758234768:UnitTypeCode Config: {} Units[3]: ID: 824758234496 RepoID: 824758234528 Type: 824758234800:UnitTypeReleases Config: {} Units[4]: ID: 824758234592 RepoID: 824758234624 Type: 824758234832:UnitTypeExternalWiki Config: {"ExternalWikiURL":"https://<OUR_WIKI_ADDRESS>"} UnitMode[824758234864:UnitTypeCode]: 824758234896:write UnitMode[824758234928:UnitTypeReleases]: 824758234960:write UnitMode[824758234992:UnitTypeExternalWiki]: 824758235024:write UnitMode[824758235056:UnitTypeExternalTracker]: 824758235088:write UnitMode[824758235120:UnitTypePullRequests]: 824758235152:write ] /go/src/code.gitea.io/gitea/routers/user/home.go:315 (0x1357666) /usr/local/go/src/reflect/value.go:460 (0x49699c) /usr/local/go/src/reflect/value.go:321 (0x49615a) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x9b87c0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x9b8160) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x11582a8) /go/src/code.gitea.io/gitea/modules/context/panic.go:39 (0x1158294) /usr/local/go/src/reflect/value.go:460 (0x49699c) /usr/local/go/src/reflect/value.go:321 (0x49615a) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0x9b87c0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0x9b8160) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0xab930c) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/session/session.go:192 (0xab92f7) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x9e81c7) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x9b84d0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x9b824f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x9f9d50) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/recovery.go:161 (0x9f9d3e) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/logger.go:40 (0x9ebfaa) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x9b84d0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x9b824f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x167407d) /go/src/code.gitea.io/gitea/routers/routes/routes.go:68 (0x1674068) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x9e81c7) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x9b84d0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x9b824f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x16748aa) /go/src/code.gitea.io/gitea/routers/routes/routes.go:103 (0x1674895) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:79 (0x9e81c7) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:157 (0x9b84d0) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/inject/inject.go:135 (0x9b824f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0x9e834f) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:187 (0x9faffd) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/router.go:303 (0x9f48ac) /go/src/code.gitea.io/gitea/vendor/gitea.com/macaron/macaron/macaron.go:220 (0x9ed381) /go/src/code.gitea.io/gitea/vendor/github.com/gorilla/context/context.go:141 (0xc5d204) /usr/local/go/src/net/http/server.go:2007 (0x75b75a) /usr/local/go/src/net/http/server.go:2802 (0x75ec4a) /usr/local/go/src/net/http/server.go:1890 (0x75a51b) /usr/local/go/src/runtime/asm_amd64.s:1357 (0x462c30)Thanks!
@lunny commented on GitHub (Dec 3, 2019):
This should be a different problem with the original.
@davidsvantesson commented on GitHub (Dec 3, 2019):
@Ahaus314 That is on 1.10?
@Ahaus314 commented on GitHub (Jan 7, 2020):
@davidsvantesson
I just checked, and yes, it's still on 1.10.0.
@davidsvantesson commented on GitHub (Jan 7, 2020):
#8741 is towards 1.11, so the 404 problem shall be solved there.
I think there are some other problems remaining with that page, not all PRs is included as expected.
@6543 commented on GitHub (Sep 17, 2020):
I'll close this since original issue is solved, and mentioned other issues should be too ...
... if not pleace open new issues for them