Skip to content
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

Unable to delete all unactivated accounts #31480

Closed
ggodlewski opened this issue Jun 24, 2024 · 7 comments · Fixed by #32540
Closed

Unable to delete all unactivated accounts #31480

ggodlewski opened this issue Jun 24, 2024 · 7 comments · Fixed by #32540
Labels

Comments

@ggodlewski
Copy link

ggodlewski commented Jun 24, 2024

Description

I'm trying to get rid of spam users (over 800 of them)
I changed them to inactive following instructions from https://blog.roberthallam.org/2022/11/mass-delete-remove-purge-users-in-gitea/
Because I'm using sqlite3 it was: UPDATE user SET is_active = 'f' WHERE email != 'my@email';
In the UI all the users except mine are marked inactive.

Then I run Delete all unactivated accounts
It says Started Task: Delete all unactivated accounts using greenish text.

Nothing happens. I still have over 800 accounts.

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/ggodlewski/c17fb25618c3fac0539ae6891da66b6f

Screenshots

image
image

Git Version

2.45.1

Operating System

docker @ ubuntu

How are you running Gitea?

docker container: gitea/gitea:latest

Database

SQLite

@kemzeb
Copy link
Contributor

kemzeb commented Jun 24, 2024

Are these accounts new?

If this is the case, what I believe is happening currently is that when you run this task, we would only delete accounts that are older than some amount of time. Looking at this particular task in the code, we would only delete inactive users that are older than 3 hours by default (this would be different if you explicity set ACTIVE_CODE_LIVE_MINUTES in your config).

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 25, 2024

Not all inactive accounts could be deleted automatically, there are more checks in DeleteInactiveUsers

@ggodlewski
Copy link
Author

I set ACTIVE_CODE_LIVE_MINUTES to 180 (was empty). Still nothing.

Inactive account from Dec 13, 2023 not deleted.
User doesn't have repos/orgs/packages
https://github.com/go-gitea/gitea/blob/main/services/user/user.go#L291C1-L291C6

The only thing I can think of is that I'm getting this green confirmation but the tasks is not executed.
How are those tasks executed?

@Clortox
Copy link

Clortox commented Oct 16, 2024

I'm experiencing this problem as well with gitea 1.22.3. The newest account was made 7 days ago. Did you have any luck finding a workaround?

@ggodlewski
Copy link
Author

I don't remember it. Since I didn't close this issue I think I've removed them manually from database using the condition from the code.

@lunny
Copy link
Member

lunny commented Oct 22, 2024

I created #32318 to log the error reason.

lunny added a commit that referenced this issue Oct 23, 2024
lunny added a commit to lunny/gitea that referenced this issue Oct 23, 2024
lunny added a commit that referenced this issue Oct 23, 2024
@JcDenis
Copy link

JcDenis commented Nov 16, 2024

Same problem here.
Task failed because it was trying to delete organization.
Response from log here is:
Task: Delete all unactivated accounts canceled: xyz is an organization not a user

[edit]
After moving organizations repositories to a user and deleted organizations, task deletes more users but not all. and no error nor log.

lunny added a commit that referenced this issue Nov 21, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Nov 21, 2024
lunny added a commit that referenced this issue Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants