Attempt Upgrade to 1.7: Object reference not set to an instance of an object. at Orchard.Localization.Text

Topics: Core, Localization
Oct 29, 2013 at 7:24 PM
We're attempting to upgrade an Orchard 1.6 site to Orchard 1.7.1. After copying the new code on top of the old and rebuilding, we start the site, and attempt to enable the Upgrade module. We get the following error:



An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back

One or more errors occurred.

System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Localization.Text.Get(String textHint, Object[] args) in c:\Cloud\TritonDigital_1.7\src\Orchard\Localization\Text.cs:line 27 at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 123 at Orchard.Environment.Extensions.ExtensionManager.<>c__DisplayClass12.<LoadFeatures>b__11(AcquireContext1 ctx) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 95 at Orchard.Caching.Cache2.CreateEntry(TKey k, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 57 at Orchard.Caching.Cache2.AddEntry(TKey k, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 27 at Orchard.Caching.Cache2.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 19 at System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func2 addValueFactory, Func3 updateValueFactory) at Orchard.Caching.Cache2.Get(TKey key, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 17 at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultCacheManager.cs:line 33 at Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__10(FeatureDescriptor descriptor) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 95 at Orchard.Caching.DefaultParallelCacheContext.<>c__DisplayClass52.<>c__DisplayClass7.<RunInParallel>b__1() in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 24 at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext1.Execute() in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 71 at Orchard.Caching.DefaultParallelCacheContext.<RunInParallel>b__2[T,TResult](ITask1 task) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 30 at System.Linq.Parallel.SelectQueryOperator2.SelectQueryOperatorResults.GetElement(Int32 index) at System.Linq.Parallel.ArrayMergeHelper1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator1.ForAllEnumerator1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Linq.Parallel.QueryTask.<.cctor>b__0(Object o) at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) at System.Linq.Parallel.SpoolingTask.SpoolForAll[TInputOutput,TIgnoreKey](QueryTaskGroupState groupState, PartitionedStream2 partitions, TaskScheduler taskScheduler) at System.Linq.Parallel.DefaultMergeHelper2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() at System.Linq.Parallel.MergeExecutor1.Execute[TKey](PartitionedStream2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger1.Receive[TKey](PartitionedStream2 partitionedStream) at System.Linq.Parallel.ForAllOperator1.WrapPartitionedStream[TKey](PartitionedStream2 inputStream, IPartitionedStreamRecipient1 recipient, Boolean preferStriping, QuerySettings settings) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream2 inputStream) at System.Linq.Parallel.ScanQueryOperator1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient1 recipient) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient1 recipient) at System.Linq.Parallel.QueryOperator1.GetOpenedEnumerator(Nullable1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) at System.Linq.Parallel.ForAllOperator1.RunSynchronously() at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery1 source, Action1 action) at System.Linq.Parallel.ArrayMergeHelper1.Execute() at System.Linq.Parallel.QueryOperator1.ExecuteAndGetResultsAsArray() at System.Linq.ParallelEnumerable.ToArray[TSource](ParallelQuery1 source) at Orchard.Caching.DefaultParallelCacheContext.RunInParallel[T,TResult](IEnumerable1 source, Func2 selector) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 27 at Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable1 featureDescriptors) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 93 at Orchard.Modules.Services.ModuleService.<GetAvailableFeatures>b__0(ExtensionDescriptor m) at System.Linq.Enumerable.<SelectManyIterator>d__142.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Orchard.Modules.Controllers.AdminController.FeaturesPOST(FeaturesBulkAction bulkAction, IList1 featureIds, Nullable1 force) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Localization.Text.Get(String textHint, Object[] args) in c:\Cloud\TritonDigital_1.7\src\Orchard\Localization\Text.cs:line 27 at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 123 at Orchard.Environment.Extensions.ExtensionManager.<>c__DisplayClass12.<LoadFeatures>b__11(AcquireContext1 ctx) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 95 at Orchard.Caching.Cache2.CreateEntry(TKey k, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 57 at Orchard.Caching.Cache2.AddEntry(TKey k, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 27 at Orchard.Caching.Cache2.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 19 at System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func2 addValueFactory, Func3 updateValueFactory) at Orchard.Caching.Cache2.Get(TKey key, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\Cache.cs:line 17 at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func2 acquire) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultCacheManager.cs:line 33 at Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__10(FeatureDescriptor descriptor) in c:\Cloud\TritonDigital_1.7\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 95 at Orchard.Caching.DefaultParallelCacheContext.<>c__DisplayClass52.<>c__DisplayClass7.<RunInParallel>b__1() in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 24 at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext1.Execute() in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 71 at Orchard.Caching.DefaultParallelCacheContext.<RunInParallel>b__2[T,TResult](ITask1 task) in c:\Cloud\TritonDigital_1.7\src\Orchard\Caching\DefaultParallelCacheContext.cs:line 30 at System.Linq.Parallel.SelectQueryOperator2.SelectQueryOperatorResults.GetElement(Int32 index) at System.Linq.Parallel.ArrayMergeHelper1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator1.ForAllEnumerator1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Linq.Parallel.QueryTask.<.cctor>b__0(Object o) at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute()<---


The same error occurs when trying to disable or upgrade other modules.
Developer
Oct 30, 2013 at 11:06 PM
Although I'm not sure why you get this error (aren't any of your modules trying to access the Localizer - T() - in a migration?) you wouldn't get it with the latest source (there's a null check in Text.cs for that).