Sitecore Crawler : AddRecursive DoItemAdd failed - indexing

Our crawler log is filled with the following Index Out of Bounds Exception. Has anyone seen this error? Or have any ideas on how to resolve?
4548 00:37:31 WARN Crawler : AddRecursive DoItemAdd failed - {DDAFF741-80D0-4650-8E73-02A88EB2C8DC}
Exception: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: Sitecore.Kernel
at Sitecore.Caching.ItemPathsCache.UpdateKeyIndex(List`1 list, String value)
at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, TValue addValue, Func`3 updateValueFactory)
at Sitecore.Caching.ItemPathsCache.AddMapping(Item item, ItemPathType itemPathType, String path)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type, Item root, Int32 level)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type, Item root, Int32 level)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type, Item root, Int32 level)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type, Item root, Int32 level)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String separator, ItemPathType type)
at Sitecore.Data.ItemPath.DoGetPath(Item currentItem, String from, String separator, ItemPathType type)
at Sitecore.Data.ItemPath.GetPath(Item currentItem, String from, String separator, ItemPathType type)
at Sitecore.Data.ItemPath.get_ContentPath()
at Sitecore.ContentSearch.SitecoreItemCrawler.DoAdd(IProviderUpdateContext context, SitecoreIndexableItem indexable)
at Sitecore.ContentSearch.HierarchicalDataCrawler`1.CrawlItem(T indexable, IProviderUpdateContext context, CrawlState`1 state)

Related

Ignite.Net 2.12.0 fails on startup

Since upgrading to Apache.Ignite 2.12.0, Ignite fails to start up with the following error:
Unhandled exception. Apache.Ignite.Core.Common.IgniteException: Failed to start Ignite.NET, check inner exception for details
System.ArgumentException: Seek before origin: -1953261975
at Apache.Ignite.Core.Impl.Memory.PlatformMemoryStream.Seek(Int32 offset, SeekOrigin origin)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadHandleObject[T](Int32 pos, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.Read[T](Func`1 readFunc, Byte expHdr)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.Read[T](Func`2 readFunc, Byte expHdr)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadString()
at Apache.Ignite.Core.Configuration.DataRegionConfiguration..ctor(IBinaryRawReader reader)
at Apache.Ignite.Core.Configuration.DataStorageConfiguration.<>c__DisplayClass27_0.<.ctor>b__0(Int32 x)
at System.Linq.Enumerable.SelectRangeIterator`1.ToArray()
at Apache.Ignite.Core.Configuration.DataStorageConfiguration..ctor(IBinaryRawReader reader)
at Apache.Ignite.Core.IgniteConfiguration.ReadCore(BinaryReader r)
at Apache.Ignite.Core.IgniteConfiguration.Read(BinaryReader binaryReader)
at Apache.Ignite.Core.IgniteConfiguration..ctor(BinaryReader binaryReader, IgniteConfiguration baseConfig)
at Apache.Ignite.Core.Impl.Ignite.<GetConfiguration>b__87_0(IBinaryStream s)
at Apache.Ignite.Core.Impl.PlatformJniTarget.OutStream[T](Int32 type, Func`2 readAction)
at Apache.Ignite.Core.Impl.PlatformTargetAdapter.DoInOp[T](Int32 type, Func`2 action)
at Apache.Ignite.Core.Impl.Ignite.GetConfiguration()
at Apache.Ignite.Core.Impl.Ignite.SetCompactFooter()
at Apache.Ignite.Core.Impl.Ignite..ctor(IgniteConfiguration cfg, String name, IPlatformTargetInternal proc, Marshaller marsh, IList`1 lifecycleHandlers, UnmanagedCallbacks cbs)
at Apache.Ignite.Core.Ignition.OnStart(GlobalRef interopProc, IBinaryStream stream)
at Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.OnStart(Int64 memPtr, Int64 unused, Int64 unused1, Void* proc)
at Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.InLongLongLongObjectOutLong(Int32 type, Int64 val1, Int64 val2, Int64 val3, IntPtr arg)
at Apache.Ignite.Core.Impl.Unmanaged.Jni.Callbacks.InLongLongLongObjectOutLong(IntPtr env, IntPtr clazz, Int64 igniteId, Int32 op, Int64 arg1, Int64 arg2, Int64 arg3, IntPtr arg)
Any assistance would be appreciated

