User in Organisation has no repo limit but the user itself has a limit of 0: Cannot create repo in organisation #7185

Closed
opened 2025-11-02 07:18:48 -06:00 by GiteaMirror · 26 comments
Owner

Originally created by @Commifreak on GitHub (Apr 16, 2021).

  • Gitea version (or commit ref): 1.14.1
  • Git version:
  • Operating system: Linux with your official docker image
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

I have created an organisation with a team which users have admin rights there. The organisation Repo-Limit ist 10000. When a user with a repo-limit of 0 (the user itself!) want to create a repo in this organisation, gitea show up an error, that his limit is exceeded.

Is this a wanted behaviour?

Screenshots

grafik

The user admin page:

grafik
grafik

The organisation admin page:

grafik

Originally created by @Commifreak on GitHub (Apr 16, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.1 - Git version: - Operating system: Linux with your official docker image <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> I have created an organisation with a team which users have admin rights there. The organisation Repo-Limit ist 10000. When a user with a repo-limit of 0 (the user itself!) want to create a repo in this organisation, gitea show up an error, that his limit is exceeded. Is this a wanted behaviour? ## Screenshots ![grafik](https://user-images.githubusercontent.com/87267/114976690-b25a4a00-9e86-11eb-8180-17f2da0df691.png) The user admin page: ![grafik](https://user-images.githubusercontent.com/87267/114976740-c69e4700-9e86-11eb-9c17-1443bc44c440.png) ![grafik](https://user-images.githubusercontent.com/87267/114976774-d61d9000-9e86-11eb-8500-45824dd28360.png) The organisation admin page: ![grafik](https://user-images.githubusercontent.com/87267/114976836-ee8daa80-9e86-11eb-86eb-212a6e430fea.png)
GiteaMirror added the type/enhancementtype/bug labels 2025-11-02 07:18:48 -06:00
Author
Owner

@Commifreak commented on GitHub (May 19, 2021):

Can anyone confirm this "issue"?

@Commifreak commented on GitHub (May 19, 2021): Can anyone confirm this "issue"?
Author
Owner

@a1012112796 commented on GitHub (May 19, 2021):

I see, It's a ui bug, should recheck limit when switch Owner

@a1012112796 commented on GitHub (May 19, 2021): I see, It's a ui bug, should recheck limit when switch ``Owner``
Author
Owner

@Commifreak commented on GitHub (May 19, 2021):

Thanks for that! Is that change a candidate for the next release or does it need an explicit test by me?

@Commifreak commented on GitHub (May 19, 2021): Thanks for that! Is that change a candidate for the next release or does it need an explicit test by me?
Author
Owner

@stale[bot] commented on GitHub (Jul 21, 2021):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 21, 2021): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@Commifreak commented on GitHub (Oct 18, 2021):

Whats the current state?

@Commifreak commented on GitHub (Oct 18, 2021): Whats the current state?
Author
Owner

@Commifreak commented on GitHub (Jan 27, 2022):

push

@Commifreak commented on GitHub (Jan 27, 2022): *push*
Author
Owner

@blackshot commented on GitHub (Jun 16, 2022):

i can confirm this bug running 1.16.8 docker image. actually i was looking for a fix.

why not adding this to 1.17.x milestone? this is a key feature to self hosted.

@blackshot commented on GitHub (Jun 16, 2022): i can confirm this bug running 1.16.8 docker image. actually i was looking for a fix. why not adding this to 1.17.x milestone? this is a key feature to self hosted.
Author
Owner

@lunny commented on GitHub (Jun 17, 2022):

OK. Maybe we need another limitation. We already have these limitations.

  • The number which user could create around the instance, not only under his name
  • The number for an organization could create under the organization
  • The number which a user could create organization

So I think we may need another one.

  • The number which user could create in all his organization. That means we should change the meaning of the first limitation as the number which user could create under his name.
@lunny commented on GitHub (Jun 17, 2022): OK. Maybe we need another limitation. We already have these limitations. - [x] The number which user could create around the instance, not only under his name - [x] The number for an organization could create under the organization - [x] The number which a user could create organization So I think we may need another one. - [ ] `The number which user could create in all his organization`. That means we should change the meaning of the first limitation as the number which user could create under his name.
Author
Owner

@blackshot commented on GitHub (Jun 17, 2022):

OK. Maybe we need another limitation. We already have these limitations.

  • The number which user could create around the instance, not only under his name
  • The number for an organization could create under the organization
  • The number which a user could create organization

So I think we may need another one.

  • The number which user could create in all his organization. That means we should change the meaning of the first limitation as the number which user could create under his name.

I think it is easier to tackle this problem just defining MAX_USER_REPOS and MAX_ORG_REPOS. So if any user is creating a repo for himself validate MAX_USER_REPOS and if the user is creating a repo for some organization just validate MAX_ORG_REPOS

