Hi All:
TL:DR;
is there a way to check for data integrity in v8 schema and up? The DB schema is valid after migration, but there is something IN the data itself that kicking an edge case and very weird bug in the NuCache service.
The story:
I am working on a migration from V7 to V13 from a few months now. It’s been a bumpy but funny road and when we finally made it to create a migration checklist for DB, migrated views and custom code, I am having trouble migrating the production database.
The staging test DB (which really is a snapshot from production DB about 4 years ago) was migrated successfully and the final migrated V13 version works beautifully in staging. But when it is time to migrate production DB I cannot get past V8 because of this error during v8 first launch:
{
"@t": "2026-03-08T18:02:27.2086443Z",
"@mt": "Panic, exception while loading cache data.",
"@l": "Fatal",
"@x": "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: handle
at CSharpTest.Net.IO.TransactedCompoundFile.Read(UInt32 handle)
at CSharpTest.Net.Storage.BTreeFileStoreV2.TryGetNode[TNode](IStorageHandle handleIn, TNode& node, ISerializer`1 serializer)
at CSharpTest.Net.Collections.BPlusTree`2.StorageCache.FetchFromStore`1.CreateValue(IStorageHandle key, Object& value)
at CSharpTest.Net.Collections.LurchTable`2.InternalInsert[T](Int32 hash, TKey key, Int32& added, T& value)
at CSharpTest.Net.Collections.LurchTable`2.Insert[T](TKey key, T& value)
at CSharpTest.Net.Collections.LurchTable`2.AddOrUpdate[T](TKey key, T& createOrUpdateValue)
at CSharpTest.Net.Collections.BPlusTree`2.StorageCache.TryGetNode[TNode](IStorageHandle handle, TNode& tnode, ISerializer`1 serializer)
at CSharpTest.Net.Collections.BPlusTree`2.NodeCacheNone.Lock(NodePin parent, LockType ltype, NodeHandle child)
at CSharpTest.Net.Collections.BPlusTree`2.Enumerator.SeekNext(NodePin thisLock, TKey key, NodePin& pin, Int32& offset, TKey& nextKey, Boolean& hasMore)
at CSharpTest.Net.Collections.BPlusTree`2.Enumerator.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.LoadEntitiesFromLocalDbLocked(Boolean onStartup, BPlusTree`2 localDb, ContentStore store, String entityType)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.LoadContentFromLocalDbLocked(Boolean onStartup)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.LockAndLoadContent(Func`2 action)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.<EnsureCaches>b__36_0()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.EnsureCaches()
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.Notify(JsonPayload[] payloads, Boolean& draftChanged, Boolean& publishedChanged)
at Umbraco.Web.Cache.ContentCacheRefresher.NotifyPublishedSnapshotService(IPublishedSnapshotService service, AppCaches appCaches, JsonPayload[] payloads)
at Umbraco.Web.Cache.ContentCacheRefresher.Refresh(JsonPayload[] payloads)
at Umbraco.Core.Sync.ServerMessengerBase.Deliver[TPayload](ICacheRefresher refresher, TPayload[] payload)
at Umbraco.Web.Cache.DistributedCache.RefreshByPayload[TPayload](Guid refresherGuid, TPayload[] payload)
at Umbraco.Web.Cache.DistributedCacheExtensions.RefreshAllContentCache(DistributedCache dc)
at Umbraco.Web.Cache.DistributedCacheExtensions.RefreshAllPublishedSnapshot(DistributedCache dc)
at Umbraco.Core.Migrations.MigrationPlan.Execute(IScope scope, String fromState, IMigrationBuilder migrationBuilder, ILogger logger)
at Umbraco.Core.Migrations.Upgrade.Upgrader.Execute(IScopeProvider scopeProvider, IMigrationBuilder migrationBuilder, IKeyValueService keyValueService, ILogger logger)
at Umbraco.Core.Migrations.Install.DatabaseBuilder.UpgradeSchemaAndData(MigrationPlan plan)",
"SourceContext": "Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService",
"ProcessId": 33980,
"ProcessName": "w3wp",
"ThreadId": 84,
"AppDomainId": 4,
"AppDomainAppId": "LMW3SVC16ROOT",
"MachineName": "ASUSPONTI",
"Log4NetLevel": "FATAL",
"HttpRequestNumber": 7,
"HttpRequestId": "95a2b584-0d34-4490-ade9-5f4cf1a09797"
}
And, as you can imagine right now, the migration does not finishes, rollsback and back to square one, I mean, v7.
At some point, I don’t know exactly what I did, I managed to get past v8 and got to v10, but even then it failed miserably with this same exact error.
So, obviously, there is something weird with the data itself that is making NuCache lose its mind, but I don’t know how to pin-point it. And I am sure that it is the data instead of the structure because it says (in the log) that this is a post-migration task and it really starts to care about the data when populating the cache (I think).
Then, I need help creating/finding/figuring out a way or tool to check the validity or correctness of the content of each field of every content node in order to find the culprit and take action.
For the time being, it is being hosted locally with IIS and SQL Server 19 during the migration tasks.
Any ideas would be really appreciated.
Thanks in advance,
Daniel.