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

Error when removing user #3953

Closed
Kaik opened this issue Jan 18, 2019 · 6 comments
Closed

Error when removing user #3953

Kaik opened this issue Jan 18, 2019 · 6 comments
Labels
Milestone

Comments

@Kaik
Copy link
Contributor

Kaik commented Jan 18, 2019

Q A
Zikula Version 2.0.11
PHP Version 7.x

Expected behavior

No error

Actual behavior

Error 503 serivice not available

Steps to reproduce

Production server - plesk + cent os php 7.2.13 apache
Go to users admin remove pending registration confirm - error 503

Logs were saying something regarding iterating over the sessions... and allowed memory exhausted...
Funny thing on local dev installation where everything is the same there is no error - it takes time to do remove it tho...

I will investigate this error furthermore.... at the moment my best type is that sessions is somehow involved during user delete and since on production I do have more sessions than locally it fails...

@Kaik
Copy link
Contributor Author

Kaik commented Jan 23, 2019

Ok looks like the problem starts here https://github.com/zikula/core/blob/master/src/system/UsersModule/Controller/UserAdministrationController.php#L273
It is trying to fetch 40k users as choices and it fails... additionally this whole thing looks like created for some sort of user search...
I was able to delete user without, a problem with these changes

            if ($user) {
                $choices = [$user];
            } else {
                // warning!!! this loads all the users from db 
                $choices = $this->get('zikula_users_module.user_repository')->queryBySearchForm();
            }
            $deleteForm = $this->createForm(DeleteType::class, [], [
                'choices' => $choices,
                'action' => $this->generateUrl('zikulausersmodule_useradministration_delete'),
                'translator' => $this->get('translator.default')
            ]);

@Guite
Copy link
Member

Guite commented Jan 31, 2020

note: when working on this see also #4071

@craigh
Copy link
Member

craigh commented Mar 9, 2020

I am unable to replicate this behavior.
I created a user, logged in as that user, logged out. logged in as admin, then deleted that user with no trouble.

@Kaik
Copy link
Contributor Author

Kaik commented Mar 10, 2020

@craigh how big is your users table? Because it is related. Please can you check it with considerably large (10k+) users table - size depends on your dev hardware too, but 10k should choke it anyway.

@craigh
Copy link
Member

craigh commented Mar 10, 2020

my user table has 3 users. my dev machine is 1 computer. an iMac.

I can't test things I don't have with computers I don't own.

feel free to test the current master and let me know what you find.

@craigh
Copy link
Member

craigh commented Mar 25, 2020

@Kaik I tested this fix with >20K users in my DB. I did experience the error you described before fixing it. Since this fix eliminates the 'reloading' of all the entities (which you pointed out as the problem), I'm quite sure it solves the problem.

craigh added a commit that referenced this issue Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants