Hi Vikas,
It's quite sometime now, but do you know how did you resolved this problem ?
I am facing the same issue. There's also a bug reported for this: https://issues.liferay.com/browse/LPS-5498
I have analyzed the problem and found that the entry of guest community in Group_ table doesn't have value for classNameId.
This is resulting into null value for role, which it is trying to derive in method
1com.liferay.portal.service.impl.ResourceLocalServiceImpl.addCommunityPermissions_1to5
I am going to give it a try by providing classNameId of Group in Group_ table. Please let me know your fix for this problem.
Firmi prego dentro per inbandierare questo come inadeguato.