locked
create user through orgservice - an unknown error occurred RRS feed

  • Question

  • Hello, I created an console app to create a user in 2013 through the orgservice. However, when the orgservice attempts to create the user the system returns the following error: "An unknown error occurred." Here's the error details logged to the event log:

    The Web Service plug-in failed in OrganizationId: 13e6d40d-c3cc-e311-80b8-00155d76000f; SdkMessageProcessingStepId: 5acabb1b-ea3e-db11-86a7-000a3a5473e8; EntityName: systemuser; Stage: 30; MessageName: Create; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
       at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
       at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
    Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.Crm.BusinessEntities.SecurityAttributes..ctor(SecurityTraits traits, BusinessEntity entity, ExecutionContext context)
       at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.Create(IBusinessEntity systemuser, ExecutionContext context).

    Any idea what the issue might be here?  I googled the last line of the error details and a few solutions had been identified by others although these solutions did not work for me. One solution was to set AutoGroupManagementOff=1 in the registry which did not work for me.  Another solution was to toggle the culture format in system settings to something else and then back again. This did not work for me either. Any idea what the issue might be or can you think of additional steps to debug?
    Wednesday, May 14, 2014 8:21 PM

All replies

  • Not sure if the details written to the trace log might provide any additional insight:

    # CRM Tracing Version 2.0
    # LocalTime: 2014-05-14 13:51:33.199
    # Categories: Exception.*:Verbose
    # CallStackOn: No
    # ComputerName: MSRCCRM2013-DEV
    # CRMVersion: 6.0.0002.0051
    # DeploymentType: OnPremise
    # ScaleGroup: 
    # ServerRole: AppServer, AsyncService, DiscoveryService, ApiServer, HelpServer, DeploymentService, SandboxServer, DeploymentManagementTools, VssWriter, EmailConnector

    [2014-05-14 13:51:33.199] Process: w3wp |Organization:13e6d40d-c3cc-e311-80b8-00155d76000f |Thread:   11 |Category: Exception |User: 74d97f17-c3cc-e311-80b8-00155d76000f |Level: Error |ReqId: e7cb319c-84ef-4519-bf8f-53c679210a77 | CrmException..ctor  ilOffset = 0x7
    at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)  ilOffset = 0x7
    at CrmException..ctor(Exception innerException, Int32 errorCode, Object[] arguments)  ilOffset = 0xB
    at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)  ilOffset = 0x65
    at Pipeline.Execute(PipelineExecutionContext context)  ilOffset = 0x65
    at MessageProcessor.Execute(PipelineExecutionContext context)  ilOffset = 0x1C5
    at InternalMessageDispatcher.Execute(PipelineExecutionContext context)  ilOffset = 0xE4
    at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)  ilOffset = 0x16E
    at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse)  ilOffset = 0x16A
    at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x3D
    at OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x37
    at OrganizationSdkService.Create(Entity entity)  ilOffset = 0x11
    at   ilOffset = 0xFFFFFFFF
    at SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)  ilOffset = 0x241
    at DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)  ilOffset = 0x100
    at ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)  ilOffset = 0x48
    at ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)  ilOffset = 0xC6
    at MessageRpc.Process(Boolean isOperationContextSet)  ilOffset = 0x62
    at ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)  ilOffset = 0x256
    at ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)  ilOffset = 0xF1
    at ChannelHandler.AsyncMessagePump(IAsyncResult result)  ilOffset = 0x39
    at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)  ilOffset = 0x0
    at AsyncResult.Complete(Boolean completedSynchronously)  ilOffset = 0xC2
    at ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)  ilOffset = 0x58
    at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)  ilOffset = 0x0
    at AsyncResult.Complete(Boolean completedSynchronously)  ilOffset = 0xC2
    at AsyncQueueReader.Set(Item item)  ilOffset = 0x21
    at InputQueue`1.Dispatch()  ilOffset = 0x121
    at ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)  ilOffset = 0x22
    at IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)  ilOffset = 0x5
    at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)  ilOffset = 0x3C
    >Crm Exception: Message: An unexpected error occurred., ErrorCode: -2147220970, InnerException: System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.Crm.BusinessEntities.SecurityAttributes..ctor(SecurityTraits traits, BusinessEntity entity, ExecutionContext context)
       at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.Create(IBusinessEntity systemuser, ExecutionContext context)
    Wednesday, May 14, 2014 8:58 PM
  • Are you handling the exception in your code? If so, inner exception might reveal some additional information that could be useful, as the trace doesn't seem to be helpful in troubleshooting the exception. Refer http://msdn.microsoft.com/en-us/library/gg327884.aspx
    Wednesday, May 14, 2014 11:42 PM