Authentication issue after changing root_url

  • What Grafana version and what operating system are you using?
    v9.2.0 on RHEL 7.9

  • What are you trying to achieve?
    Run Grafana under subpath /grafana so it can be exposed via a reverse proxy

  • How are you trying to achieve it?
    Set the following in grafana.ini:
    root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
    serve_from_sub_path = true

  • What happened?
    Everything works fine except I am no longer able to login as a specific user. All logins seem to be interpreted as anonymous.

  • What did you expect to happen?
    Keep the behaviour unchanged, i.e., anonymous logins work and admin access works.

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

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No real error. After grafana.ini modification, I get the following in the log file:
    logger=context t=2023-12-12T10:23:27.911692329+01:00 level=warn msg=“Failed to look up user based on cookie” error=“user token not found”
    logger=http.server t=2023-12-12T10:23:27.927703349+01:00 level=info msg=“Successful Login” User=michaje
    logger=context t=2023-12-12T10:23:27.95020427+01:00 level=warn msg=“Failed to look up user based on cookie” error=“user token not found”
    logger=context t=2023-12-12T10:23:28.128200937+01:00 level=warn msg=“Failed to look up user based on cookie” error=“user token not found”

  • Did you follow any online instructions? If so, what is the URL?

Shame on me. Clearing the browser cache did the trick.