I'm using Liferay 5.2.3 and finding orphan records in the UserGroupRole table. Either userids are changing or users are being actually deleted and not just deactivated. I would assume that, if all were well, the query:
SELECT userid, groupid, roleid
FROM usergrouprole ugr where ugr.userid not in (select ut.userid from user_ ut);
Should return no results, while I'm getting about 2400 rows. It looks like most of the orphan userids are users with the community member role in the guest community, but that's not all of them (and why would that be happening to start with?) I'm getting errors related to fetching usergrouprole objects by role and/or group, and then I error out when I try to find the associated user.
Please sign in to flag this as inappropriate.