Getting error "Error while trying to authenticate user"

I’m trying to authenticate Grafana users with Active Directory but it is not working. and I got the following error log;

t=2019-05-23T11:35:10+0530 lvl=eror msg=“Error while trying to authenticate user” logger=context userId=0 orgId=0 uname= error=“LDAP Result Code 200 "Network Error": read tcp 10.0.0.24:60794->172.16.13.1:389: read: connection reset by peer”
t=2019-05-23T11:35:10+0530 lvl=eror msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=POST path=/login status=500 remote_addr=10.0.0.253 time_ms=5 size=53 referer=http://10.0.0.24:3000/login

Please help me out to fix this

Grafana version : v6.0.1
Installed On : Redhat 7.4

Active Directory server setup:

IP address: 172.16.13.1
Domain: WN-AD
DNS name: wn.lk

**My grafana.ini configuration;

[auth.ldap]
enabled = true
config_file = /etc/grafana/ldap.toml
allow_sign_up = true

  • My ldap.toml configuration;

[[servers]]

host = “172.16.13.1”
port = 389
use_ssl = true
start_tls = false
ssl_skip_verify = true
bind_dn = “cn=grafana,dc=wn,dc=lk”
bind_password = ‘test@123’
search_filter = “(sAMAccountName=%s)”
search_base_dns = [“dc=wn,dc=lk”]

[servers.attributes]
name = “givenName”
surname = “sn”
username = “sAMAccountName”
member_of = “memberOf”
email = “mail”

[[servers.group_mappings]]
group_dn = “cn=grafana-admin,cn=Users,dc=wn,dc=lk”
org_role = “Admin”

[[servers.group_mappings]]
group_dn = “cn=grafana-editor,cn=Users,dc=wn,dc=lk”
org_role = “Editor”

[[servers.group_mappings]]
group_dn = “cn=grafana-viewer,cn=Users,dc=wn,dc=lk”
org_role = “Viewer”

[quote=“sandaru, post:1, topic:17579, full:true”]
I’m trying to authenticate Grafana users with Active Directory but it is not working. and I got the following error log;

t=2019-05-23T11:35:10+0530 lvl=eror msg=“Error while trying to authenticate user” logger=context userId=0 orgId=0 uname= error=“LDAP Result Code 200 "Network Error": read tcp 10.0.0.24:60794->172.16.13.1:389: read: connection reset by peer”
t=2019-05-23T11:35:10+0530 lvl=eror msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=POST path=/login status=500 remote_addr=10.0.0.253 time_ms=5 size=53 referer=http://10.0.0.24:3000/login

Please help me out to fix this

Grafana version : v6.0.1
Installed On : Redhat 7.4

Active Directory server setup:

IP address: 172.16.13.1
Domain: WN-AD
DNS name: wn.lk

My grafana.ini configuration;

[quote=“sandaru, post:1, topic:17579, full:true”]
I’m trying to authenticate Grafana users with Active Directory but it is not working. and I got the following error log;

t=2019-05-23T11:35:10+0530 lvl=eror msg="Error while trying to authenticate user" logger=context userId=0 orgId=0 uname= error="LDAP Result Code 200 \"Network Error\": read tcp 10.0.0.24:60794->172.16.13.1:389: read: connection reset by peer"
t=2019-05-23T11:35:10+0530 lvl=eror msg="Request Completed" logger=context userId=0 orgId=0 uname= method=POST path=/login status=500 remote_addr=10.0.0.253 time_ms=5 size=53 referer=http://10.0.0.24:3000/login

Please help me out to fix this

Grafana version : v6.0.1
Installed On : Redhat 7.4

Active Directory server setup:

IP address: 172.16.13.1
Domain: WN-AD
DNS name: wn.lk

My grafana.ini configuration;

[auth.ldap]
enabled = true
config_file = /etc/grafana/ldap.toml
allow_sign_up = true

My ldap.toml configuration;

[[servers]]

host = "172.16.13.1"
port = 389
use_ssl = true
start_tls = false
ssl_skip_verify = true
bind_dn = "cn=grafana,dc=wn,dc=lk"
bind_password = 'test@123'
search_filter = "(sAMAccountName=%s)"
search_base_dns = ["dc=wn,dc=lk"]

[servers.attributes]
name = "givenName"
surname = "sn"
username = "sAMAccountName"
member_of = "memberOf"
email =  "mail"


[[servers.group_mappings]]
group_dn = "cn=grafana-admin,cn=Users,dc=wn,dc=lk"
org_role = "Admin"

[[servers.group_mappings]]
group_dn = "cn=grafana-editor,cn=Users,dc=wn,dc=lk"
org_role = "Editor"

[[servers.group_mappings]]
group_dn = "cn=grafana-viewer,cn=Users,dc=wn,dc=lk"
org_role = "Viewer"

[[servers.group_mappings]]
group_dn = "*"
org_role = "Viewer"

I’m getting the same error with grafana 6.6.2 (3fa63cfc34)

can i have a solution please ?

here is the LDAP part of my grafana.ini

image

I have this error in logs:

lvl=eror msg=“Error while trying to authenticate user” logger=context userId=0 orgId=0 uname= error=“LDAP Result Code 200 "Network Error": EOF”

In Grafana GUI:

“Connection reset by peer” is usually (not always, but quite often)a firewall rejecting your connection.

I had to do following to get it working (had same error).

  1. login with default admin
  2. change the username to the ldap user’s username
  3. sign out
  4. sign back in with correct credentials (default admin did not work anymore)

I’m getting a similar error.

But in my case, I can authenticate the first domain user via LDAP, but when I try to authenticate more users they receive that error.

Even, I was taking a look into the Grafana logs and it says that the user “already exists”…

Log: =“Error while trying to authenticate user” error=“user already exists”.

In the Test User Mapping search bar I look for any domain user and I get that it’s an active user.

The thing is that only one user can authenticate, and it’s the first one to be authenticated.

I’ve just solved this issue. Basically I added the following parameters in /etc/grafana/ldap.toml:

[servers.attributes]
username = “sAMAccountName” (I added this line, and solved the error).
member_of = “memberOf”
email = “email”

can you share me the ldap
.toml file