Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY when inserting LogEntry records #756

Closed
islimane opened this issue Sep 1, 2024 · 2 comments · Fixed by #758
Closed
Assignees
Labels
Layer: Log Management Items related to the custom objects & Logger Console app Logging Source: Apex Items related to using Logger within Apex Type: Bug Something isn't working

Comments

@islimane
Copy link

islimane commented Sep 1, 2024

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.

@islimane islimane added the Type: Bug Something isn't working label Sep 1, 2024
@jongpie
Copy link
Owner

jongpie commented Sep 2, 2024

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

@jongpie jongpie added Logging Source: Apex Items related to using Logger within Apex Layer: Log Management Items related to the custom objects & Logger Console app labels Sep 2, 2024
@jongpie jongpie self-assigned this Sep 2, 2024
jongpie added a commit that referenced this issue Sep 2, 2024
… LogEntry__c fields OriginSourceSnippet__c and ExceptionSourceSnippet__c
jongpie added a commit that referenced this issue Sep 3, 2024
* Fixed #756 by truncating the Apex code snippets that are saved in the LogEntry__c fields OriginSourceSnippet__c and ExceptionSourceSnippet__c
@jongpie
Copy link
Owner

jongpie commented Sep 4, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Log Management Items related to the custom objects & Logger Console app Logging Source: Apex Items related to using Logger within Apex Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants