0

Environment: Sitecore 9.0.2 Azure PAAS Scaled

Issue: I have custom code which inserts data in xDB. The code is in production from past 2 weeks and I have successfully inserted 300,000 entries (3 excels of 100,000 entries each.) over past 1 week. I am using a custom scheduled task 'ImportContact' to manage it. And this is running on the CM side.

Today I am facing issues there.

The log is:

ERROR Error executing command item: ImportContacts
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   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 Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   at Sitecore.Tasks.CommandItem.Execute(Item[] items, ScheduleItem schedule)

Nested Exception

Exception: Sitecore.XConnect.XdbCollectionUnavailableException
Message: An error occurred while sending the request.
Source: Sitecore.Xdb.Common.Web
   at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
   at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
   at Foundation.Analytics.Services.ContactService.ImportContactsFromExcelService() in G:\TeamCity\buildAgent\work\eee14221e7288f8f\src\Foundation\Analytics\code\Services\ContactService.cs:line 520

Nested Exception

Exception: System.NotSupportedException
Message: Stream does not support reading.
Source: mscorlib
   at System.IO.__Error.ReadNotSupported()
   at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state, Boolean serializeAsynchronously)
   at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
   at System.Net.Http.StreamToStreamCopy.StartRead()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.XConnect.Client.Operations.GetEntityRequestMapper.<>c__DisplayClass4_2`2.<<GetEntities>b__3>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.XConnect.Client.Operations.XdbOperationRequestHandler.<Complete>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.XConnect.Client.WebApi.CollectionBatchWebApiClient.<ExecuteBatch>d__11.MoveNext()

What I have already checked:

  1. I am getting data under 'Experience Profile'.
  2. There is no another error of xDB connection on the CM side.
  • I think the error is occurring due to your custom code. Check the method 'ImportContactsFromExcelService' in ContactService class and see if there is a change from when the import was working. – Sumit Upadhyay Oct 22 at 6:48
  • @SumitUpadhyay: We didn't have a Prod deploy from the past 2 weeks. And this has worked till last week. – NutsAndBolts Oct 22 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.