0
Fixed

Unclear notification failure of import file generation

Tony Sheehy 12 years ago in UNIFYBroker/Microsoft Identity Manager updated by anonymous 8 years ago 3

When the import file cannot be generated it is unclear what has happened.
Namely the following is what can be seen from the Event Viewer on the FIM side:

The extensible extension returned an unsupported error.
 The stack trace is:
 
 "System.Exception: Error encountered attempting import: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to http://localhost:59990/IdentityBroker/FIMLDIFAdapter.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Unify.Product.IdentityBroker.IdentityBrokerLDIFAdapter.ILDIFAdapter.ImportAll(Guid adapterId)
   at Unify.Product.IdentityBroker.IdentityBrokerManagementAgentProxy.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData) 

   at Unify.Product.IdentityBroker.IdentityBrokerManagementAgentProxy.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData)
Forefront Identity Manager 4.0.3606.2"

whilst the following is what is available in the IDB logs

An exception has occured whilst performing a job for adapter 2656b225-d789-437d-bd32-03ae2f6ed07c job GetTransformedEntities (ParallelGate):
System.Data.ConstraintException: Only standard components can be contained inside a multipart component.
at Unify.Product.IdentityBroker.EntityMultiPartDistinguishedNameComponentGenerator`2.<>c__DisplayClassa.<GetDistinguishedNameComponents>b__9(IEntityDistinguishedNameComponentGenerator`2 generator)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unify.Framework.IO.DistinguishedNameMultiPartComponent.ToString()
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unify.Framework.IO.DistinguishedName.GetStringValue()
at Unify.Product.IdentityBroker.Repository.AdapterEntityContext.SetEntityRowDetails(__EntityInsertRow row, IAdapterEntity entity, EntityDataContext sourceContext, IEntityCollectionKeyUtility`1 keyUtility)
at Unify.Product.IdentityBroker.Repository.KnownEntityContextBase`4.InsertItems(HashSet`1 addedItems, EntityDataContext sourceContext, SqlConnection connection)
at Unify.Framework.Data.LinqContextConversionBase`4.SubmitChanges()
at Unify.Framework.ParallelGate.ParallelGateJob.RunBase()
at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)

This is most definitely still being seen in v4.0.0 RTM.

There might not be much we can do in this case - this occurs because of an error in the lazy evaluation stream that breaks the stream via WCF. This is why we recommend IDB40:Configuring WCF Logging, and also detail it in troubleshooting - https://unifysolutions.jira.com/wiki/display/IDBFIM40/Import+fails+because+the+connection+was+closed

Could the LazyEvaluationStream have another constructor that takes a log writer or message service, such that it can log exception on the external facing side (the read method)?

For reference, here is a WCF trace from another issue (QDET-116):

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524340</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2011-09-15T04:43:18.1486800Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{bb7d1585-9a90-4661-b5c8-87963721aef8}" />
<Execution ProcessName="Unify.Service.Connect" ProcessID="1392" ThreadID="17" />
<Channel />
<Computer>IAMSCOAPP735</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/en-AU/library/System.ServiceModel.ServiceOperationExceptionOnReply.aspx</TraceIdentifier>
<Description>Replying to an operation threw a exception.</Description>
<AppDomain>Unify.Service.Connect.exe</AppDomain>
<Source>System.ServiceModel.Dispatcher.ImmutableDispatchRuntime/31978062</Source>
<Exception>
<ExceptionType>System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>An exception occurred during the lazy evaluation.  Check the inner exception for details</Message>
<StackTrace>
at Unify.Framework.LazyEvaluationStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.Xml.XmlDictionaryWriter.WriteValue(IStreamProvider value)
at System.ServiceModel.Dispatcher.StreamFormatter.Serialize(XmlDictionaryWriter writer, Object[] parameters, Object returnValue)
at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Stream stream)
at System.ServiceModel.Channels.HttpOutput.WriteStreamedMessage(TimeSpan timeout)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&amp; rpc)
</StackTrace>
<ExceptionString>System.IO.IOException: An exception occurred during the lazy evaluation.  Check the inner exception for details ---&gt; System.ArgumentNullException: Value cannot be null.
   at Unify.Framework.LDIFSafeStringFilter.IsSafe(String sourceValue)
   at Unify.Framework.LDIFValueSpec.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFAttrvalSpec.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFAttrvalRecord.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFComponentFileGenerator`1.GenerateFile(TextWriter writer, IEnumerable`1 entries)
   at Unify.Framework.LDIFAdapter.&lt;&gt;c__DisplayClass5`1.&lt;CreateLDIFComponentStream&gt;b__4(Stream stream)
   at Unify.Framework.LazyEvaluationStream.Evaluate(Object obj)
   --- End of inner exception stack trace ---
   at Unify.Framework.LazyEvaluationStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Xml.XmlDictionaryWriter.WriteValue(IStreamProvider value)
   at System.ServiceModel.Dispatcher.StreamFormatter.Serialize(XmlDictionaryWriter writer, Object[] parameters, Object returnValue)
   at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
   at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
   at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
   at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Stream stream)
   at System.ServiceModel.Channels.HttpOutput.WriteStreamedMessage(TimeSpan timeout)
   at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
   at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc&amp; rpc)</ExceptionString>
<InnerException>
<ExceptionType>System.ArgumentNullException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Value cannot be null.</Message>
<StackTrace>
at Unify.Framework.LDIFSafeStringFilter.IsSafe(String sourceValue)
at Unify.Framework.LDIFValueSpec.WriteComponent(TextWriter writer)
at Unify.Framework.LDIFAttrvalSpec.WriteComponent(TextWriter writer)
at Unify.Framework.LDIFAttrvalRecord.WriteComponent(TextWriter writer)
at Unify.Framework.LDIFComponentFileGenerator`1.GenerateFile(TextWriter writer, IEnumerable`1 entries)
at Unify.Framework.LDIFAdapter.&lt;&gt;c__DisplayClass5`1.&lt;CreateLDIFComponentStream&gt;b__4(Stream stream)
at Unify.Framework.LazyEvaluationStream.Evaluate(Object obj)
</StackTrace>
<ExceptionString>System.ArgumentNullException: Value cannot be null.
   at Unify.Framework.LDIFSafeStringFilter.IsSafe(String sourceValue)
   at Unify.Framework.LDIFValueSpec.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFAttrvalSpec.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFAttrvalRecord.WriteComponent(TextWriter writer)
   at Unify.Framework.LDIFComponentFileGenerator`1.GenerateFile(TextWriter writer, IEnumerable`1 entries)
   at Unify.Framework.LDIFAdapter.&lt;&gt;c__DisplayClass5`1.&lt;CreateLDIFComponentStream&gt;b__4(Stream stream)
   at Unify.Framework.LazyEvaluationStream.Evaluate(Object obj)</ExceptionString>
</InnerException>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>