Failed to look up user based on cookie issue

  • What Grafana version and what operating system are you using?
    7.5.5-1 (Amazon Linux 2)

  • What are you trying to achieve?
    We are setting up HA cluster for Grafana

  • How are you trying to achieve it?
    We have Load Balancer in place and behind two grafana instances running with Mysql replication as master-master. We have configured grafana to restore dashboards, user data, session in Mysql backend database.

  • What happened?
    When we are logging in immediately we are logging out with an error ‘Unauthorized’ in browser whereas in grafana.log we are getting an error , "lvl=eror msg=“Failed to look up user based on cookie” logger=context error=“user token not found”

  • What did you expect to happen?
    We should not logged.

  • Can you copy/paste the configuration(s) that you are having problems with?


protocol = http

root_url = http://localhost:3000

type = mysql
host =
name = XXXXXXX
user = XXXXXX
password = xxxxxx

log_queries = true
provider = mysql
provider_config = XXXXX:XXXXXXXXX@tcp(






login_hint = Enter LDAP User ID







enabled = true
config_file = /etc/grafana/ldap.toml
allow_sign_up = true
enabled = true

host = localhost:25

from_address = admin@grafana.localhost
from_name = Grafana
ehlo_identity =


level = error








;url =




disable_sanitize_html = true


filters = “ldap:debug”
host = “
port = XXX
use_ssl = true
start_tls = false
ssl_skip_verify = false
root_ca_cert = “/etc/cert/XXXXXXXX”
bind_dn = “CN=XXXXXXXX,OU=Service Accounts,OU=XXXXX,OU=XXXXXX,OU=Servers and Services,DC=XXXXXX,DC=XXXXXX”
bind_password = ‘XXXXXXXX’
search_filter = “(sAMAccountName=%s)”
search_base_dns = [“DC=XXXXXXX,DC=com”]
name = “givenName”
surname = “sn”
username = “sAMAccountName”
member_of = “memberOf”
email = “email”
org_role = “Admin”
org_role = “Editor”
org_role = “Viewer”

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

After login (with Ldap user ) we get an error “unauthorised” and logged out. In grafana error logs getting following error
lvl=eror msg=“Failed to look up user based on cookie” logger=context error=“user token not found”

  • Did you follow any online instructions? If so, what is the URL?
    Yes we tried all possible solution posted on different grafana community and other links but still having the same issue.

Hello All Community members,

Kindly help to resolve above issue.

Thanks in Advance.

This topic was automatically closed after 365 days. New replies are no longer allowed.