Very strange plugin problem (4.0) Urgent.
-
4. listopadu 2008 22:25
Hi
I have made a plugin that runs on the pre update event of an Invoice. If I then make a workflow that updates an Invoice then the plugin fails to run but not every time. If I manually change an Invoice the plugin never fails to run. I think the error message below from the log is related to this problem. Something about the user was not found. This I can understand if it was every time, but it’s more like 50/50 chance of success.
Any suggestions?
Code Snippetat CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException, Boolean enableTrace)
at ServerLocatorService.GetCrmUserIdFromDatabase(Guid organizationId, String authenticationInfo)
at ServerLocatorService.GetCrmUserId(Guid organizationId, String authenticationInfo)
at LocatorService.GetCrmUserId(Guid organizationId, String authenticationInfo)
at SecurityLibrary.GetUserInfoInternal(WindowsIdentity identity, IOrganizationContext context, UserAuth& userInfo)
at SecurityLibrary.GetCallerAndBusinessGuidsFromThread(WindowsIdentity identity, Guid organizationId)
at CrmWindowsIdentity.DoRecognizeUser(String userToken, Guid organizationId)
at BaseCrmIdentity.RecognizeCrmUser(Guid organizationId)
at CrmWindowsIdentity.RecognizeCrmUser(Guid organizationId, Guid callerId)
at AuthenticationProvider.Authenticate(CrmAuthenticationToken token)
at SoapHeaderAuthenticationProviderBase.Authenticate(HttpApplication application)
at AuthenticationStep.Authenticate(HttpApplication application)
at AuthenticationPipeline.Authenticate(HttpApplication application)
at AuthenticationEngine.Execute(Object sender, EventArgs e)
at SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at ApplicationStepManager.ResumeSteps(Exception error)
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>Crm Exception: Message: User Was Not Found, ErrorCode: -2147220969
Všechny reakce
-
4. listopadu 2008 23:44Can you post some code?
-
4. listopadu 2008 23:49The plugin is rather long but I don't think it the code thats the problem as the same code works fine if I trigger the event but not if a workflow does. And then again sometimes it does and thats on the very same Invoice.
-
4. listopadu 2008 23:54Maybe check permissions as well as the user firing the plugin
-
4. listopadu 2008 23:58It during testing and it only me who is using the plugin and im administrator.
-
5. listopadu 2008 0:04replublish workflow, what is the scope of it?
Workflow does run on top of the plugins, and acts like the user would be pressing the buttons, but then context.InputParameters may change on the workflow -
5. listopadu 2008 0:12
Scope? The plugin runs as Calling user. Having the same problem if I set it to Admin as Calling user. It is as if sometimes the plugin forgets who the caller is. -
5. listopadu 2008 0:14scope of the workflow
-
5. listopadu 2008 0:18Now it's on User scope. Having the same problem if its on Business Unit scope. Havent tried the other options.
-
5. listopadu 2008 0:20i can't really help any more, until you post your code
-
5. listopadu 2008 0:22ill post code in 10 min
-
5. listopadu 2008 0:35
The plugin is 335 lines long and I don't see any point in posting all of it.
The ICrmService I create like this:
Code Snippetpublic void Execute(IPluginExecutionContext context)
{...........
ICrmService service = context.CreateCrmService(true);
I make use of it 5 times in the plugin. Using Both retrieve and excute method.