-
-
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
Error while displaying public repo (404) #1794
Comments
So what's permission should a member of an organization who are not in any team have? |
I had this bug too after I updated my server yesterday. |
@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 |
@DblK, in fact, we need a document to describe all the permission settings we like Gitea do. |
Hi In my case if an user is only organization collaborators and in any orgnization team , i can't see any organization repo. 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) |
Which version did you use? I think b0308d8 has fixed that. |
I've just tried with master, 5min ago On 1.1.1 it's ok |
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? |
If an user is set as collaborator or as member to any team (owner or not), he should be show repositories. |
Please confirm #1812 fix this issue. |
I think #1812 resolved this and please feel free to reopen it. |
Hi sorry :/
Use is admin and owner organization, it can't access or change settings on repository. 404 display |
Please give more details. |
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. |
@camlafit could you tell me the example? |
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) 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. |
It seems to be a migration issue with the newer finer repository permission settings. |
@camlafit Is this repo a private or a public? Is this repo on one organization? |
It's in an organization and it's private |
Then if all the people is on a team? and is this team have read or write permission to the repo? |
the two accounts are set in team owner , first is an admin account, other standard. In this 3 cases, they get a 404 after update |
I've tried master version two day ago : 5db8cf3 then these commits should be present. |
It's a from scratch gitea installation, gitosis import with api.
|
@lunny why reset all repo units? That would be very dangerous as it would lose repository settings on disabled (wiki/issues) etc |
Hi
A reset GUI looks interestting :) In this case could be accessible repo by
repo from `admin/repos` page. Repo settings page could be not accessible if
units are missing.
This option could be useful in this case but also if user or admin miss its
configuration and lost access.
|
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 Should that be sufficient ? |
Yes, it's enough for working. @rhaamo |
Hi I've done on my server and looks ok. On 28 repo, were 6 without unit values. |
@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/ |
I also got hit by this after updating a instance. The query in #1794 (comment) didn't work on MySQL, so I ran queries suggested in #1794 (comment), which fixed it. |
I think that's because you lost migration v16 https://github.com/go-gitea/gitea/blob/master/models/migrations/v16.go#L47. |
I was upgrading from |
@lafriks showed my on Discord how to fix this for MySQL (thanks again!): insert into repo_unit (`repo_id`, `type`, `index`, `config`)
select repository.id, types.*, '{}' from repository
left join repo_unit on repository.id=repo_id
left join (
select 1 as col1, 1 as col2
UNION ALL select 2,2
UNION ALL select 3,3
UNION ALL select 4,4
UNION ALL select 5,5) as types on (1=1)
where repo_id is null; |
For 1.3.0 this SQL helps: insert into repo_unit ("repo_id", "type", "config") select repository.id, types.*, '{}' from repository left join repo_unit on repository.id=repo_id left join ( select 1 UNION ALL select 2 UNION ALL select 3 UNION ALL select 4 UNION ALL select 5) as types on (1=1) where repo_id is null; But could be useful if someone could pinpoint what these repos have different than others to understand why migration for them fail |
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. |
I will close this now and feel free to reopen it. |
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: 977dcf9
The text was updated successfully, but these errors were encountered: