[GH-ISSUE #47] ldapsearch not connecting #29

Closed
opened 2026-02-27 16:47:42 +03:00 by kerem · 1 comment
Owner

Originally created by @ncphins on GitHub (Jul 21, 2023).
Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/47

I am fairly confident this is an issue with my setup, but I am struggling to get this setup and working. We are really wanting to use this for our integration testing of our project.

I have the container running on my Intel Mac. It seems to be running fine. I started it with the command line provided, and it is using port 389.
image

The port is in use:
$ lsof -i:389
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.docke 37827 xxxxxx 187u IPv6 0x35efde1bfd4dcf0d 0t0 TCP *:ldap (LISTEN)

I see logs every minute (which seems to indicate it is running):
2023-07-21 12:54:49 64bab859 conn=1046 fd=16 ACCEPT from IP=127.0.0.1:53282 (IP=0.0.0.0:10389)
2023-07-21 12:54:49 64bab859 conn=1046 op=0 BIND dn="cn=admin,dc=planetexpress,dc=com" method=128
2023-07-21 12:54:49 64bab859 conn=1046 op=0 BIND dn="cn=admin,dc=planetexpress,dc=com" mech=SIMPLE ssf=0
2023-07-21 12:54:49 64bab859 conn=1046 op=0 RESULT tag=97 err=0 text=
2023-07-21 12:54:49 64bab859 conn=1046 op=1 SRCH base="cn=admin,dc=planetexpress,dc=com" scope=2 deref=0 filter="(objectClass=*)"
2023-07-21 12:54:49 64bab859 conn=1046 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
2023-07-21 12:54:49 64bab859 conn=1046 op=2 UNBIND
2023-07-21 12:54:49 64bab859 conn=1046 fd=16 closed

However, when I attempt a simple ldapsearch, I get an error. I have tried several variations.
$ ldapsearch -x -b "dc=planetexpress,dc=com" -h localhost -p 389 -D "cn=admin,dc=planetexpress,dc=com" -W "(&(objectClass=person))"

Enter LDAP Password:
ldap_result: Can't contact LDAP server (-1)

I also tried (which I found in an older issue here):
$ ldapsearch -x -h localhost -p 389 -D "cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com" -w "professor" -b "dc=planetexpress,dc=com" -s sub '(objectClass=*)' givenName
ldap_result: Can't contact LDAP server (-1)

I apologize for opening the issue for a case when I am confident I am doing something wrong, but I am not sure where to go from here.

Originally created by @ncphins on GitHub (Jul 21, 2023). Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/47 I am fairly confident this is an issue with my setup, but I am struggling to get this setup and working. We are really wanting to use this for our integration testing of our project. I have the container running on my Intel Mac. It seems to be running fine. I started it with the command line provided, and it is using port 389. ![image](https://github.com/rroemhild/docker-test-openldap/assets/50498893/050708f8-b770-41e6-b42d-5fae9ff6c79c) The port is in use: $ lsof -i:389 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME com.docke 37827 xxxxxx 187u IPv6 0x35efde1bfd4dcf0d 0t0 TCP *:ldap (LISTEN) I see logs every minute (which seems to indicate it is running): 2023-07-21 12:54:49 64bab859 conn=1046 fd=16 ACCEPT from IP=127.0.0.1:53282 (IP=0.0.0.0:10389) 2023-07-21 12:54:49 64bab859 conn=1046 op=0 BIND dn="cn=admin,dc=planetexpress,dc=com" method=128 2023-07-21 12:54:49 64bab859 conn=1046 op=0 BIND dn="cn=admin,dc=planetexpress,dc=com" mech=SIMPLE ssf=0 2023-07-21 12:54:49 64bab859 conn=1046 op=0 RESULT tag=97 err=0 text= 2023-07-21 12:54:49 64bab859 conn=1046 op=1 SRCH base="cn=admin,dc=planetexpress,dc=com" scope=2 deref=0 filter="(objectClass=*)" 2023-07-21 12:54:49 64bab859 conn=1046 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text= 2023-07-21 12:54:49 64bab859 conn=1046 op=2 UNBIND 2023-07-21 12:54:49 64bab859 conn=1046 fd=16 closed However, when I attempt a simple ldapsearch, I get an error. I have tried several variations. $ ldapsearch -x -b "dc=planetexpress,dc=com" -h localhost -p 389 -D "cn=admin,dc=planetexpress,dc=com" -W "(&(objectClass=person))" Enter LDAP Password: ldap_result: Can't contact LDAP server (-1) I also tried (which I found in an older issue here): $ ldapsearch -x -h localhost -p 389 -D "cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com" -w "professor" -b "dc=planetexpress,dc=com" -s sub '(objectClass=*)' givenName ldap_result: Can't contact LDAP server (-1) I apologize for opening the issue for a case when I am confident I am doing something wrong, but I am not sure where to go from here.
kerem closed this issue 2026-02-27 16:47:43 +03:00
Author
Owner

@ncphins commented on GitHub (Jul 24, 2023):

I apologize but I opened this issue in the wrong location by accident. I have this container working properly with ldapsearch now on my Mac. I am closing this.

<!-- gh-comment-id:1647751733 --> @ncphins commented on GitHub (Jul 24, 2023): I apologize but I opened this issue in the wrong location by accident. I have this container working properly with ldapsearch now on my Mac. I am closing this.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-test-openldap#29
No description provided.