We sometimes receive screen shots from business users indicating they are seeing "Insufficient Privileges" errors. These errors come up in a variety of contexts, but they appear to mostly be associated with complex legacy Visualforce solutions (of which we have several).

What these issues seem to have in common is that they are:

  • Sporadic, i.e. they can't be reliably reproduced. Even with careful attention to the user context, the records involved, and the actions attempted, we have seldom been able to reproduce the issue reported.
  • Opaque -- even when we are lucky enough to reproduce the issue, the resulting debug logs provide no helpful information.
  • Widespread, affecting users across many profiles, business areas, code-based solutions, etc.
  • Increasing -- this is becoming a bigger and bigger paint point for the business.

A lot has been written about "Insufficient Privileges", but practically all of it assumes you have a reproducible problem. To reiterate: we don't.

Right now I'm toying with a theory having to do with @future methods in the trigger logic for commonly-used standard objects causing deadlocks. The variability of the @future method's execution time seems to have the potential to introduce conflicts that are sporadic and hard to reproduce. A deadlock might explain why the debug logs are so unhelpful. And the fact that we have these on core standard object triggers could explain why the problem is so widespread.

Eliminating @future methods would be an undertaking, and I'm shaky at best on whether it would solve anything. Is there any way to confidently diagnose this? Is the above theory sound? What other theories should I be entertaining?

  • 1
    are there any api calls happening with the VF page? Jan 25 '20 at 7:24
  • Are the users reporting these of various license types or all within a specific license type? i wonder if the issue being presented is anything related to features being accessed/used are not available to specific license types. i.e. dml on custom objects from a chatter free/external license (help.salesforce.com/…)
    – Ronnie
    Jan 25 '20 at 17:42
  • @PartOfTheOhana -- these VF pages are all using AJAX components like apex:actionSupport, apex:commandButton, apex:actionFunction, etc., to call the Apex controller. They don't typically make API callouts beyond this. Jan 27 '20 at 20:14
  • 1
    @Ronnie -- to clarify -- this question is about sporadic, unpredictable errors. We're getting different behavior when the same user does the same thing. Sometimes they get "Insufficient Privileges". Mostly they do not. Jan 27 '20 at 20:17
  • 1
    Are you using lightning? With a custom, legacy visualforce solution displayed in a lightning page? You may have some problems with session id cookies or third party cookies. I had a lot of trouble a while back with nesting a frame with a component in it until i authorized the right cookies. This isn't something I would expect the average user to understand or report. Other than that, my next goal would be to get a reproducible error - I bet this stack would be a lot more helpful with some code they could modify. Jan 29 '20 at 21:31

Your Answer

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

Browse other questions tagged or ask your own question.