Error solving and handling

Topics: Troubleshooting
Jun 20, 2013 at 9:41 AM
Hey everyone,

This night my site went down and this morning I had 730 errormails in my inbox.

Below are the errors I received. I've had these errors before but it didn't bring my site offline. It always seems to happen at the same hour (around 4 in the morning CET+1).
The site is hosted on azure websites.

I have 3 questions regarding these errors, it seems the site is restarted and then some modules can't be restarted, modules i've installed but never worked (old ones like google analytics).
How can I cleanly remove these completely?

What is the
2013-06-20 02:08:15,495 [5] ERROR Orchard.Tasks.BackgroundService error and how can I solve it? This seems to be the badboy which crashes the site.

Last question, can I put some kind of treshold on the errormails? For instance it sends only every 15 minutes and gives like "30 occurences where generated"

Now I've got an error every minute which led to the 730 emails....

Kind regards,

Borrie

2013-06-20 02:03:12,771 [7] WARN Orchard.Environment.Extensions.ExtensionLoaderCoordinator

No loader found for extension "Contrib.Cache.Memcached"!

2013-06-20 02:03:12,771 [7] WARN Orchard.Environment.Extensions.ExtensionLoaderCoordinator

No loader found for extension "Contrib.KeepAlive"!

2013-06-20 02:03:12,818 [7] WARN Orchard.Environment.Extensions.ExtensionLoaderCoordinator

No loader found for extension "SH.GoogleAnalytics"!

2013-06-20 02:03:12,958 [7] ERROR Orchard.Environment.DefaultOrchardHost

A tenant could not be started: Default

System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.

at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
at System.Reflection.RuntimeConstructorInfo.GetParameters()
at Orchard.Caching.CacheModule.<AttachToComponentRegistration>b__0(ConstructorInfo x)
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)
at Orchard.Caching.CacheModule.AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration)
at Autofac.Module.<AttachToRegistrations>b__0(Object sender, ComponentRegisteredEventArgs e)
at System.EventHandler1.Invoke(Object sender, TEventArgs e)
at Autofac.Core.Registration.ComponentRegistry.AddRegistration(IComponentRegistration registration, Boolean preserveDefaults)
at Autofac.Core.Registration.ComponentRegistry.Register(IComponentRegistration registration, Boolean preserveDefaults)
at Autofac.Core.Registration.ScopeRestrictedRegistry.Register(IComponentRegistration registration, Boolean preserveDefaults)
at Autofac.Builder.RegistrationBuilder.RegisterSingleComponent[TLimit,TActivatorData,TSingleRegistrationStyle](IComponentRegistry cr, IRegistrationBuilder
3 rb)
at Autofac.RegistrationExtensions.<>c__DisplayClassd.<RegisterType>b__c(IComponentRegistry cr)
at Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules)
at Autofac.ContainerBuilder.Update(IComponentRegistry componentRegistry)
at Autofac.Core.Lifetime.LifetimeScope.CreateScopeRestrictedRegistry(Object tag, Action1 configurationAction)
at Autofac.Core.Lifetime.LifetimeScope.BeginLifetimeScope(Object tag, Action
1 configurationAction)
at Orchard.Environment.ShellBuilders.ShellContainerFactory.CreateContainer(ShellSettings settings, ShellBlueprint blueprint)
at Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings)
at Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings settings)
at Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells()^
Jun 20, 2013 at 9:42 AM
This is the background error:


2013-06-20 02:08:15,495 [5] ERROR Orchard.Tasks.BackgroundService

Error while processing background task

Autofac.Core.DependencyResolutionException: None of the constructors found with ‘Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper’ on type ‘Orchard.Projections.Drivers.ProjectionPartDriver’ can be invoked with the available services and parameters: Cannot resolve parameter ‘Orchard.Tokens.ITokenizer tokenizer’ of constructor ‘Void .ctor(Orchard.IOrchardServices, Orchard.Data.IRepository1[Orchard.Projections.Models.QueryPartRecord], Orchard.Projections.Services.IProjectionManager, Orchard.Core.Feeds.IFeedManager, Orchard.Tokens.ITokenizer, Orchard.DisplayManagement.IDisplayHelperFactory, Orchard.IWorkContextAccessor)’.

at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer
1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Registration.ExternalRegistrySource.<>c__DisplayClass8.<RegistrationsFor>b__3(IComponentContext c, IEnumerable
1 p)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass11.<ForDelegate>b__0(IComponentContext c, IEnumerable1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass2.<CanSupplyValue>b__0()
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.<Execute>b__0()
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable
1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Registration.ExternalRegistrySource.<>c__DisplayClass8.<RegistrationsFor>b__3(IComponentContext c, IEnumerable1 p)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1
1.<ForDelegate>b__0(IComponentContext c, IEnumerable1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass51.<>c__DisplayClass7.<CreateLazyRegistration>b__4()
at System.Lazy
1.CreateValue()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy1.get_Value()
at Orchard.ContentManagement.DefaultContentManager.New(String contentType)
at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints)
at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options)
at Orchard.ContentManagement.DefaultContentQuery.<Slice>b__0(ContentItemVersionRecord x)
at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count)
at Orchard.ContentManagement.DefaultContentQuery.ContentQuery
1.Orchard.ContentManagement.IContentQuery<T>.Slice(Int32 skip, Int32 count)
at Orchard.Core.Settings.Services.SiteService.<GetSiteSettings>b__0(AcquireContext1 ctx)
at Orchard.Caching.Cache
2.CreateEntry(TKey k, Func2 acquire)
at Orchard.Caching.Cache
2.<>c__DisplayClass2.<Get>b__0(TKey k)
at System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func2 addValueFactory, Func3 updateValueFactory)
at Orchard.Caching.Cache
2.Get(TKey key, Func2 acquire)
at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func
2 acquire)
at Orchard.Core.Settings.Services.SiteService.GetSiteSettings()
at Orchard.Settings.CurrentSiteWorkContext.Get[T](String name)
at Orchard.Environment.WorkContextImplementation.<>c__DisplayClass71.<FindResolverForState>b__2(IWorkContextStateProvider wcsp)
at System.Linq.Enumerable.WhereSelectArrayIterator
2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Orchard.Environment.WorkContextImplementation.FindResolverForState[T](String name)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Orchard.Environment.WorkContextImplementation.GetState[T](String name)
at Orchard.WorkContext.get_CurrentSite()
at Orchard.Warmup.Services.WarmupTask.Sweep()
at Orchard.Tasks.BackgroundService.Sweep()
Jul 3, 2013 at 12:46 PM
Anyone? :)
Coordinator
Jul 3, 2013 at 8:42 PM
Attach a debugger and find out?
Jul 4, 2013 at 12:02 PM
well, that answer covers about all of my 3 questions...
Developer
Jul 4, 2013 at 12:26 PM
I would focus on the OutOfMemoryException specifically around this piece of code...

at Orchard.Caching.CacheModule.AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration)

Hmmm... are you on 1.x by and chance? I can see stuff around Site Settings and I know a bug got introduced and reverted, I just wonder if you got the code where the bug was introduced.

The bug was all around the CacheManager and Site Settings.
Jul 4, 2013 at 1:02 PM
Jetski,

Tx for your answer, I'll focus on that, my version is 1.6.0

Do you know how i can treshold the errormails and cleanly (completely) remove unused or faild modules?

Borrie