Bug 1155680

Summary: Error: failed to open an LDAP connection to host 'example.org' port '389' as user 'cn=Directory Manager'. Error: unknown.
Product: [Fedora] Fedora Reporter: Eugene Kanter <ekanter>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: edewata, mreynolds, nhosoi, nkinder, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.2.25-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-29 18:59:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eugene Kanter 2014-10-22 15:33:23 UTC
Description of problem:

/usr/sbin/setup-ds-admin.pl fails with

Error: failed to open an LDAP connection to host 'example.org' port '389' as user 'cn=Directory Manager'.  Error: unknown.

ns-slapd is running and listening on port 389.

Running /usr/sbin/setup-ds-admin.pl under strace -f shows that it gets a connection refused error, while connecting to a correct example.org IP address.

Problems:

1. message says "Error: unknown" instead of "Error: connection refused"

2. /usr/lib/dirsrv/perl/DSCreate.pm diligently reads ns-slapd log file and waits for 'slapd started.' message. However ns-slapd puts out 'slapd started.' message shortly before it really starts accepting connections.

Workaround:

add a several seconds delay after

debug(1, "Your new directory server has been started.\n");

line.

Version-Release number of selected component (if applicable):

Probably all before and including 389-ds-base-1.3.2.23-1.fc20, since forums and mailing lists mention this error since at least 2009 with no solution offered.

How reproducible:
there is a sufficient chance of getting the error on Intel(R) Pentium(R) 4 CPU 3.00GHz system.

Steps to Reproduce:
1. create an ldap parameters file and repeatedly run /usr/sbin/setup-ds-admin.pl --debug --silent --force --file=/path/to/ldap.txt then systemctl stop dirsrv.target and rm -rf /etc/dirsrv/slapd-name and /var/lib/dirsrv/slapd-name after each run, where name is configured ldap server name.

Actual results:
Error sometimes occur.

Expected results:
No errors should occur.

Comment 1 Rich Megginson 2014-10-22 15:42:28 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/47935