# Sporadical Error on Login

**URL:** <https://forum.keycloak.org/t/sporadical-error-on-login/4801>\
**Category:** Getting advice\
**Tags:** authentication\
**Created:** [September 10, 2020, 10:35am UTC](https://forum.keycloak.org/t/sporadical-error-on-login/4801 "2020-09-10T10:35:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwlczk](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mwlczk/32/1324_2.png) [@mwlczk](https://forum.keycloak.org/u/mwlczk)\
**Post date:** [September 10, 2020, 10:35am UTC](https://forum.keycloak.org/t/sporadical-error-on-login/4801/1 "2020-09-10T10:35:37Z")

</div>

Sometimes we get an error after submitting the credentials.

Our logs:

2020-08-04 09:00:03,797 DEBUG [org.jboss.resteasy.resteasy\_jaxrs.i18n] (default task-73) USERNAME: PathInfo: /realms/[REALMNAME]/login-actions/authenticate  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.resources.SessionCodeChecks] (default task-73) Will use client ‘[CLIENTNAME]’ in back-to-application link  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH\_SESSION\_ID, trying AUTH\_SESSION\_ID\_LEGACY  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH\_SESSION\_ID cookie  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH\_SESSION\_ID, trying AUTH\_SESSION\_ID\_LEGACY  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH\_SESSION\_ID cookie  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH\_SESSION\_ID, trying AUTH\_SESSION\_ID\_LEGACY  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH\_SESSION\_ID cookie  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.resources.SessionCodeChecks] (default task-73) Authentication session not found. Trying to restart from cookie.  
2020-08-04 09:00:03,797 DEBUG [org.keycloak.protocol.RestartLoginCookie] (default task-73) KC\_RESTART cookie doesn’t exist  
2020-08-04 09:00:03,797 WARN [org.keycloak.events] (default task-73) type=LOGIN\_ERROR, realmId=[REALMNAME], clientId=null, userId=null, ipAddress=[SOMEIPADDRESS], error=invalid\_code

We tried with an old KC 7.0.0 and KC 10.0.2 and different browsers. We can see in the browser that there’s no KC\_RESTART cookie.  
We have keycloak behind a loadbalancer and a reverse proxy.

Any idea what’s wrong?

Is there a way to show the login form again instead of the error message?

Thanks for help
