1

I am seeing an issue in logging to sitecore 9.3 instance.. When i hit the url like https://{domainname}/sitecore. It gets redirected to Sitecore identity server login page. I enter user name password and click on ok button. I see the error message on browser: Error: An error occurred This issue started coming when i published my code to Sitecore instance sitecore TDS, before publishing code. It did not see any issue. Login was successful and was getting redirected to content editor.

The thing is when I browse Sitecore identity server from IIS directly and login there, I do not see any issue. I get logged in successfully.

Please help me how to troubleshoot this issue. not getting any direction.

3
  • What steps have you taken to rollback the changes published by TDS? Sounds like a problem specific to your setup. May 11, 2020 at 14:46
  • Thanks Michael for looking into my question! i have not rolled back even i have not thought about rollback.. because my site is working after publishing code to sitecore instance.i can see the contents are coming from sitecore to website.. the only thing when it try to access sitecore content editor .. hit the sitecore url .. gets redirected to sitecore identity server login page.. supplied credential ..the error occurred.. .. not sure how i will roll back the code.. if that is the option to go for.. May 11, 2020 at 14:58
  • I had this issue and it turned out to be a duplicate name. Message: Unable to create a user. Reason: DuplicateUserName Source: Sitecore.Owin.Authentication Aug 21, 2020 at 19:15

5 Answers 5

2

I am facing the same issue with Sitecore 9.1, in summary the issue is Sitecore not being able to handle long ticket in Core database

Sitecore has a cleanup task that should take care of cleaning the tickets in the database but for some reason it is not performing, and if you could check your logs and see if you have something similar

ManagedPoolThread #2 12:04:16 INFO Job started: Sitecore.Tasks.CleanupAuthenticationTicketsAgent ManagedPoolThread #2 12:04:16 INFO CleanupAuthenticationTicketsAgent: Number of expired authentication tickets that have been removed: 0 ManagedPoolThread #2 12:04:16 INFO CleanupAuthenticationTicketsAgent: Total number of authentication tickets to process: 0 ManagedPoolThread #2 12:04:16 INFO Job ended: Sitecore.Tasks.CleanupAuthenticationTicketsAgent (units processed: )

OR

20892 10:35:42 ERROR String or binary data would be truncated. The statement has been terminated. Exception: System.Exception Message: String or binary data would be truncated. The statement has been terminated. Source: Sitecore.Kernel at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteNonQuery() at Sitecore.Data.DataProviders.Sql.SqlDataApi.<>c__DisplayClass33_0.b__0() at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover) at Sitecore.Data.Properties.SqlPropertyStore.SetStringValueCore(String prefixedName, String value) at Sitecore.Data.Properties.PropertyStore.SetStringValue(String name, String value) at Sitecore.Web.Authentication.DefaultTicketManager.CreateTicket(String userName, String startUrl, Boolean persist) at Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn.CreateTicket.Process(SignedInArgs args) at (Object , Object )

Nested Exception

Exception: System.Data.DataException Message: Error executing SQL command: INSERT INTO [Properties] ( [Key], [Value] ) VALUES ( @name, @value )

I hope you are able to find similar entries, however, if that's not the case, please give a shot using the following command in your SQL against the Core database as a workaround and please note this is going to kill ALL sessions connected to CM

DELETE FROM [yourCoreDatabase].[dbo].[Properties] WHERE [Key] LIKE '%CORE_SC_TICKET%'

I am currently working with Sitecore Support since it seems that was fixed on Sitecore 9.0.1 and Sitecore 9.0.2 but newer versions are still facing such issue.

References: https://viniciusdeschamps.com.br/error-an-error-occurred-after-logging-in-sitecore/

2

If using SPE you can clear up all or even for a specific user. I'm using Sitecore 9.3 and still see this issue happening.

Import-Function -Name Invoke-SqlCommand

$connection = [Sitecore.Configuration.Settings]::GetConnectionString("core")

$query = @"
DELETE FROM [dbo].[Properties]
WHERE dbo.Properties.[Key] LIKE 'CORE_SC_TICKET%'
AND dbo.Properties.[Value] LIKE '%mwest%'
"@
Invoke-SqlCommand -Connection $connection -Query $query
1

In my case after removing the custom configuration of Publish:end event resolved the issue.

    <events>
  <event name="publish:end">
    <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
        ....
        ....
     </handler>
  </event> </events>
0

Although the message "an error occured” is of course useless, I have found that when this occurs, there are also errors logged in the Sitecore logs. Check those.

1
  • I took care of this issue by rolling back TDS deployment and followed manual deployment of files manually . So no issue at login now. May 13, 2020 at 17:25
0

This issue exists on 9.3 still. There are a number of other SSE posts that talk about this too, e.g: Sitecore 9.1 When a specific user is trying to login we see a blank "An Error occurred screen" and Can SC_TICKET* keys be purged from the Properties table, and have tickets been moved elsewhere?

It seems that in 9.3 (or in our case at least) the names of the ticket records has changed again to be prefixed with 'WEB_SC_TICKET__' and they were in the Web database, not Core.

So we ran the following on the Web DB to view them:

Select * FROM [dbo].[Properties]

WHERE dbo.Properties.[Key] LIKE 'WEB_SC_TICKET__%'

AND dbo.Properties.[Value] LIKE '%admin%'

Then then following to remove them:

Delete FROM [dbo].[Properties]

WHERE dbo.Properties.[Key] LIKE 'WEB_SC_TICKET__%'

AND dbo.Properties.[Value] LIKE '%admin%'

Hopefully this is useful for others who hit this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.