# LDAPSearchException: referral limit exceeded

**URL:** <https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 23, 2016, 9:26pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834 "2016-06-23T21:26:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabad](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sabad](https://discuss.elastic.co/u/sabad)\
**Post date:** [June 23, 2016, 9:26pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/1 "2016-06-23T21:26:02Z")

</div>

I have this issue causing the kibana work sporadically.

This issue is happening when the ES is throwing the error.  
cause: com.unboundid.ldap.sdk.LDAPSearchException: referral limit exceeded

It recovers after sometime.

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [June 23, 2016, 9:41pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/2 "2016-06-23T21:41:25Z")

</div>

Are you using the ldap realm or the active directory realm? Can you provide the full exception and your configuration (minus any sensitive data)?

---

<div class="post-metadata">

**Author:** ![sabad](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sabad](https://discuss.elastic.co/u/sabad)\
**Post date:** [June 23, 2016, 9:55pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/3 "2016-06-23T21:55:48Z")

</div>

I moved the realm from local(file) to AD.  
It was working fine with file based.  
elasticsearch.yml

shield:  
authc:  
realms:  
active\_directory:  
type: active\_directory  
order: 0  
domain\_name: ops.saba  
url: ldap://ops.xaba:389  
unmapped\_groups\_as\_roles: true

role\_mapping.yml  
monitoring:

- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'  
admin:
- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'  
power\_user:
- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'  
user:
- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'  
kibana4:
- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'  
kibana4\_server:
- 'cn=logstash,cn=Users,dc=ops,dc=saba'
- 'cn=kibana4-server,cn=Users,dc=ops,dc=saba'
- 'cn=dala,cn=Users,dc=ops,dc=saba'

Currently, only kibana4-server is working fine

cause: com.unboundid.ldap.sdk.LDAPSearchException: referral limit exceeded  
[2016-06-23 17:52:44,384][WARN][shield.authc.activedirectory] [n3pv01inflsh01] authentication failed for user [kibana4-server]: unable to authenticate user [kibana4-server] to active directory domain [ops.saba]  
cause: com.unboundid.ldap.sdk.LDAPSearchException: referral limit exceeded  
[2016-06-23 17:52:48,387][WARN][shield.authc.activedirectory] [n3pv01inflsh01] authentication failed for user [kibana4-server]: unable to authenticate user [kibana4-server] to active directory domain [ops.saba]  
cause: com.unboundid.ldap.sdk.LDAPSearchException: referral limit exceeded

---

<div class="post-metadata">

**Author:** ![sabad](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sabad](https://discuss.elastic.co/u/sabad)\
**Post date:** [June 23, 2016, 9:57pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/4 "2016-06-23T21:57:59Z")

</div>

It is very sporadic.

---

<div class="post-metadata">

**Author:** ![sabad](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sabad](https://discuss.elastic.co/u/sabad)\
**Post date:** [June 23, 2016, 9:58pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/5 "2016-06-23T21:58:38Z")

</div>

It works when the status change to green

log [17:46:29.695] [error][status][plugin:elasticsearch] Status changed from red to red - Request Timeout after 1500ms  
log [17:46:32.491] [error][status][plugin:elasticsearch] Status changed from red to red - Elasticsearch is still initializing the kibana index.  
log [17:46:43.673] [info][status][plugin:elasticsearch] Status changed from red to green - Kibana index ready  
log [17:51:13.904] [error][status][plugin:elasticsearch] Status changed from green to red - Request Timeout after 1500ms  
log [17:52:56.858] [info][status][plugin:elasticsearch] Status changed from red to green - Kibana index ready

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [June 23, 2016, 10:10pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/6 "2016-06-23T22:10:53Z")

</div>

Are you in a single domain or a forest with the potential for a lot of referrals?

You may want to try setting `follow_referrals: false` in your realm settings if you do not need to follow referrals.

---

<div class="post-metadata">

**Author:** ![sabad](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sabad](https://discuss.elastic.co/u/sabad)\
**Post date:** [June 23, 2016, 10:42pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/7 "2016-06-23T22:42:27Z")

</div>

Thank You Jay, it worked like a charm.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:43pm UTC](https://discuss.elastic.co/t/ldapsearchexception-referral-limit-exceeded/53834/8 "2017-07-06T13:43:34Z")

</div>


