jongpie / NebulaLogger

The most robust observability solution for Salesforce experts. Built 100% natively on the platform, and designed to work seamlessly with Apex, Lightning Components, Flow, Process Builder & integrations.
https://nebulalogger.com
MIT License
708 stars 164 forks source link

Getting Error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY when inserting LogEntry records #756

Closed islimane closed 2 months ago

islimane commented 2 months ago

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.14.7

New Bug Summary

I had the Logger working correctly but suddenly stopped working. The Log was being created but with no Log Entries, or sometimes some of them but not all.

I included the Automated Process in the Debug Logs to see the logs and I found the following error:

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LogEntry: data changed by trigger for field Origin Source Snippet...

Since the DML operation is an upsert, I couldn't use dmlOptions to indicate the truncation of fields, so I had to put a .left(2000) on the LogEntryHandler wherever the field OriginSourceSnippet__c was being set and that did the trick.

I don't know if there is a better solution but I wanted to issue this bug so it can be fixed in the future.

jongpie commented 2 months ago

@islimane thanks for reporting this! I'm working on a fix for this now & hope to have it released either today or tomorrow.

jongpie commented 2 months ago

@islimane this is now fixed in release v4.14.9. Thanks again for reporting this - let me know if you run into any other issues!