So, this is the Maximum number of unique namespaces referenced limit, which currently maxes out at 10.
The explanation from the linked documentation:
In a single transaction, you can only reference 10 unique namespaces. For example, suppose you have an object that executes a class in a managed package when the object is updated. Then that class updates a second object, which in turn executes a different class in a different package. Even though the second package wasn’t accessed directly by the first, because it occurs in the same transaction, it’s included in the number of namespaces being accessed in a single transaction.
So, probably based on the triggers firing and subsequent DML operations, the code is reaching more than 10 different namespaces.
In the debug logs the first thing I'd look for would be LIMIT_USAGE_FOR_NS
events. There will be one of these for each namespace, with the namespace identified in the first data after the event. E.g.
19:01:46.137 (1137952897)|LIMIT_USAGE_FOR_NS|TheNamespaceHere|
The other useful events to look for will be:
CODE_UNIT_STARTED
. These occur when the triggers start. Again, the namespace is included in the subsequent data.
ENTERING_MANAGED_PKG
. Useful as it only requires the INFO log level. (Thanks for the comment Chris)
Resolving the problem will largely depend on how all the different packages are being reached. It may be necessary to make some of the processing asynchronous.
Try using something like the following from the Developer Console anonymous Apex to capture the debug log:
Lead testLead = [Select Id from Lead Limit 1];
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId(testLead.id);
LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);
Database.LeadConvertResult lcr = Database.convertLead(lc);
System.assert(lcr.isSuccess());
System.assert(false, 'rollback transaction');