mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-19 14:42:41 -05:00
Error while displaying public repo (404) #740
Closed
opened 2025-11-02 03:34:37 -06:00 by GiteaMirror
·
53 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
No Label
type/bug
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#740
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 @DblK on GitHub (May 24, 2017).
I saw something that could be a bug (maybe Units).
If you following the procedure you will see a 404 error:
You can also have a 404, by accessing a public repository in organization with a user not part of it.
It seems that the 404 error is triggered by routers/repo/view.go#L270.
commit:
977dcf96e0@lunny commented on GitHub (May 24, 2017):
So what's permission should a member of an organization who are not in any team have?
@pgaskin commented on GitHub (May 24, 2017):
I had this bug too after I updated my server yesterday.
@DblK commented on GitHub (May 24, 2017):
@lunny, depend on the type of the repo:
And obviously, permit a user outside of an organization to view public repository even if not part of it.
Another way to have 404, seems #1797
@lunny commented on GitHub (May 25, 2017):
@DblK, in fact, we need a document to describe all the permission settings we like Gitea do.
@camlafit commented on GitHub (May 25, 2017):
Hi
In my case if an user is only organization collaborators and in any orgnization team , i can't see any organization repo.
To get repo list , it's possible only if set in organization owner team.
But in this case this user get a 404 on repo page. In log I show :
It's possible I've followed #1797 before (convert a personal repo to organization repo)
@lunny commented on GitHub (May 25, 2017):
Which version did you use? I think
b0308d86dchas fixed that.@camlafit commented on GitHub (May 25, 2017):
I've just tried with master, 5min ago
On 1.1.1 it's ok
@lunny commented on GitHub (May 25, 2017):
So a public repo of an organization should be visited by anyone? So that the units of team should be only applied for private repos of organization?
@camlafit commented on GitHub (May 25, 2017):
If an user is set as collaborator or as member to any team (owner or not), he should be show repositories.
If a organization is public, their repositories should be public also
@lunny commented on GitHub (May 26, 2017):
Please confirm #1812 fix this issue.
@lunny commented on GitHub (Jun 20, 2017):
I think #1812 resolved this and please feel free to reopen it.
@camlafit commented on GitHub (Jun 20, 2017):
Hi
sorry :/
Can you reopen, just tried with master. 404 is again present.
Use is admin and owner organization, it can't access or change settings on repository. 404 display
I can provide an access to this server.
@lunny commented on GitHub (Jun 20, 2017):
Please give more details.
@camlafit commented on GitHub (Jun 26, 2017):
Hi
On my log server I get this :
As I don't what kind of information could be useful, I can provide an access to this server.
@lunny commented on GitHub (Jun 27, 2017):
@camlafit could you tell me the example?
@camlafit commented on GitHub (Jun 27, 2017):
Hi
On 1.1.1 , I've an organization with some repositories. Two account an admin (created on installation) and an normal user set as owner on the organization.
admin and user can check all repositories .
If I update to master, these accounts can always view organization and theirs repositories. But to one repositories, show it return a 404 (to each account)
And setting repository is also a 404.
I presume difference between this repository and the others, is the creation step. Normaly from admin account I create repository set directly on the organization. For this repo, I think to have create first on user workspace and move to organization after.
On log I get this error : cannot find any unit.
@pgaskin commented on GitHub (Jun 27, 2017):
It seems to be a migration issue with the newer finer repository permission settings.
@lunny commented on GitHub (Jun 28, 2017):
@camlafit Is this repo a private or a public? Is this repo on one organization?
@camlafit commented on GitHub (Jun 28, 2017):
It's in an organization and it's private
Other repo is this organization are also private
@lunny commented on GitHub (Jun 28, 2017):
Then if all the people is on a team? and is this team have read or write permission to the repo?
@camlafit commented on GitHub (Jun 28, 2017):
the two accounts are set in team owner , first is an admin account, other standard.
an other account is set only as collaborator with write right and not set in owner team
In this 3 cases, they get a 404 after update
@lunny commented on GitHub (Jun 28, 2017):
@camlafit maybe #1873 and #1968 fix this? which version did you test recently?
@camlafit commented on GitHub (Jun 28, 2017):
I've tried master version two day ago :
5db8cf3bd1then these commits should be present.@lunny commented on GitHub (Jul 2, 2017):
@DblK please confirm your issue.
@camlafit have your instance migrated from Gogs?
@camlafit commented on GitHub (Jul 2, 2017):
It's a from scratch gitea installation, gitosis import with api.
@lafriks commented on GitHub (Jul 2, 2017):
@lunny maybe when creating repository from API units are not correctly created?
@camlafit commented on GitHub (Jul 2, 2017):
In this specific case, repo and orgo was created only with gitea interface.
@lunny commented on GitHub (Jul 2, 2017):
@lafriks Yes. maybe you are right! I will check that.
@olymk2 commented on GitHub (Jul 12, 2017):
Just hit this myself, anyone find a work around ?
I cant change the settings of the repo as admin because the page just 404s and i get the error below in the logs.
Home: Cannot find any unit on this repository which you are allowed to access
@camlafit commented on GitHub (Jul 12, 2017):
Hi
Actual better solution (in my case) revert in 1.1.1 version. I don't try
with 1.1.2
At least allow admin account to go settings page to any repo/organization
should be interessting. So should be possible to correct manualy
@lunny commented on GitHub (Jul 13, 2017):
I have tested many times but didn't reproduce the issue. @camlafit could you show me some tables data on your database so that I can investigate the reason. On team table there is a column named
unit_types. If it's empty, you will get 404 on repository page.@camlafit commented on GitHub (Jul 13, 2017):
Hi
It's same list on unit_types to all row.
@lunny commented on GitHub (Jul 13, 2017):
@camlafit OK. The table is normal. Then could you find the
repo_unittable and executeSELECT * FROM repo_unit WHERE repo_id =?the ? should be the 404 repository's id.@camlafit commented on GitHub (Jul 17, 2017):
It's empty.
@lafriks commented on GitHub (Jul 17, 2017):
@camlafit are there any records in rep_unit table?
@camlafit commented on GitHub (Jul 17, 2017):
With repo without problem I get data.
MariaDB [gitea-webelys]> SELECT * FROM repo_unit WHERE repo_id=16;
@lafriks commented on GitHub (Jul 17, 2017):
than it looks like it is migration issue and unit types must be added to that repository
@camlafit commented on GitHub (Jul 17, 2017):
How ?
But if I understand your queries, if we have data in team.unit_types we must get also data in repo_unit ? Is not possible to check it and update database ?
At least a generic SQL workaround could be useful :)
@lunny commented on GitHub (Jul 18, 2017):
@lafriks @camlafit we could do two work, first is fix the bug, and second is add an reset button on admin panel to reset all repo's units. I will send a PR to do them.
@olymk2 commented on GitHub (Jul 18, 2017):
exactly the same for missing missing entries in the unit_types tables, is there a way to regenerate the correct entries ?
@lafriks commented on GitHub (Jul 18, 2017):
@lunny why reset all repo units? That would be very dangerous as it would lose repository settings on disabled (wiki/issues) etc
@camlafit commented on GitHub (Jul 18, 2017):
Hi
A reset GUI looks interestting :) In this case could be accessible repo by
repo from
admin/repospage. Repo settings page could be not accessible ifunits are missing.
This option could be useful in this case but also if user or admin miss its
configuration and lost access.
@rhaamo commented on GitHub (Jul 20, 2017):
Hi,
I've got the same issue (table repo_unit empty) from a migration from gogs.
I "manually" created the missing entries in the table with inserts like, for each repository.id :
With
1,1replaced by1,1to7,7.Should that be sufficient ?
@lunny commented on GitHub (Jul 20, 2017):
Yes, it's enough for working. @rhaamo
@camlafit commented on GitHub (Jul 20, 2017):
Hi
I've done on my server and looks ok. On 28 repo, were 6 without unit values.
@olymk2 commented on GitHub (Jul 20, 2017):
@rhaamo cheers, based on that i made a quicker version for anyone that wants it in the future.
tested on sqlite db only
this kicked all my repo's back into action \o/
@silverwind commented on GitHub (Aug 11, 2017):
I also got hit by this after updating a instance. The query in https://github.com/go-gitea/gitea/issues/1794#issuecomment-316824479 didn't work on MySQL, so I ran queries suggested in https://github.com/go-gitea/gitea/issues/1794#issuecomment-316613399, which fixed it.
@lunny commented on GitHub (Aug 11, 2017):
I think that's because you lost migration v16 https://github.com/go-gitea/gitea/blob/master/models/migrations/v16.go#L47.
@silverwind commented on GitHub (Aug 11, 2017):
I was upgrading from
1.1.0+135-gfcc7cdato1.1.0+474-gbe29d5f7, if that's of any help. The affected repos were definitely working before.@jhasse commented on GitHub (Nov 29, 2017):
@lafriks showed my on Discord how to fix this for MySQL (thanks again!):
@lafriks commented on GitHub (Dec 2, 2017):
For 1.3.0 this SQL helps:
But could be useful if someone could pinpoint what these repos have different than others to understand why migration for them fail
@lunny commented on GitHub (Jul 6, 2018):
Found this will happen when upgrade 1.1.3 to 1.2.x if he ever upgraded from Gogs. Maybe add this as an know issues and resolve solutions on docs.
@lunny commented on GitHub (Nov 28, 2018):
I will close this now and feel free to reopen it.