Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occured in TCMEventLog.NTEventLog.1: ReportEvent failed

Tags:

tridion

I'm using Tridion 2009 SP1. What I'm trying to do is kick off an event after a component completes a certain workflow process. Intuitively I've tried using the OnProcessInstanceFinishPost event, however, this event only gets triggered when a user (admin) explicitly clicks "Finish Process"; when the process completes normally after having all the activities finished and "reaching the 'Stop' sign end marker (as in the Visio diagram) this event is not triggered.

So I have resorted to using the OnActivityInstanceFinishPost event instead. The issue is that in the OnActivityInstanceFinishPost event I am getting the logger and trying log a simple message, e.g. "Hello World", but the Event Viewer always shows an Error: "An error occured in TCMEventLog.NTEventLog.1:ReportEvent failed." and the event doesn't get executed.

Note, in the OnProcessInstanceFinishPost event the exact same code works without errors.

I've checked to see if this was a problem with the permissions of the identity user, but the user is an admin in Tridion, so this can't be it. I've checked SDLTridionworld forum, but no luck there, and of course, I've simplified the code down to the one logging statement to make sure it's not something in my code.

Here is the code:

public void OnActivityInstanceFinishPost(ActivityInstance ActivityInstance, string finishMessage, string nextActivity, string dynamicAssignee)
{
    TDSE tdse = new TDSEClass() as TDSE;
    tdse.Impersonate(_identity);
    tdse.Initialize();

    Logging logger = tdse.GetLogging() as Logging;

    logger.LogEvent("Entered event OnActivityInstanceFinishPost. nextActivity="+nextActivity, EnumSeverity.severityInfo, EnumEventCategory.EVENT_CATEGORY_EVENT_SYSTEM);
}

Here is the full error:

Log Name:      Tridion Content Manager
Source:        Kernel
Date:          4/9/2012 10:14:07 PM
Event ID:      100
Task Category: Logging
Level:         Error
Keywords:      Classic
User:          SYSTEM
Computer:      xxxxxxxxxxxxxx
Description:
An error occured in TCMEventLog.NTEventLog.1:
ReportEvent failed.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Kernel" />
    <EventID Qualifiers="49152">100</EventID>
    <Level>2</Level>
    <Task>9</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2012-04-10T03:14:07.000Z" />
    <EventRecordID>546126</EventRecordID>
    <Channel>Tridion Content Manager</Channel>
    <Computer>xxxxxxxxxxxxxxxxxxxxxxxxx</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <EventData>
    <Data>An error occured in TCMEventLog.NTEventLog.1: ReportEvent failed.</Data>
  </EventData>
</Event>
like image 798
Nickoli Roussakov Avatar asked Apr 10 '12 18:04

Nickoli Roussakov


1 Answers

The error indicates that Tridion has failed to write a logging message. I assume you already have some evidence that this is triggered by the workflow activity finishing.

I don't know what is causing the error, but with logging failures, it is often about permissions.

It will depend on your workflow which user actually triggers the OnActivityInstanceFinishPost event. If the activity is manually finished by a user, then that user will be the Windows identity executing the event (or if Tridion impersonation is configured, the impersonation user). If it's an automatic activity, then it will be being executed by the identity configured for the Workflow agent service. I would suggest checking whether each of these accounts is able to log correctly.

like image 70
Dominic Cronin Avatar answered Sep 30 '22 11:09

Dominic Cronin