After upgrade, can't create repo in existing org #11448

Closed
opened 2025-11-02 09:37:58 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @muellert on GitHub (Aug 13, 2023).

Description

I have recently upgraded gitea to 1.20.2, and since then, I can't create a repo in an existing org, but immediately get a 403. The log doesn't reveal any details, even though I configured the log level to be "trace". I can create a new org and then a repo inside it, and I can create a repo inside my user folder, but not in any other org, despite my having created them all.

This is how it looks like in the logs at loglevel Trace:

2023/08/13 23:06:21 ...s/process/manager.go:188:Add() [T] Start 64d945cd-2: GET: /repo/create?org=4 (request)
2023/08/13 23:06:21 ...eb/routing/logger.go:47:func1() [T] router: started   GET /repo/create?org=4 for 4.3.2.1:0
2023/08/13 23:06:21 ...ices/auth/session.go:51:SessionUser() [T] Session Authorization: Found user[2]
2023/08/13 23:06:21 ...ices/auth/session.go:67:SessionUser() [T] Session Authorization: Logged in user <User 2:username>    
2023/08/13 23:06:21 ...eb/routing/logger.go:102:func1() [I] router: completed GET /repo/create?org=4 for 4.3.2.1:0, 403 Forbidden in 5.1ms @ repo/repo.go:149(repo.Create)
2023/08/13 23:06:21 ...s/process/manager.go:231:remove() [T] Done 64d945cd-2: GET: /repo/create?org=4

Setting RUN_MODE=dev did not have any effect, btw.

Gitea Version

1.20.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

2023-08-13-gitea-error-message

Git Version

2.30.2

Operating System

Debian 11.7 (amd64)

How are you running Gitea?

I am running a binary that I have downloaded from dl.gitea.io and installed via my Ansible role (on.gitea).

Database

PostgreSQL

Originally created by @muellert on GitHub (Aug 13, 2023). ### Description I have recently upgraded gitea to 1.20.2, and since then, I can't create a repo in an existing org, but immediately get a 403. The log doesn't reveal any details, even though I configured the log level to be "trace". I can create a new org and then a repo inside it, and I can create a repo inside my user folder, but not in any other org, despite my having created them all. This is how it looks like in the logs at loglevel Trace: 2023/08/13 23:06:21 ...s/process/manager.go:188:Add() [T] Start 64d945cd-2: GET: /repo/create?org=4 (request) 2023/08/13 23:06:21 ...eb/routing/logger.go:47:func1() [T] router: started GET /repo/create?org=4 for 4.3.2.1:0 2023/08/13 23:06:21 ...ices/auth/session.go:51:SessionUser() [T] Session Authorization: Found user[2] 2023/08/13 23:06:21 ...ices/auth/session.go:67:SessionUser() [T] Session Authorization: Logged in user <User 2:username> 2023/08/13 23:06:21 ...eb/routing/logger.go:102:func1() [I] router: completed GET /repo/create?org=4 for 4.3.2.1:0, 403 Forbidden in 5.1ms @ repo/repo.go:149(repo.Create) 2023/08/13 23:06:21 ...s/process/manager.go:231:remove() [T] Done 64d945cd-2: GET: /repo/create?org=4 Setting RUN_MODE=dev did not have any effect, btw. ### Gitea Version 1.20.2 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![2023-08-13-gitea-error-message](https://github.com/go-gitea/gitea/assets/1183079/8feb8370-abb2-4705-85ee-502684eecddd) ### Git Version 2.30.2 ### Operating System Debian 11.7 (amd64) ### How are you running Gitea? I am running a binary that I have downloaded from dl.gitea.io and installed via my Ansible role (on.gitea). ### Database PostgreSQL
GiteaMirror added the type/bugissue/needs-feedback labels 2025-11-02 09:37:58 -06:00
Author
Owner

@techknowlogick commented on GitHub (Aug 14, 2023):

Which version did you upgrade from? And to confirm, you can't create a repo in an existing org, but does your specifying "existing" mean that you can create a repo in a newly created org?

@techknowlogick commented on GitHub (Aug 14, 2023): Which version did you upgrade from? And to confirm, you can't create a repo in an existing org, but does your specifying "existing" mean that you can create a repo in a newly created org?
Author
Owner

@muellert commented on GitHub (Aug 14, 2023):

I upgraded from 1.19.3 to 1.20.2. I can't create a repo in most orgs that existed when I was running 1.19.3, but I can create an org and then create a repo inside the new org. I also can create a repo under my username, which exists since I installed gitea the first time years ago.

@muellert commented on GitHub (Aug 14, 2023): I upgraded from 1.19.3 to 1.20.2. I can't create a repo in most orgs that existed when I was running 1.19.3, but I can create an org and then create a repo inside the new org. I also can create a repo under my username, which exists since I installed gitea the first time years ago.
Author
Owner

@lunny commented on GitHub (Aug 15, 2023):

Please check your file system's permission. If you are running Gitea as git, ensure all directories/files' owner is git.

@lunny commented on GitHub (Aug 15, 2023): Please check your file system's permission. If you are running Gitea as git, ensure all directories/files' owner is git.
Author
Owner

@muellert commented on GitHub (Aug 16, 2023):

Hi lunny, of course, I have checked that already. The newly created org and repo had the same ownerships, only the permissions were a bit more restrictive than some of the old repos (not all). Ie, the new org and repo had 0700, while some of the old repos and orgs have 0750 or even 0755.

@muellert commented on GitHub (Aug 16, 2023): Hi lunny, of course, I have checked that already. The newly created org and repo had the same ownerships, only the permissions were a bit more restrictive than some of the old repos (not all). Ie, the new org and repo had 0700, while some of the old repos and orgs have 0750 or even 0755.
Author
Owner

@muellert commented on GitHub (Aug 20, 2023):

I just upgraded to 1.20.3, and the problem persists.

@muellert commented on GitHub (Aug 20, 2023): I just upgraded to 1.20.3, and the problem persists.
Author
Owner

@muellert commented on GitHub (Sep 1, 2023):

Hi, why is there still a tag "needs feedback"? What else do you need, please? Is there maybe a way to up the log level enough to actually see what's going wrong? Because so far, I didn't find anything.

@muellert commented on GitHub (Sep 1, 2023): Hi, why is there still a tag "needs feedback"? What else do you need, please? Is there maybe a way to up the log level enough to actually see what's going wrong? Because so far, I didn't find anything.
Author
Owner

@CaiCandong commented on GitHub (Sep 2, 2023):

Do you have a way for me to reproduce this issue? I checked the code, and it's possible to throw a 403 here. Maybe you should confirm if you have permission to create the repository.

f6e7798405/routers/web/repo/repo.go (L116-L126)

@CaiCandong commented on GitHub (Sep 2, 2023): Do you have a way for me to reproduce this issue? I checked the code, and it's possible to throw a 403 here. Maybe you should confirm if you have permission to create the repository. https://github.com/go-gitea/gitea/blob/f6e7798405ef9eb7b2936b112fd2a4ea1bab4082/routers/web/repo/repo.go#L116-L126
Author
Owner

@eeyrjmr commented on GitHub (Sep 2, 2023):

Is this a duplicate of this bug?
https://github.com/go-gitea/gitea/issues/18273

@eeyrjmr commented on GitHub (Sep 2, 2023): Is this a duplicate of this bug? https://github.com/go-gitea/gitea/issues/18273
Author
Owner

@muellert commented on GitHub (Sep 2, 2023):

Is this a duplicate of this bug? #18273

I don't think so - I am the owner of the entire gitea instance and almost everything in it, and I can create new orgs and repos inside those new orgs. I just can't create repos inside old orgs which I have created before the upgrade, despite being an owner of that org.

@muellert commented on GitHub (Sep 2, 2023): > Is this a duplicate of this bug? #18273 I don't think so - I am the owner of the entire gitea instance and almost everything in it, and I can create new orgs and repos inside those new orgs. I just can't create repos inside old orgs which I have created before the upgrade, despite being an owner of that org.
Author
Owner

