Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Issue in user login
Hi,
We are getting below exception on user login:com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=10154, classNameId=10005, classPK=395787}com.liferay.portal.kernel.events.ActionException: com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=10154, classNameId=10005, classPK=395787}
The Liferay version is 6.2 CE GA2 and for login LDAP authentication is used. The user is present in LDAP but not in Liferay’s User_ table.
Please help in understanding the cause and resolution of the exception.
Thanks
We are getting below exception on user login:com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=10154, classNameId=10005, classPK=395787}com.liferay.portal.kernel.events.ActionException: com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=10154, classNameId=10005, classPK=395787}
The Liferay version is 6.2 CE GA2 and for login LDAP authentication is used. The user is present in LDAP but not in Liferay’s User_ table.
Please help in understanding the cause and resolution of the exception.
Thanks
Hi,
Check in your ldap configuration what mapping you have done for group, there might be mismatch in that
Check in your ldap configuration what mapping you have done for group, there might be mismatch in that
Hi Purnima,
Check the mappings for sure of course, and make sure you use the "Test" buttons and validate the resulting table. I'm going to add a little more detail here about LDAP and Liferay and users etc in case you are note aware.
If you have LDAP configured such that it is set to be "required" (as in the check box is checked in the configuration in Liferay) then what happens internally is Liferay starts by loading all the LDAP configurations that you have provided. It's possible to have more than one configuration (server) so if there is a configuration with, say, 3 servers, it will load all three and then loop over them one by one. The required indicates that the user HAS to be found in one of the LDAP server configurations and if they are not, the login will fail. If you have LDAP set to enabled, but not required, then the check is performed, but if the user is NOT found in LDAP, it will fall through to the next authenticator in the list.
Assuming the user is found, and their credentials match of course, the next thing Liferay does is it checks to see if the User exists in Liferay. This is important to understand of course because although you are authenticating against an external system, your user context in terms of permissions and such for your Liferay application are managed and stored in Liferay's database. If the user is not found in the User_ table, then Liferay tries to create a new user based on the mappings that you have provided for LDAP. If you have configured a group mapping, then it will look up the groups and create them if they are missing as well.
Your exception however is a NoSuchGroupException -- not a NotSuchUserGroupException. A "Site" on the front end (in the UI) maps to a "Group" entity in the backend / api of Liferay. So it sounds like perhaps you are trying to assign the user to a group that doesn't exist. Couple of things I would start with.
1. Do a lookup in the Group_ table and make sure that your site is there (take note of the groupId and the companyID
2. Check the Default Site mappings for your user settings
3. Make sure your search index is up to date -- I recently had a similar problem (on a newwer version of Liferay post-upgrade) and found that it was becasue my index had not yet been rebuilt so it was failing a lookup
.. if all of that looks good and you still have the issue, can you share with us a full stacktrace so we can see where exactly (in terms of Liferay's internal services) the exception is being thrown.
Check the mappings for sure of course, and make sure you use the "Test" buttons and validate the resulting table. I'm going to add a little more detail here about LDAP and Liferay and users etc in case you are note aware.
If you have LDAP configured such that it is set to be "required" (as in the check box is checked in the configuration in Liferay) then what happens internally is Liferay starts by loading all the LDAP configurations that you have provided. It's possible to have more than one configuration (server) so if there is a configuration with, say, 3 servers, it will load all three and then loop over them one by one. The required indicates that the user HAS to be found in one of the LDAP server configurations and if they are not, the login will fail. If you have LDAP set to enabled, but not required, then the check is performed, but if the user is NOT found in LDAP, it will fall through to the next authenticator in the list.
Assuming the user is found, and their credentials match of course, the next thing Liferay does is it checks to see if the User exists in Liferay. This is important to understand of course because although you are authenticating against an external system, your user context in terms of permissions and such for your Liferay application are managed and stored in Liferay's database. If the user is not found in the User_ table, then Liferay tries to create a new user based on the mappings that you have provided for LDAP. If you have configured a group mapping, then it will look up the groups and create them if they are missing as well.
Your exception however is a NoSuchGroupException -- not a NotSuchUserGroupException. A "Site" on the front end (in the UI) maps to a "Group" entity in the backend / api of Liferay. So it sounds like perhaps you are trying to assign the user to a group that doesn't exist. Couple of things I would start with.
1. Do a lookup in the Group_ table and make sure that your site is there (take note of the groupId and the companyID
2. Check the Default Site mappings for your user settings
3. Make sure your search index is up to date -- I recently had a similar problem (on a newwer version of Liferay post-upgrade) and found that it was becasue my index had not yet been rebuilt so it was failing a lookup
.. if all of that looks good and you still have the issue, can you share with us a full stacktrace so we can see where exactly (in terms of Liferay's internal services) the exception is being thrown.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™