Quantcast
Channel: Brian Pedersen's Sitecore and .NET Blog
Viewing all articles
Browse latest Browse all 285

Sitecore.Web.Authentication.c__DisplayClass5.b__2(Ticket ticket) +52

$
0
0

When logging into the Sitecore client you can run into this exception:

[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.Web.Authentication.<>c__DisplayClass5.<GetExistingTicket>b__2(Ticket ticket) +52
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +168
Sitecore.Web.Authentication.TicketManager.CreateTicket(String userName, String startUrl, Boolean persist) +75
Sitecore.Pipelines.LoggedIn.Ticket.Process(LoggedInArgs args) +58

Or this exception:

[ArgumentException: Empty strings are not allowed.
Parameter name: value]
Sitecore.Web.Authentication.Ticket.set_StartUrl(String value) +255
Sitecore.Web.Authentication.Ticket.Parse(String ticket) +349
Sitecore.Web.Authentication.TicketManager.GetTickets() +319
Sitecore.Web.Authentication.TicketManager.CreateTicket(String userName, String startUrl, Boolean persist) +62
Sitecore.Pipelines.LoggedIn.Ticket.Process(LoggedInArgs args) +59

Both exception cast from the Sitecore login dialog:

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +398
Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +327
Sitecore.Pipelines.Pipeline.Start(String pipelineName, PipelineArgs args, Boolean atomic) +197
Sitecore.sitecore.login.LoginPage.Login_LoggedIn(Object sender, EventArgs e) +330
System.Web.UI.WebControls.Login.AttemptLogin() +289
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +105
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +84
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804

The reason is that the Ticket property in the CORE database of your solution have gone pair-shaped:

Properties table from CORE database

Properties table from CORE database

This can happen if you:

  • Run update scripts (it happened for me when updating from Sitecore 7.1 to 7.2)
  • Have 2 Sitecore installations accessing the same database in:
    • Different .NET versions
    • Different Sitecore versions

To solve it, delete any SC_TICKET properties from the CORE database:

delete from [YourSitecore_Core].[dbo].[Properties]
where [key] = 'SC_TICKET';

Then restart your .NET application, and you should be fine again.

 



Viewing all articles
Browse latest Browse all 285

Trending Articles