@muellert commented on GitHub (Sep 2, 2023):

Do you have a way for me to reproduce this issue? I checked the code, and it's possible to throw a 403 here. Maybe you should confirm if you have permission to create the repository.

f6e7798405/routers/web/repo/repo.go (L116-L126)

I haven't tried this, yet, but one could set up a new gitea instance with an old version, create an org, create a repo inside the org, then upgrade and see whether you can create another repo inside that org. If that works, then my data should be somehow corrupted. If not, then you are seeing the same, or a similar, problem like I do.

@muellert commented on GitHub (Sep 2, 2023): > Do you have a way for me to reproduce this issue? I checked the code, and it's possible to throw a 403 here. Maybe you should confirm if you have permission to create the repository. > > https://github.com/go-gitea/gitea/blob/f6e7798405ef9eb7b2936b112fd2a4ea1bab4082/routers/web/repo/repo.go#L116-L126 I haven't tried this, yet, but one could set up a new gitea instance with an old version, create an org, create a repo inside the org, then upgrade and see whether you can create another repo inside that org. If that works, then my data should be somehow corrupted. If not, then you are seeing the same, or a similar, problem like I do.
Author
Owner

@eeyrjmr commented on GitHub (Sep 2, 2023):

Is this a duplicate of this bug? #18273

I don't think so - I am the owner of the entire gitea instance and almost everything in it, and I can create new orgs and repos inside those new orgs. I just can't create repos inside old orgs which I have created before the upgrade, despite being an owner of that org.

Sorry, wrong issue. Its this one: https://github.com/go-gitea/gitea/issues/20643

Could you try the recommended workaround.

Once you updated 1.17.1, edit the team information then this team's permission should be recovered.

@eeyrjmr commented on GitHub (Sep 2, 2023): > > Is this a duplicate of this bug? #18273 > > I don't think so - I am the owner of the entire gitea instance and almost everything in it, and I can create new orgs and repos inside those new orgs. I just can't create repos inside old orgs which I have created before the upgrade, despite being an owner of that org. Sorry, wrong issue. Its this one: https://github.com/go-gitea/gitea/issues/20643 Could you try the recommended workaround. > Once you updated 1.17.1, edit the team information then this team's permission should be recovered.
Author
Owner

@muellert commented on GitHub (Sep 3, 2023):

Clicking the "Update Settings" button did nothing for me, but updating the table in the database by hand worked. Thank you!

It would be great if it would "just work", though, and I have no idea how I had arrived in a situation where I could not create repos in orgs I own.

@muellert commented on GitHub (Sep 3, 2023): Clicking the "Update Settings" button did nothing for me, but updating the table in the database by hand worked. Thank you! It would be great if it would "just work", though, and I have no idea how I had arrived in a situation where I could not create repos in orgs I own.
Author
Owner

@wxiaoguang commented on GitHub (Sep 4, 2023):

It should be this bug (and workaround)

There is a fix (a doctor sub fix):

  • #26683
  • The fix has been backported to 1.20.4 (1.20 nightly)
@wxiaoguang commented on GitHub (Sep 4, 2023): It should be this bug (and workaround) * https://github.com/go-gitea/gitea/issues/26491#issuecomment-1678325433 There is a fix (a `doctor` sub fix): * #26683 * The fix has been backported to 1.20.4 (1.20 nightly)
Author
Owner

@wxiaoguang commented on GitHub (Sep 22, 2023):

1.20.4 has been released, you could use the doctor command to fix the legacy data. Or just use the workaround.

@wxiaoguang commented on GitHub (Sep 22, 2023): 1.20.4 has been released, you could use the doctor command to fix the legacy data. Or just use the workaround.
Author
Owner

@muellert commented on GitHub (Sep 23, 2023):

Hi, I have used the workaround almost immediately after I discovered it. But thank you for fixing this, anyway!

@muellert commented on GitHub (Sep 23, 2023): Hi, I have used the workaround almost immediately after I discovered it. But thank you for fixing this, anyway!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11448