0
Answered

Attempting to import binary attribute failing

Hayden Gray 7 years ago updated by anonymous 7 years ago 9

I'm trying to read a read a binary attribute (Image) from an adapter into a PowerShell script, and am currently getting an exception in IdB - which i suspect is due to an image being too large. I have tried altering the MaxReceivedMessageSize field in the Unify.Service.Connect.exe.config under the <basicHttpBinding> element but the error message doesn't seem to change (i.e. the message size quota value in the error message, doesn't change regardless of the value I put in the MaxReceivedMessageSize field).

Identity Broker Version 4.1.5

Change detection engine import all items failed. Change detection engine import all items for connector Image Resize failed with reason An exception has been thrown when reading the stream.. Duration: 00:01:59.4399428 Error details: System.Management.Automation.CmdletInvocationException: An exception has been thrown when reading the stream. ---> System.IO.IOException: An exception has been thrown when reading the stream. ---> System.ServiceModel.CommunicationException: The maximum message size quota for incoming messages (204003200) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. ---> System.ServiceModel.QuotaExceededException: The maximum message size quota for incoming messages (204003200) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. --- End of inner exception stack trace ---


Answer

Answer

Thanks guys, increasing the buffer size on the consuming service solved the issue.

Under review

Do you have the full stack trace? Have you updated the setting on the service side as well?

on the service side means restarting the service; I have. and yes sorry the full stack trace is here:

Change detection engine import all items failed.
Change
 detection engine import all items for connector Image Resize failed 
with reason An exception has been thrown when reading the stream.. 
Duration: 00:01:59.4399428
Error details:
System.Management.Automation.CmdletInvocationException:
 An exception has been thrown when reading the stream. ---> 
System.IO.IOException: An exception has been thrown when reading the 
stream. ---> System.ServiceModel.CommunicationException: The maximum 
message size quota for incoming messages (204003200) has been exceeded. 
To increase the quota, use the MaxReceivedMessageSize property on the 
appropriate binding element. ---> 
System.ServiceModel.QuotaExceededException: The maximum message size 
quota for incoming messages (204003200) has been exceeded. To increase 
the quota, use the MaxReceivedMessageSize property on the appropriate 
binding element.
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.MaxMessageSizeStream.PrepareRead(Int32 bytesToRead)
   at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
   at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count)
   at System.Xml.XmlBufferReader.GetBuffer(Int32 count, Int32& offset, Int32& offsetMax)
   at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF)
   at System.Xml.XmlUTF8TextReader.Read()
   at System.Xml.XmlBaseReader.MoveToContent()
   at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.ReadLine()
   at 
IDBPowershell.IDBAdapterFullImport.GetEntityFromStream(StreamReader 
Reader, Int32 counter) in 
C:\Users\HaydenGray\Downloads\WAGAdapter\IDBPowershell\IDBPowershell\IDBPowershell.cs:line
 102
   at 
IDBPowershell.IDBAdapterFullImport.<GetEntities>d__11.MoveNext() 
in 
C:\Users\HaydenGray\Downloads\WAGAdapter\IDBPowershell\IDBPowershell\IDBPowershell.cs:line
 81
   at IDBPowershell.IDBAdapterFullImport.ProcessRecord() in 
C:\Users\HaydenGray\Downloads\WAGAdapter\IDBPowershell\IDBPowershell\IDBPowershell.cs:line
 54
   at System.Management.Automation.CommandProcessor.ProcessRecord()
   --- End of inner exception stack trace ---
   at Unify.Product.IdentityBroker.PowerShellConnector.<GetEntitiesInScript>d__27.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Unify.Framework.Collections.ActionOnExceptionEnumerator`1.MoveNext()
   at Unify.Framework.Collections.EnumerableExtensions.<ActionOnLast>d__10`1.MoveNext()
   at Unify.Framework.Collections.EnumerableExtensions.<ProduceAutoPages>d__7`1.MoveNext()
   at Unify.Framework.Visitor.ThreadsafeVisitorEvaluator`1.Visit()
   at Unify.Framework.Visitor.VisitEvaluateOnThreadPool[T](IEnumerable`1 visitCollection, Action`2 visitor, Int32 maxThreads)
   at Unify.Product.IdentityBroker.RepositoryChangeDetectionWorkerBase.PerformChangeDetection(IEnumerable`1 connectorEntities)
   at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.ImportAllChangeProcess()
   at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.RunBase()
   at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()
   at Unify.Product.IdentityBroker.ConnectorJobExecutor.<>c__DisplayClass27_0.<Run>b__0()
   at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)


I was referring to the service that you are consuming, not the Identity Broker service - although you'll have to do it there as well. Which binding element did you update in Identity Broker?

As in the script/IDBPowershell.dll that is running the Import? sorry I'm just unsure what you mean. And I updated <binding name="StreamingFileTransferServicesBinding" element.

Hi Hayden,

It appears that the script running the import is retrieving the data via a stream to a remote service. Please ensure that the remote service is also configured with a large enough maximum message size.

The StreamingFileTransferServicesBinding is [by default] used by Identity Broker WCF services. Unless you reused it for the service that you're calling? If you've reused it then it's the right one to update, otherwise you'll have to update the correct binding (or add a new binding and use it for the service that you're calling).

Ok, Thanks for your help!

Answer

Thanks guys, increasing the buffer size on the consuming service solved the issue.