RE: Broken user groups

Jan Heiderich, modified 5 Years ago. New Member Posts: 7 Join Date: 2/20/20 Recent Posts
Hello Liferay Devs,

We currently have the problem that sometimes Usergroups seem to not be created correctly. The Usergroups we try to create via Liferay API do not show in the Administration Menu. However when we try to manually create the missing Usergroup via the Administration Menu it says that the Usergroup already exists. We cannot delete the Usergroup and cannot create a new one with the “same name”.
Can somebody tell us how to either repair the broken Usergroup or how to delete it from the liferay database (we don’t really know which liferay database tables we need to look at, just deleting the Usergroup itself doesn’t do the trick), so that we can recreate it (either manually or by LDAP import / Liferay API Calls).
Thanks in advance
thumbnail
Olaf Kock, modified 5 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Jan Heiderich:

We currently have the problem that sometimes Usergroups seem to not be created correctly. The Usergroups we try to create via Liferay API do not show in the Administration Menu. However when we try to manually create the missing Usergroup via the Administration Menu it says that the Usergroup already exists. We cannot delete the Usergroup and cannot create a new one with the “same name”.
Can somebody tell us how to either repair the broken Usergroup or how to delete it from the liferay database (we don’t really know which liferay database tables we need to look at, just deleting the Usergroup itself doesn’t do the trick), so that we can recreate it (either manually or by LDAP import / Liferay API Calls).

Obligatory link to database information: https://liferay.dev/blogs/-/blogs/understanding-liferay-s-database

Regarding the API: Please let us know how you created the UserGroups through the API, also exact version, steps to reproduce etc
Jonas Schwindt, modified 5 Years ago. New Member Posts: 8 Join Date: 12/17/19 Recent Posts
We are parsing an LDAP Subtree to extract User Groups. Everything seems to work for like 95% of all entries. The usergroups are perfectly fine except for one User Group. We also create a Role with the same name as the User Group however for this single entry only the created role is shown in the Administration Menu - which seems a bit strange since it worked fine on all the other groups and roles we created.
We don't really know how to reproduce it - there is no Exception nor a Warning. The only thing i can imagine would be that it maybe is the first or last entry beeing processed.
Liferay Version 7.1.1 GA2 and we call UserGroupLocalServiceUtil.addUserGroup(userId,companyId,name,description,serviceContext)
thumbnail
Mohammed Yasin, modified 5 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Hi,
May be you can try re-indexing  the search index   from control panel  if usergroup not showing up in Administration Menu after creation.
Jan Heiderich, modified 5 Years ago. New Member Posts: 7 Join Date: 2/20/20 Recent Posts
[code]final UserGroup newUserGroup = UserGroupLocalServiceUtil.addUserGroup( UserLocalServiceUtil.getDefaultUserId(companyId), companyId,userGroupName,  "LDAP User Group", null);


Version Liferay 7.1.1 GA2