@blackshot commented on GitHub (Jun 17, 2022): > OK. Maybe we need another limitation. We already have these limitations. > > * [x] The number which user could create around the instance, not only under his name > * [x] The number for an organization could create under the organization > * [x] The number which a user could create organization > > So I think we may need another one. > > * [ ] `The number which user could create in all his organization`. That means we should change the meaning of the first limitation as the number which user could create under his name. I think it is easier to tackle this problem just defining MAX_USER_REPOS and MAX_ORG_REPOS. So if any user is creating a repo for himself validate MAX_USER_REPOS and if the user is creating a repo for some organization just validate MAX_ORG_REPOS
Author
Owner

@gilbertoca commented on GitHub (Sep 26, 2022):

I confirm this bug, running 1.16.9.
In my case, organization has -1 limit and user 20 limit. And the msg is always: You have already reached your limit of 2 repositories.
I've instructed the user to create the repo in your own profile and then transfer it to the organization.

@gilbertoca commented on GitHub (Sep 26, 2022): I confirm this bug, running 1.16.9. In my case, organization has -1 limit and user 20 limit. And the msg is always: You have already reached your limit of 2 repositories. I've instructed the user to create the repo in your own profile and then transfer it to the organization.
Author
Owner

@Commifreak commented on GitHub (Nov 10, 2022):

Anything new on that? I'd really see that fixed :/

@Commifreak commented on GitHub (Nov 10, 2022): Anything new on that? I'd really see that fixed :/
Author
Owner

@lunny commented on GitHub (Nov 10, 2022):

-1 means derive from global configuration which is in your instance app.ini. -1 doesn't mean no limitation.

@lunny commented on GitHub (Nov 10, 2022): **`-1` means derive from global configuration which is in your instance `app.ini`. `-1` doesn't mean no limitation.**
Author
Owner

@gilbertoca commented on GitHub (Nov 10, 2022):

-1 means derive from global configuration which is in your instance app.ini. -1 doesn't mean no limitation.

My setup:

[repository]
MAX_CREATION_LIMIT = 2
ROOT               = /opt/gitea/repositories

I've been using gitea since gitea-1.13.2, and MAX_CREATION_LIMIT have never effect to me - every new user I have to change the limit through the GUI.

@gilbertoca commented on GitHub (Nov 10, 2022): > `-1` means derive from global configuration which is in your instance `app.ini`. `-1` doesn't mean no limitation. My setup: ``` [repository] MAX_CREATION_LIMIT = 2 ROOT = /opt/gitea/repositories ``` I've been using gitea since gitea-1.13.2, and MAX_CREATION_LIMIT have never effect to me - every new user I have to change the limit through the GUI.
Author
Owner

@lunny commented on GitHub (Nov 11, 2022):

-1 means derive from global configuration which is in your instance app.ini. -1 doesn't mean no limitation.

My setup:

[repository]
MAX_CREATION_LIMIT = 2
ROOT               = /opt/gitea/repositories

I've been using gitea since gitea-1.13.2, and MAX_CREATION_LIMIT have never effect to me - every new user I have to change the limit through the GUI.

It explains your problem. I don't think the definitions about -1 have been changed but maybe there are bugs in previous versions.

@lunny commented on GitHub (Nov 11, 2022): > > `-1` means derive from global configuration which is in your instance `app.ini`. `-1` doesn't mean no limitation. > > My setup: > > ``` > [repository] > MAX_CREATION_LIMIT = 2 > ROOT = /opt/gitea/repositories > ``` > > I've been using gitea since gitea-1.13.2, and MAX_CREATION_LIMIT have never effect to me - every new user I have to change the limit through the GUI. It explains your problem. I don't think the definitions about `-1` have been changed but maybe there are bugs in previous versions.
Author
Owner

@Commifreak commented on GitHub (Nov 11, 2022):

@lunny Can you please bring up a new status of that issue? It dont see any connection between the config variables and the mentioned UI problem or did I missed something?

MAX_CREATION_LIMIT = 0 is still active and the limit for the org is higher, but users are still not able to create some repos.

@Commifreak commented on GitHub (Nov 11, 2022): @lunny Can you please bring up a new status of that issue? It dont see any connection between the config variables and the mentioned UI problem or did I missed something? `MAX_CREATION_LIMIT = 0` is still active and the limit for the org is higher, but users are still not able to create some repos.
Author
Owner

@gilbertoca commented on GitHub (Nov 11, 2022):

-1 means derive from global configuration which is in your instance app.ini. -1 doesn't mean no limitation.

@Commifreak and @lunny it always meant no limit

image

@gilbertoca commented on GitHub (Nov 11, 2022): > **`-1` means derive from global configuration which is in your instance `app.ini`. `-1` doesn't mean no limitation.** @Commifreak and @lunny it always **meant no limit** ![image](https://user-images.githubusercontent.com/3083703/201338917-1e4af9bc-616d-439d-9e50-8aac30d94d16.png)
Author
Owner

