Tips to Login Issues with Umbraco Upgrades
I was recently doing an upgrade for the Offroadcode website, as it was a bit behind - I find when working on lots of awesome client projects, our own websites are always the ones that get neglected! - and I finally had some time to give it a bit of love. We weren't that far behind (as of the writing of this post, the current version of Umbraco is 7.11.1), being on 7.6.0. I mean, it's a big enough jump, but not the worst I've done.
I admit, I wasn't expecting any problems because Umbraco upgrades in v7 are very smooth, but I did run into one! And, according to the forums, multiple people were having similar problems, too. The big difference between me and them is that my issues were happening after having upgraded to 7.6, and everyone else was reporting these issues before 7.6, saying they cleared up after upgrading to that version. So, after much forum hunting and Googling, I thought it might be a good idea to go through what the issue was, what I tried, and what worked to fix it to a smooth, successful upgrade to 7.11.1!
What looked like the problem: After merging in all the upgrade files and loading the site to authorize the upgrade, I couldn't log in with an account that I know works.
What was the actual problem: Initial frustration usually leads to me going to the error logs, where I hope to find some forum searching golddust, and that's exactly what happened here. I ended up with this giant bad boy:
2018-07-03 11:20:47,150 [P17668/D6/T13] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Exception (4d2668cd). System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'umbracoUser2UserGroup'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass5_0.b__0() at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) at Umbraco.Core.Persistence.Database.d__115`1.MoveNext() ClientConnectionId:e04eabb6-a39c-4d5c-8931-93b98d6062c8 Error Number:208,State:1,Class:16
Oof! Whenever there's an invalid object name on a SQL command, that always makes me concerned... am I missing a table? Luckily, nothing to be so scared of.
If you're finding that you can't log in to authorize an upgrade in Umbraco, check your logs, and discover some errors revolving around Invalid object name 'umbracoUser2UserGroup', then there are two things that you can try:
This is probably your culprit and is the quickest fix. In your web.config, find:
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" />
Now add the useLegacyEncoding="true" attribute to the element so that it looks like:
<add name="UsersMembershipProvider" useLegacyEncoding="true" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" />
If that doesn't fix it, then the other culprit could be custom HTTP modules. Check the web.config for any and disable them as well as look at IIS to see if there are any installed through there. This often happens when we inherit a legacy site that we're doing an upgrade on and aren't aware of the modules. The people who have reported this have spoken of different HTTP modules rather than one specific one that is causing an error. You can find out more about it in this forum post.
To be honest with you, I've never run into this issue before, and I have a feeling if I do in the future, it's going to be that little legacy encoding tweak. But if it isn't, knowing ahead of time what other things to try could solve me a lot of pain early on in my debugging process!
Love this? Give it a tweet!