Deleted user is being used in branch protection whitelisting #8705

Closed
opened 2025-11-02 08:15:03 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @plsnp on GitHub (Mar 15, 2022).

Originally assigned to: @noerw on GitHub.

Gitea Version

1.14.6 built with go1.16.7

Git Version

2.34.1

Operating System

SUSE Linux Enterprise Server 15 SP3

How are you running Gitea?

sudo zypper addrepo https://download.opensuse.org/repositories/devel:tools:scm/openSUSE_Leap_15.3/devel:tools:scm.repo
sudo zypper refresh
sudo zypper install gitea
sudo systemctl enable gitea --now

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://bpa.st/UZYA

Description

  1. some users were created
  2. some branches were protected, but some users whitelisted (user 1 and 2)
  3. ldap was activated, but conflicted with existing user. user 1 was deleted through GUI (later re-added over ldap as user 13)
  4. whitelist shows only user 2
  5. trying to add user 3 to whitelist
  6. 500 internal server error.
  7. LOG: 2022/03/15 14:49:15 ..._protected_branch.go:266:SettingsProtectedBranchPost() [E] UpdateProtectBranch: GetUserByID [user_id: 1, repo_id: 3]: user does not exist [uid: 1, name: , keyid: 0]
  8. in html it shows that user 1 and 2 were send to html in value field
  9. downloaded gitea sqlite database, table protected_branch, column whitelist_user_i_ds shows user 1 active on some branches

Possible cause: when deleted user, user is not removed from whitelisted branches

I searched for bug but couldn't find. Sorry if this has already been fixed in the meanwhile, i can't try the latest version at the moment.

Screenshots

No response

Originally created by @plsnp on GitHub (Mar 15, 2022). Originally assigned to: @noerw on GitHub. ### Gitea Version 1.14.6 built with go1.16.7 ### Git Version 2.34.1 ### Operating System SUSE Linux Enterprise Server 15 SP3 ### How are you running Gitea? ```shell sudo zypper addrepo https://download.opensuse.org/repositories/devel:tools:scm/openSUSE_Leap_15.3/devel:tools:scm.repo sudo zypper refresh sudo zypper install gitea sudo systemctl enable gitea --now ``` ### Database SQLite ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://bpa.st/UZYA ### Description 1. some users were created 2. some branches were protected, but some users whitelisted (user 1 and 2) 3. ldap was activated, but conflicted with existing user. user 1 was deleted through GUI (later re-added over ldap as user 13) 4. whitelist shows only user 2 5. trying to add user 3 to whitelist 6. 500 internal server error. 7. LOG: 2022/03/15 14:49:15 ..._protected_branch.go:266:SettingsProtectedBranchPost() [E] UpdateProtectBranch: GetUserByID [user_id: 1, repo_id: 3]: user does not exist [uid: 1, name: , keyid: 0] 8. in html it shows that user 1 and 2 were send to html in value field 9. downloaded gitea sqlite database, table protected_branch, column whitelist_user_i_ds shows user 1 active on some branches Possible cause: when deleted user, user is not removed from whitelisted branches I searched for bug but couldn't find. Sorry if this has already been fixed in the meanwhile, i can't try the latest version at the moment. ### Screenshots _No response_
GiteaMirror added the type/bug label 2025-11-02 08:15:03 -06:00
Author
Owner

@lunny commented on GitHub (Mar 16, 2022):

Could you upgrade to v1.16.4 and try it again?

@lunny commented on GitHub (Mar 16, 2022): Could you upgrade to v1.16.4 and try it again?
Author
Owner

@noerw commented on GitHub (Mar 21, 2022):

Can confirm with 1.17.0+dev-309-gb05b40180

@noerw commented on GitHub (Mar 21, 2022): Can confirm with `1.17.0+dev-309-gb05b40180`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8705