Closed orchardbot closed 9 years ago
@pszmyd commented:
It's happening randomly, though. You might have to try a couple of times (eg. enabling some module with a couple of dependencies, so the enabling process would take a bit longer) to repro.
kdnmih commented:
I have same problem. I install the orchard cms on Local IIS(windows 7).
@bleroy commented:
@kdnmih: you may be getting the same error message but it may not be the same problem.
@bleroy commented:
@kdnmih: if you have VS11 installed, you will have to either uninstall it or update ORchard to the latest in the 1.x branch. Orchard 1.4 is not compatible with VS11 Beta.
scharada commented:
it is happening to me too.
i am not running it from VS (i have both installed 10 and 11)
it seems to be happening everytime i open multiple pages of the site at the same time which was not happening before this last update.
could autofac be the issue ? look at this link : http://stackoverflow.com/questions/9340828/autofac-with-asp-net-webforms-instances-cannot-be-resolved-and-nested-lifetimes
Levitikon commented:
Could you explain how you're enabling a module for multiple tenants at once? I've been struggling with a quick way to enable modules for 50 some odd tenants. I came up with a batch file to do this:
call bin\Orchard.exe feature enable Contrib.RewriteRules /t:mysite1 call bin\Orchard.exe feature enable Contrib.RewriteRules /t:mysite2
But when I run this on a machine that's also running orchard in IIS with an active application pool, I run into the same error you described.
consigliory commented:
I have the same issue. Is there any work around it?
@Piedone commented:
I noticed the same as scharada. I can pretty reliably reproduce this with opening multiple pages of the same site after a change to the source (something not static or Razor template, that means the instance gets recompiled)
@Piedone commented:
Now I've accidentally found a reliable way to reproduce the error. Steps (may not all be necessary, but I write all of them just in case):
1) Edit some enabled module's .cs file to force a recompile. 2) Place a breakpoint in the same and start debugging (worth noting: I've tried this with Onestop.Tenants, so that means attaching a debugger to an already open IIS process, unlike hitting F5 that recompiles immediately). 3) Open a page that invokes the code with the breakpoint. 4) The breakpoint is hit. Let the execution continue, but after resuming immediately edit the same code and save. 5) Ideally the page you've opened is still loading. Hit refresh. 6) Before the breakpoint is hit the second time, the below exception comes up in Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy ln. 52.
I guess with sites on the server we can reproduce this occasionally when after a recompile somebody is fetching a page, but meanwhile somebody else enables/disables a module or the instance is updated from the repo.
System.ObjectDisposedException was unhandled by user code
Message=Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
Source=Autofac
ObjectName=""
StackTrace:
at Autofac.Core.Lifetime.LifetimeScope.CheckNotDisposed()
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.<>c__DisplayClass4.<CreateDelegate>b__3(DisplayContext context) in D:\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 52 at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in D:\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 55 at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 179 at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 88 at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 71 at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable
1 parameters) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38
at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func1 proceed, Object target, String name, INamedEnumerable
1 args) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27
at ClaySharp.ClayBehaviorCollection.<>cDisplayClass14.<>cDisplayClass16.1 proceed, Func
3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
at ClaySharp.ClayBehaviorCollection.InvokeMember(Func1 proceed, Object self, String name, INamedEnumerable
1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at ASP._Page_Themes_Onestop_CustomAdmin_Views_Layout_cshtml.1 parameters) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38 at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func
1 proceed, Object target, String name, INamedEnumerable`1 args) in D:\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27
at ClaySharp.ClayBehaviorCollection.<>cDisplayClass14.<>cDisplayClass16.1 proceed, Func
3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
at ClaySharp.ClayBehaviorCollection.InvokeMember(Func1 proceed, Object self, String name, INamedEnumerable
1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutAwareViewEngine.<>cDisplayClass7.
@Piedone commented:
OK, I can make the same repro steps with a vanilla instance. Actually at point 4 if you edit the file while the code execution is on hold at the breakpoint it has the same effect then editing it after execution continues (not much of a surprise :-)).
@sebastienros commented:
@Piedone, the repro steps you are describing are nothing to do with this bug which is a bout enabling two tenants at the same time. The one you describe had a similar one fixed for 1.4. I'll try to find how I had fixed it to see if a recent change broke it again. You might want to create another bug for this, so we know which ones we want to fix the sooner.
@Piedone commented:
Fine, I've opened one here: http://orchard.codeplex.com/workitem/18857
@pszmyd commented:
@sebastienroe @Piedone: The underlying problem might be the same for all those "lifetime scope" errors, as they all happen when there is an ongoing shell termination/reloading. For some reason either the lifetime scope gets prematurely disposed, or there are some tasks running that should not be ran at that moment.
@pszmyd commented:
Should be @sebastienros - sorry for the typo;)
LordSaul commented:
We get this same error when creating a new tenant within our deployed environment (Azure web role). Recycling the application pool seemed to make that error go away
@pszmyd commented:
Reopening. This issue still stands. The cause is the work context accessor trying to create new context based on an already disposed shell.
@sebastienros commented:
1.x ?
@pszmyd created: https://orchard.codeplex.com/workitem/18582
I've just ran into this error, when tried to enable/disable a given module on 6 tenants at once.
Server Error in '/' Application.
Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
Source Error:
Line 19: **/ Line 20: Line 21: Func<dynamic, dynamic> Zone = x => Display(x); // Zone as an alias for Display to help make it obvious when we're displaying zones Line 22: Line 23: / Inserting some ad hoc shapes
Source File: c:\inetpub\wwwroot\KS Gateway Pages\Themes\TheAdmin\Views\Layout.cshtml Line: 21
Stack Trace:
[ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.] Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) +407 Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.<>cDisplayClass4.b 3(DisplayContext context) in c:\Work\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:55
Orchard.DisplayManagement.Descriptors.<>cDisplayClass5.b 2(DisplayContext displayContext) in c:\Work\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:55
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\Work\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:179
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\Work\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:88
Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\Work\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71