Level=error msg="Failed to parse user ID" error="identifier is not initialized"

I deployed Grafana on my Kubernetes Cluster using the latest Docker image and configured it with Azure File Storage credentials via a YAML file. Initially, I encountered a “Database is locked” error, which I resolved by following the steps outlined in this documentation: Deploying Grafana on Azure’s Web Apps for Containers.

After resolving the initial issue, I expected Grafana to run smoothly. However, I am now encountering a new error.

logger=query_data t=2023-12-11T11:20:31.431000046Z level=info msg="Query Service initialization"
logger=live.push_http t=2023-12-11T11:20:31.434538121Z level=info msg="Live Push Gateway initialization"
logger=infra.usagestats.collector t=2023-12-11T11:20:34.143352537Z level=info msg="registering usage stat providers" usageStatsProvidersLen=2
logger=provisioning.alerting t=2023-12-11T11:20:34.14365946Z level=info msg="starting to provision alerting"
logger=provisioning.alerting t=2023-12-11T11:20:34.143677162Z level=info msg="finished to provision alerting"
logger=http.server t=2023-12-11T11:20:34.146431975Z level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket=
logger=ngalert.state.manager t=2023-12-11T11:20:34.159491686Z level=info msg="Warming state cache for startup"
logger=grafanaStorageLogger t=2023-12-11T11:20:34.160370054Z level=info msg="Storage starting"
logger=ngalert.migration t=2023-12-11T11:20:34.187163929Z level=info msg=Starting
logger=ngalert.migration t=2023-12-11T11:20:34.187681569Z level=info msg="No migrations to run"
logger=grafana.update.checker t=2023-12-11T11:20:34.200659574Z level=info msg="Update check succeeded" duration=40.614445ms
logger=ngalert.state.manager t=2023-12-11T11:20:34.205791572Z level=info msg="State cache has been initialized" states=0 duration=46.297086ms
logger=ngalert.scheduler t=2023-12-11T11:20:34.205838676Z level=info msg="Starting scheduler" tickInterval=10s
logger=ticker t=2023-12-11T11:20:34.205968186Z level=info msg=starting first_tick=2023-12-11T11:20:40Z
logger=ngalert.multiorg.alertmanager t=2023-12-11T11:20:34.205914581Z level=info msg="Starting MultiOrg Alertmanager"
logger=plugins.update.checker t=2023-12-11T11:20:34.447035254Z level=info msg="Update check succeeded" duration=286.28837ms
logger=http.server t=2023-12-11T11:21:00.437161976Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
logger=http.server t=2023-12-11T11:21:30.427328482Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
logger=infra.usagestats t=2023-12-11T11:21:58.202838463Z level=info msg="Usage stats are ready to report"
logger=http.server t=2023-12-11T11:22:00.427223343Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
logger=http.server t=2023-12-11T11:22:30.426791842Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
logger=http.server t=2023-12-11T11:23:00.427485996Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
logger=http.server t=2023-12-11T11:23:30.427250842Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
1 Like

Hi,

Did you get resolved this issue?

Also seeing this error in logs after upgrading Grafana from v10.1.1 → 10.2.2. Using Azure for SSO.

"level=error msg="Failed to parse user ID" error="identifier is not initialized"

"msg="Failed to run post auth hook" client=auth.client.session  error="[user.sync.fetch] failed to resolve user: context canceled"
1 Like

I’ve applied the config change as the documentation suggested:

[auth]
oauth_allow_insecure_email_lookup = true

But I’m still seeing this error in my logs:

logger=http.server t=2023-12-31T16:46:43.011916288-05:00 level=error msg="Failed to parse user ID" error="identifier is not initialized"

Any suggestions?

Parse User ID issue which I have resolved by fixing the yaml there is some issue with yaml file if you are using it to Deploy on Kubernetes.

Try to copy the default yaml file and then customize it with specification.

For me after setting that, it worked,
but I’m using DEX oauth not Azure, but my DEX configuration at the moment is pretty bland.

I also set the setting in helm, but I deployed the fix manually into grafana’s configmap grafana.ini
because I needed the fix fast, without waiting on my helm CD

Hi Ravi, the issue was resolved you can check the solution i have given below for that worked.

Hey, @taqirizvi582 can you clarify what yaml file you are referring to.
I deployed the latest image into k8s cluster and I’m facing the same issue

Hi @nickbegmatov

Deploy Grafana on Kubernetes | Grafana documentation

Here you can find the full detail with YAML File for deploying you Grafana on Kubernetes.

Deploying Grafana on Azure’s Web Apps for Containers (rishabkumar.com)

Here is another link which may help you to deploy grafana using File Share as you storage

I’m seeing this issue still, but I’m using basic auth and I’m running from Portainer using a docker-compose.

I think I figured it out. Something in my network is grabbing information using auth.anonymous so I had to add this to my grafana.ini:

[auth.anonymous]
enabled = true

# Organization name that should be used for unauthenticated users
org_name = Main Org.

# Role for unauthenticated users, other valid values are `Editor` and `Admin`
org_role = Viewer

Hope this helps someone else should they encounter the same issue.

1 Like