U4-7836 - YSOD when upgrading Umbraco with error during AddUserDataClaims

Created by Claus Jensen 18 Jan 2016, 13:58:43 Updated by Sebastiaan Janssen 26 Jan 2016, 18:25:10

Upgrading from 7.2.8 to 7.3.5 breaks with exceptions:

2016-01-15 20:15:44,657 [P1592/D9/T160] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step UmbracoVersion failed.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at System.Security.Claims.Claim..ctor(String type, String value, String valueType, String issuer, String originalIssuer, ClaimsIdentity subject, String propertyKey, String propertyValue)
   at Umbraco.Core.Security.UmbracoBackOfficeIdentity.AddUserDataClaims()
   at Umbraco.Web.Security.WebAuthExtensions.SetPrincipalForRequest(HttpContextBase httpContext, UserData userData)
   at Umbraco.Web.Security.WebSecurity.PerformLogin(Int32 userId)
   at Umbraco.Web.Install.InstallSteps.SetUmbracoVersionStep.Execute(Object model)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)

Comments

Shannon Deminick 26 Jan 2016, 16:07:02

PR: https://github.com/umbraco/Umbraco-CMS/pull/1057

This fixes an old issue that we were auto-logging in the user with Id '0' when upgrading when this should have only ever happened during new installations. For upgrades, the user is already logged in. This also ensures that no empty/null sections can be added to the user object since this is where the original exception was coming from.


Priority: Task - Pri 1

Type: Bug

State: Fixed

Assignee:

Difficulty:

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.3.6

Sprint: Sprint 7

Story Points:

Cycle: