Auto cleanup of inactive users is not working

Hello,

we have a lot of inactive users who should be removed now. I’ve checked the logs but nothing suspicious showed up.

We’re on v2.4.3, setting on default 730 days.

How can I fix this problem or at least manually start the cleanup job?

Thanks a lot!

1 Like

Hello @netpositive

Are the requirements met for those inactive users?

They need to be trust level 0 and have no posts in the last 730 days.

We’re having a similar problem, but it’s due to having inactive users who are in Trust Level 1.

4 Likes

Yep, we have users who meet both requirements and their accounts still exist.

2 Likes

Can we repro this here on meta @tshenry ?

2 Likes

It looks like we had an inactive user deleted 11 hours ago based on Meta’s Staff Action Logs (Sidekiq is also showing that was when the clean up job was last run), so that’s looking good to me:


@netpositive I don’t see any recent commits that are specific to this feature, but it certainly wouldn’t hurt to update your site. If that’s not possible, you could try manually triggering the job. It should be Jobs::CleanUpInactiveUsers which you can find at /sidekiq/scheduler

Please keep us posted on how things go.

5 Likes

@tshenry Thank You for the useful hints! It looks like the cleanup job deleted some inactive users yesterday morning so it definitely works :relieved: The problem is somewhere on our part. Is there a tool for easier user management I’m not aware of?

@GI-Joe Yeah, I wish it was working for higher levels too :thinking:

3 Likes

Possibly. The rails console is a very powerful tool that you can use, but it’s not for the faint of heart. If you haven’t ever used it and want to start, I would recommend setting up a testing site where you can experiment and get to know how it works. The inactive users job is defined here. You could grab/modify what you need from that.

Just noting that the only other trust level it could apply to is TL1 since TL2 has a “Replied to at least 3 different topics” requirement.

3 Likes

Hello,

We changed the setting from 730 to 365 yesterday. All users that were deleted yesterday had logged in at least once.

Please consider this example from the user logs:

created_at last_seen_at last_posted_at last_emailed_at trust_level
2020-05-08 14:44:07 UTC 2020-05-21 10:50:59 UTC 0

(they were created once and emailed once; all their other stats zero).

We are on 2.8.0.beta10.