Moq Overloaded Property in VB.Net

I have a legacy class something along the lines of this:
Public Class MyOverloadExample
Public Overridable ReadOnly Property SomeDescription() As String
Get
Return "No Parameter"
End Get
End Property
Public ReadOnly Property SomeDescription(ByVal p1 As Integer) As String
Get
Return "Used Parameter"
End Get
End Property
End Class
I want to SetupGet on the first SomeDescription Property with no parameters. I tried this:
Dim mock = New Mock(Of MyOverloadExample)
mock.SetupGet(Function(i) i.SomeDescription()).Returns("Mocked the No Parameter Property")
But it fails with this exception:
threw exception:
System.Reflection.AmbiguousMatchException: Ambiguous match found.
at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetProperty(String name, BindingFlags bindingAttr)
at Moq.ExpressionExtensions.ToPropertyInfo(LambdaExpression expression) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 47
at Moq.Mock.SetupGetPexProtected[T,TProperty](Mock`1 mock, Expression`1 expression, Condition condition) in C:\projects\moq4\src\Moq\Mock.cs:line 511
at Moq.PexProtector.Invoke[T1,T2,T3,TResult](Func`4 function, T1 arg1, T2 arg2, T3 arg3) in C:\projects\moq4\src\Moq\PexProtector.cs:line 38
at Moq.Mock.SetupGet[T,TProperty](Mock`1 mock, Expression`1 expression, Condition condition) in C:\projects\moq4\src\Moq\Mock.cs:line 496
at Moq.Mock`1.SetupGet[TProperty](Expression`1 expression) in C:\projects\moq4\src\Moq\Mock.Generic.cs:line 332
I tried without the empty () but get the same exception:
mock.SetupGet(Function(i) i.SomeDescription).Returns("Mocked the No Parameter Property")
Is there some lambda/moq magic I'm missing or is this just not possible with Moq?

InvalidCastException in Apache Ignite with ConcurrentDictionary

I have an object which has ConcurrentDictionary field.
I am getting the error below, when accessing data in Ignite Shared memory.
System.InvalidCastException: [A]System.Collections.Concurrent.ConcurrentDictionary'2[System.String,CampaignEngine.Model.LookupItem] cannot be cast to [B]System.Collections.Concurrent.ConcurrentDictionary'2[System.String,CampaignEngine.Model.LookupItem]. Type A originates from 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.2\System.Private.CoreLib.dll'. Type B originates from 'System.Collections.Concurrent, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.2.2\System.Collections.Concurrent.dll
at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.ReadBinary[T](BinaryReader reader, IBinaryTypeDescriptor desc, Int32 pos, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadFullObject[T](Int32 pos, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.TryDeserialize[T](T& res, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.Deserialize[T](Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadObject[T](String fieldName)
at lambda_method(Closure , Object , IBinaryReader )
at Apache.Ignite.Core.Impl.Binary.BinaryReflectiveSerializerInternal.Apache.Ignite.Core.Impl.Binary.IBinarySerializerInternal.ReadBinary[T](BinaryReader reader, IBinaryTypeDescriptor desc, Int32 pos, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadFullObject[T](Int32 pos, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.TryDeserialize[T](T& res, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.Deserialize[T](Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.ReadBinaryObject[T](Boolean doDetach)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.TryDeserialize[T](T& res, Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.BinaryReader.Deserialize[T](Type typeOverride)
at Apache.Ignite.Core.Impl.Binary.Marshaller.Unmarshal[T](IBinaryStream stream, Boolean keepBinary)
at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Action'1 outAction, Func'3 inAction, Func'2 readErrorAction)
at Apache.Ignite.Core.Impl.Cache.CacheImpl'2.Get(TK key)
at Apache.Ignite.Core.Impl.Cache.CacheImpl'2.get_Item(TK key)
Why can't Ignite deserialize ConcurrentDictionary?
Thanks...
Looks like you have importing issue somewhere in your code, maybe due to Why is Visual Studio telling me I need to reference System.Private.CoreLib?
Check any of your source files for reference to System.Private.CoreLib and replace it to System.Collections.Concurrent.

c# 7.0 tuple used as custom type

I have a C# 7.0 tuple declaration, for example:
(int ID, string name, string secondName, int age) foo = (19,"Harry", "Potter", 8);
Each time a declare a new var or if I use it in a function/method, I need to rewrite the whole declaration.
For example:
private (int ID, string name, string secondName, int age) DoSomething((int ID, string name, string secondName, int age) passedElement) {...
I'd like to use it as a custom type and write something like this:
private MyType DoSomething(MyType passedElement) {...
With conventional tuples I always use:
using MyType = System.Tuple< int, string, string, int>;
It works fine, but if I try to use:
using MyType = (int ID, string name, string secondName, int age);
intellisense gives me an error "identifier expected" underlining the part on the right of equal sign.
What's the right way to declare it, if there is one?
Thank you in advance.
Tuples are not types. Not in the usual sense.
Tuples in C# were created to act as a bag of individual values.
The specified tuple element names are not part of the type but annotations on the instances created from that definition. For the runtime (and the compiler, for the most part), (int ID, string name, string secondName, int age) it's the same as (int i1, string s1, string s2, int i2) or (int, string, string, int).

Inconsistent SQLDateTime Overflow with NHibernate

We have a very strange error that sometimes we get this error when we want to save something from our WCF service. The object that we are saving contains NO invalid datetimes, we all check them before we save. When we see this error the database hangs sometimes and the WCF is in a faulty state. When I restart the DB and the IIS web app where the WCF is hosted and try to save again. It works..
We are clueless so if any one has some advice, please share
Following is the error:
2010-03-05 10:21:34,311 [5] ERROR ProjectX.Business.TTExceptionLogger - Exception somewhere in ReceiveResultsForMobile(): {0}
Castle.Services.Transaction.CommitResourceException: Could not commit transaction, one (or more) of the resources failed ---> System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
at System.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb)
at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
at NHibernate.Action.EntityUpdateAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at Rhino.Commons.NHibernateTransactionAdapter.Commit()
at Rhino.Commons.Facilities.RhinoTransactionResourceAdapter.Commit()
at Castle.Services.Transaction.AbstractTransaction.Commit()
--- End of inner exception stack trace ---
at Castle.Services.Transaction.AbstractTransaction.Commit()
at Castle.Services.Transaction.StandardTransaction.Commit()
at Castle.Facilities.AutomaticTransactionManagement.TransactionInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at IReceiveServiceProxy61c28a82c9a24e96957e32292b924889.Save(Receive instance)
at WcfInterfaceService.MobileServices.SaveReceiveLines(IEnumerable1 receiveLines, String warehouseCode, String username, String deviceNumber, Boolean removeOldReceiveLines) in D:\Project Docs\Clients\ClientX 09.08\Projects\ProjectX\ProjectX.WcfInterfaceService\MobileServices.svc.cs:line 567
at WcfInterfaceService.MobileServices.ProcessReceiveResults(List1 receiveLines, String warehouseCode, String username, String deviceNumber) in D:\Project Docs\Clients\ClientX 09.08\Projects\ProjectX\ProjectX.WcfInterfaceService\MobileServices.svc.cs:line 770
at WcfInterfaceService.MobileServices.ProcessResultsFromMobile(String receiveResult, String warehouseCode, String username, String deviceNumber) in D:\Project Docs\Clients\ClientX 09.08\Projects\ProjectX\ProjectX.WcfInterfaceService\MobileServices.svc.cs:line 668
Are you running SQL Server 2008? I ran into this same error today when using SQL Server 2008. On the database I had set the column to "date" instead of "datetime" because I do not care about the time portion. But there isn't a "date" data type in .NET so you use datetime.
For me I was passing along null datetime values which defaults to something like 1/1/0001 12:00:00 AM. So I was getting the same error you are seeing because it included the time portion.
For me I had to make my datetime value nullable and I also had to use the MsSql2008Dialect in NHibernate which supports the date datatype. More info about NHibernate and SQL Server 2008 here.
I'd check to make sure your database data type is set correctly and that you are using the MsSql2008Dialect if you are using SQL Server 2008.
I have two questions before I can give you an answer:
What kind of database do you use?
What kind of date is causing the exception?
Guess: you are using a database that has a smaller datetime range or accuracy than you use in your code. In that case, the exception is not caused by NHibernate, but by a feature of the database. It's not a bug but a feature.