@Commifreak commented on GitHub (Nov 11, 2022):

I dont use -1 at all!

@Commifreak commented on GitHub (Nov 11, 2022): I dont use -1 at all!
Author
Owner

@lunny commented on GitHub (Nov 11, 2022):

-1 means derive from global configuration which is in your instance app.ini. -1 doesn't mean no limitation.

@Commifreak and @lunny it always meant no limit

image

Ah, yes. They made some confusions. The configuration item MAX_CREATION_LIMIT = -1 means globally no limitation. But the value -1 in the UI of org or user setting in admin means deriving from global configuration. The two -1 have different concepts.

@lunny commented on GitHub (Nov 11, 2022): > > **`-1` means derive from global configuration which is in your instance `app.ini`. `-1` doesn't mean no limitation.** > > @Commifreak and @lunny it always **meant no limit** > > ![image](https://user-images.githubusercontent.com/3083703/201338917-1e4af9bc-616d-439d-9e50-8aac30d94d16.png) Ah, yes. They made some confusions. The configuration item `MAX_CREATION_LIMIT = -1` means globally no limitation. But the value `-1` in the UI of org or user setting in admin means deriving from global configuration. The two `-1` have different concepts.
Author
Owner

@gilbertoca commented on GitHub (Nov 11, 2022):

@Commifreak and @lunny
Other confusion, that's what we have here, is that in GUI we have Maximum Number of Repositories for both user and org and MAX_CREATION_LIMIT.
One is the quantity you can HAVE e the other is the CREATION limit each one has. Or am I misunderstanding that?

@gilbertoca commented on GitHub (Nov 11, 2022): @Commifreak and @lunny Other confusion, that's what we have here, is that in GUI we have **Maximum Number of Repositories** for both user and org and MAX_CREATION_LIMIT. One is the quantity you can **HAVE** e the other is the **CREATION** limit each one has. Or am I misunderstanding that?
Author
Owner

@virtualdreams commented on GitHub (Feb 28, 2023):

Same problem.
User = 0,
Organization = -1

User cannot create a repository for the organization.

But the above worked in gogs without problems.

@virtualdreams commented on GitHub (Feb 28, 2023): Same problem. User = 0, Organization = -1 User cannot create a repository for the organization. But the above worked in gogs without problems.
Author
Owner

@wxiaoguang commented on GitHub (Mar 29, 2023):

Is it clearly resolved?

@wxiaoguang commented on GitHub (Mar 29, 2023): Is it clearly resolved?
Author
Owner

@lunny commented on GitHub (Mar 29, 2023):

Closed by accident.

@lunny commented on GitHub (Mar 29, 2023): Closed by accident.
Author
Owner

@Commifreak commented on GitHub (May 11, 2023):

Anything new?

Gitea 1.19.3, org limit 1000, user limit -1 (0): User cannot create repo in its org.

@gilbertoca So, you say both are different features? If that is true, it would be rather a feature request: Let org users create repos in it, even if the user have a repo limit (for personal repos).

Why?

We have public gitea instance with a public and private org. Users dont have rights to create OWN repos but they should create repos in the private org.

@Commifreak commented on GitHub (May 11, 2023): Anything new? Gitea 1.19.3, org limit 1000, user limit -1 (0): User cannot create repo in its org. @gilbertoca So, you say both are different features? If that is true, it would be rather a feature request: Let org users create repos in it, even if the user have a repo limit (for personal repos). Why? We have public gitea instance with a public and private org. Users dont have rights to create OWN repos but they should create repos in the private org.
Author
Owner

@gilbertoca commented on GitHub (May 11, 2023):

@Commifreak and @lunny,

@gilbertoca So, you say both are different features?

I see different things here:
1 - can create repo (org or private) < MAX_CREATION_LIMIT;
2 - can have Maximum Number of Repositories - create by me or transferred to me.

But I may have misunderstood the meaning.

@gilbertoca commented on GitHub (May 11, 2023): @Commifreak and @lunny, > @gilbertoca So, you say both are different features? I see different things here: 1 - can create repo (org or private) < MAX_CREATION_LIMIT; 2 - can have **Maximum Number of Repositories** - create by me or transferred to me. But I may have misunderstood the meaning.
Author
Owner

@Fratee commented on GitHub (Dec 3, 2024):

Any update on this issue?

@Fratee commented on GitHub (Dec 3, 2024): Any update on this issue?
Author
Owner

@TheFox0x7 commented on GitHub (Mar 26, 2025):

Do we need to precheck the user limit on that page in the first place? If user attempts to create a repository after reaching the limit it displays the message anyway so maybe we can just remove the precheck?

@TheFox0x7 commented on GitHub (Mar 26, 2025): Do we need to precheck the user limit on that page in the first place? If user attempts to create a repository after reaching the limit it displays the message anyway so maybe we can just remove the precheck?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7185