No anonymous login after migration to 11.1.0

Hi,
after migrating Grafana from 10.4.2 to 11.1.0 (in docker), the anonymous login does not work any more. The log shows

logger=authn.service t=2024-07-10T06:54:13.436700597Z level=warn msg=“Failed to authenticate request” client=auth.client.session error=“user token not found”

I’m using the open source version of Grafana.

Did you check your grafana.ini settings regarding anonymous login are still active after the migration?

Yes, I did:

[auth.anonymous]

enabled = true
;org_name = Main Org.
;org_role = Viewer
;hide_version = false

My ‘migration’ works like this: All grafana data (ini file, database etc.) are stored autside the container in a single directory, and when getting a new grafana version, I create a copy of that directory, and start the new version from that copy. This ensures that all settings are retained through the migration, and it worked very well in the past. Maybe for Grafana 11.1 some additional steps are required ?

Can you try uncommenting the org_name and org_role ?

tried it - same result:

[auth.anonymous]
enabled = true
org_name = Main Org.
org_role = Viewer

Getting again

logger=authn.service t=2024-07-10T11:32:50.676438762Z level=warn msg=“Failed to authenticate request” client=auth.client.session error=“user token not found”

is your org name “Main Org.” ?

Hi, I have never bothered to even uncomment the org_name, so I have the default entries:

Correction 1: The message

logger=authn.service t=2024-07-10T11:32:50.676438762Z level=warn msg=“Failed to authenticate request” client=auth.client.session error=“user token not found”

has probably nothing to do with the problem (which persists). I’m getting the message also on Grafana 10.4.2, where the anonymous login works as expected.

Correction 2:

I noticed, that although I set enabled = true for anonymous login, the setting is displayed as false in the Grafana GUI:

image

It looks like the parameter setting in grafana.ini is simply ignored in 11.1.0:

[auth.anonymous]
enabled = true
device_limit = 44

(I added the parameter device_limit = 44 only to ensure that I’m really editing the correct file)

did you restart grafana after these changes

yes - otherwise I’d not have seen the change on the device_limit which defaults to 0, and was changed by me to 44.

1 Like

so there must be something else in your docker run or something else overriding enabled

are you using a compose file? or running things straight from a cli
docker run -v etc

Oooops, this is embarrassing. You are completely right. The container was created with a few environment variables being set, and among them was

GF_AUTH_ANONYMOUS_ENABLED=false

which of course superseeded the setting in grafana.ini. Without it, it works as before. My bad - I simply forgot to check that

Thank you for your help.

1 Like