Fixed Deleting specific usergroup leads to timeout

SchmitzIT

Well-known member
Been trying to clean up my usergroups a little, but consistently ran into timeout errors with one of the usergroup, while another one worked fine. I ended up nuking the group in the database (and on the live site in vBloat, so the importer will not even find them next time), but figured it might be worthwhile reporting here anyway.

I click the red cross, then confirm I want to delete the group. It hangs a while, and then throws the following error:

Fatal error: Maximum execution time of 60 seconds exceeded in <path to xf installation>/library/XenForo/Model/Permission.php on line 1643

The name of the usergroup in question was Tracker Testers, so it's not as if it contained weird characters or anything.
 
Hi Brogan,

Yup. About 30 of them, I think. Not too sure about the other usergroups that did go through, though I guesstimate they contained less than 10 each.
 
Ah, fair enough.
I've just seen other reports with large numbers of members so wasn't sure if it was a similar issue.
 
30 should probably be ok, though obviously it's not working - the other people had thousands. :)
 
When deleting a mass of users in a usergroup means that the server doesn't really want to do that job because it's "too much work."

In other words, when the server is trying to reach an information that has a large file size, and it wants to delete it, that bulk of information is conflicting.

In an event of a time-out, it means the server can't reach that information. Especially if that information is conflicting with another.

In this case, it's the amount of members in the group interfering with the deletion of that group. xenForo devs need to figure out how the xf software is going to handle the deletion with information in that group (the users, permissions, etc.)
 
Try adding a line to the config.php:

ini_set('max_execution_time', 1000);

This should increase the maximum time queries will be allowed to execute.
 
I ended up delving into the tables, writing a bunch of queries and a PHP script to help clear up lots of usergroups that were not defined (brought over from the vB import). Now my usergroup ids are nice and clean.
 
Try adding a line to the config.php:

ini_set('max_execution_time', 1000);

This should increase the maximum time queries will be allowed to execute.
That did not help with a value of 10.000 :(

I ended up delving into the tables, writing a bunch of queries and a PHP script to help clear up lots of usergroups that were not defined (brought over from the vB import). Now my usergroup ids are nice and clean.
Do you remember anything of the tables where the usergroups are used?
 
There are a bunch of tables which had to be manipulated:
xf_user - contains a primary user_group_id column along with a varbinary array of secondary user groups, secondary_group_ids and a display group id column, display_style_group_id
xf_user_group - contains a list of valid group ids

Once these tables are cleaned up then rebuild the user cache which takes the data from xf_user and populates xf_user_group_relation. I had around 20 group ids that were not defined in XenForo and it was bugging me silly as the registered group was not set to group id 2 so users were not getting the right perms when logging in.
 
Mike advised not to do it by hand as it won't reset the permission tables with the removed groups.

Unless you took this into account...
 
That did not help with a value of 10.000 :(


Do you remember anything of the tables where the usergroups are used?
Could you give an idea roughly how many members are in the user group you are trying to delete?
(I have some decisions to make for my own forum)
 
Top Bottom