When installing my managed package into a test org I get the following error:

System.NoAccessException: Entity is not api accessible

This error is coming when accessing a map with the following key => value pair:

Group.SObjectType => GroupsSelector.class

My understanding is that the Group Object is accessible by all users via the API. Also, this error is coming during the post-install, not from failed tests.

Why would I get this error on install? Does the "special" install user not have access to this object at install?

  • Is chatter or groups enabled for this org? – Mohith Shrivastava Feb 6 '16 at 23:40
  • Chatter is enabled. The Group object is for Public Groups though, would Chatter settings have an impact? – techbusinessman Feb 6 '16 at 23:42
  • 1
    Usually this error comes when some object types have compiled in the development org but its not enabled in your org .You might have to ask the managed package provider to check logs and code to infer . – Mohith Shrivastava Feb 6 '16 at 23:53
  • I am the package provider. This install is happening in a test org right now. Anything you can suggest to troubleshoot further? I would assume that the error is occurring when I call Group.SObjectType means that something related to the group object is not accessible. I'll double check features in the test org to see if I can verify. – techbusinessman Feb 6 '16 at 23:55
  • 1
    Did you turn on API restrictions for your package? Enabling them restricts access to a number of system SObjects, and I believe group may be among them. – ca_peterson Feb 7 '16 at 0:12

The post install user is fairly restricted. This is not officially documented, but here's a related post with a lot of details on what the ghost user cannot access. Some suggest using the without sharing keyword to alleviate the issue but I'm not sure if it would help with access to Group.

  • Thanks for the link to that post, it was very informative. Unfortunately, my installhandler is marked as without sharing and the issue persists. – techbusinessman Feb 7 '16 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.