U4-3118 - Install of Umbraco 7, can't get to backend.

Created by Kenny Gutierrez 11 Oct 2013, 18:13:31 Updated by Sebastiaan Janssen 18 Nov 2013, 14:02:46

Dump of UmbracoTraceLog.txt

2013-10-11 13:08:04,665 [7] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 30] An unhandled exception occurred System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerator1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JArray.GetEnumerator()'. at Umbraco.Web.UI.JavaScript.CssInitialization.ParseMain(JArray files) at Umbraco.Web.UI.JavaScript.CssInitialization.GetStylesheetInitialization() at Umbraco.Web.Editors.BackOfficeController.Application() 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.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.b__41() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult _) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 2013-10-11 13:08:04,670 [7] INFO Umbraco.Core.PluginManager - [Thread 29] Starting resolution types of Umbraco.Web.Trees.TreeController 2013-10-11 13:08:04,670 [7] INFO Umbraco.Core.PluginManager - [Thread 29] Completed resolution of types of Umbraco.Web.Trees.TreeController, found 4 (took 0ms) 2013-10-11 13:08:04,816 [7] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 15] An unhandled exception occurred System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerator1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JArray.GetEnumerator()'. at Umbraco.Web.UI.JavaScript.CssInitialization.ParseMain(JArray files) at Umbraco.Web.UI.JavaScript.CssInitialization.GetStylesheetInitialization() at Umbraco.Web.Editors.BackOfficeController.Application() 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.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass81.b__7(IAsyncResult _) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.b__20() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Comments

Sebastiaan Janssen 11 Oct 2013, 18:26:38

Looks like a NuGet issue that I tried to fix.. but seems like I failed.

If you start a new MVC project in VS, it will copy an old version of Newtonsoft.Json.dll into the bin by default. If you then install Umbraco via NuGet, we require a newer version of that dll. For some reason upon build the version in the bin folder does not get overwritten. Fix it by deleting the Newtonsoft.Json.dll file from your bin folder and then building the solution. This should copy in version 5.0.6 and everything should run fine from there on out.

What I TRIED to do was during the Umbraco NuGet install, as powershell script runs and it should delete this old version automatically. Looks like it doesn't work correctly though.


Stephan Lonntorp 15 Oct 2013, 11:38:49

I downloaded the Umbraco7.0.0-beta.zip, and that one only contains the 5.0.6 assembly, and I get the same error.


Sebastiaan Janssen 15 Oct 2013, 11:54:04

What error is in your log file (the last few entries are relevant or attach the file).


Stephan Lonntorp 15 Oct 2013, 11:56:48

2013-10-15 13:44:11,850 [43] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 55] An unhandled exception occurred System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerator1<Newtonsoft.Json.Linq.JToken> Newtonsoft.Json.Linq.JArray.GetEnumerator()'. at Umbraco.Web.UI.JavaScript.CssInitialization.ParseMain(JArray files) at Umbraco.Web.UI.JavaScript.CssInitialization.GetStylesheetInitialization() at Umbraco.Web.Editors.BackOfficeController.Application() at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.b__20() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Sebastiaan Janssen 15 Oct 2013, 11:58:45

@Stephan Can't repro. Care to zip up the site and Dropbox it for me?


Sebastiaan Janssen 15 Oct 2013, 12:40:01

@Stephan you might want to remove that file as it includes sensitive info.


Sebastiaan Janssen 15 Oct 2013, 12:46:17

Unfortunately, that works fine on my machine. It's going to require some more investigation on your machine I'm afraid. Check your permissions and that the app pool is set to .net 4.5, that's the only thing I can think of at the moment.


Stephan Lonntorp 15 Oct 2013, 12:50:48

OK, if it works for you, then it'll work for me...eventually :) Thanks!

I'll report back with any findings, since this could probably affect others as well.


Sebastiaan Janssen 15 Oct 2013, 12:55:01

Yes please, thanks!


Sebastiaan Janssen 15 Oct 2013, 12:56:06

Could be this?? "I found that something add version 4.5 to the GAC, and the assembly version isn't incremented for every build, so the GAC version is loaded over the local version. I fixed it by downloading the source and building it with an updated Assembly version number greater than 4.5." https://json.codeplex.com/workitem/24346


Stephan Lonntorp 16 Oct 2013, 08:47:34

Yes Sebastiaan, it seems as that is the issue. However, the assembly versions are the same in the two versions, making it impossible to override with an assembly redirect in web.config. It also seems a bit far fetched to build a custom version of the JSON.NET library for umbraco. For now, I think the solution is to uninstall the old assembly from the GAC, although that might break other applications.


Stephan Lonntorp 16 Oct 2013, 09:02:15

https://github.com/JamesNK/Newtonsoft.Json/pull/141


Sebastiaan Janssen 16 Oct 2013, 09:06:45

@Stephan Sheesh, why the F are the assembly versions the same, that's insane! Ok, read up on it here: http://james.newtonking.com/archive/2012/04/04/json-net-strong-naming-and-assembly-version-numbers

I wonder if we can trick assembly redirects to pick the bin folder one though.. Hmmm.


Stephan Lonntorp 16 Oct 2013, 09:12:39

That's the issue, with a static assembly version, it won't be overridable from the version in the GAC, since that version is loaded first. http://stackoverflow.com/questions/6298830/force-load-an-assembly-from-the-bin-and-not-the-gac


Sebastiaan Janssen 16 Oct 2013, 09:14:47

Grrr.. Out of curiosity: why is it in the GAC for you?


Stephan Lonntorp 16 Oct 2013, 09:29:24

I don't know, it was probably put there by some installer, (might be EPiServer, I don't know), and I can't seem to uninstall it...


Tony Southworth 16 Oct 2013, 09:33:10

I'm getting this issue but I can't see Newtonsoft.Json.dll in the GAC. I have also got Episerver installed.


Sebastiaan Janssen 16 Oct 2013, 09:45:26

Tony: NuGet Install?


Tony Southworth 16 Oct 2013, 09:54:08

I tried NuGet first but then also tried fresh project from the zip download.


Sebastiaan Janssen 16 Oct 2013, 09:57:18

@Tony then you should investigate which version of Json.Net is loaded and why. Out of the box it works fine if there's no old version in the GAC or the bin.


Tony Southworth 16 Oct 2013, 10:57:36

I tried uninstalling it from the GAC but it won't let me:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>gacutil /u Newtonsoft.Json Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.17929 Copyright (c) Microsoft Corporation. All rights reserved.

Assembly: Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL Unable to uninstall: assembly is required by one or more applications Pending references: SCHEME: <WINDOWS_INSTALLER> ID: DESCRIPTION : Number of assemblies uninstalled = 0 Number of failures = 0

I also tried copying over that version with the one in the Umbraco bin folder, but still getting the same error. How can I find out which version is loaded?


Sebastiaan Janssen 16 Oct 2013, 11:02:09

@Tony if the backoffice is not working then the wrong version is loaded. We're thinking of adding an exception saying the wrong version is loaded. All in all it's not an easy thing to fix it seems. :(


Stephan Lonntorp 16 Oct 2013, 11:25:51

I solved it! Run gacutil with the /if switch and specify the new assembly to install. That will forcefully install the new assembly to the GAC.

gacutil /if Newtonsoft.Json.dll


Joe Payne 16 Oct 2013, 11:39:43

I had this same problem. Did not see a Newtonsoft dll in GAC. Forced the assembly install from the /bin/ folder with gacutil /if Newtonsoft.Json.dll using the VS command line. Bounced my IIS service and immediately had admin interface.


Tony Southworth 16 Oct 2013, 11:53:21

Yeah that works and I can see the login page. I can't login but that is probably a separate issue :)


Sebastiaan Janssen 18 Nov 2013, 14:02:35

We're now using the 4.5.x versions of json.net again, this should not be a problem any more.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version: 7.0.0

Sprint:

Story Points:

Cycle: