Bug 527912 - setup-ds.pl hangs at hostname prompt
Summary: setup-ds.pl hangs at hostname prompt
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Install/Uninstall
Version: 1.3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 639035 389_1.2.8
TreeView+ depends on / blocked
 
Reported: 2009-10-08 08:15 UTC by Frederic Hornain
Modified: 2015-12-07 17:12 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:12:14 UTC
Embargoed:


Attachments (Terms of Use)
Patch (2.01 KB, patch)
2011-01-20 23:14 UTC, Nathan Kinder
nhosoi: review+
Details | Diff

Description Frederic Hornain 2009-10-08 08:15:11 UTC
Description of problem:

When I launch the setup-ds.pl script it hangs after requesting me the FQDN of the host machine.

Version-Release number of selected component (if applicable):
389-ds-base-1.2.2-1.fc11.i586

How reproducible:
Install 389-ds-base-1.2.2-1.fc11.i586 with yum install 389-ds-base.
Then launch setup-ds.pl script.

Steps to Reproduce:
1. yum install 389-ds-base
2. setup-ds.pl
3.
  
Actual results:

[root@localhost ~]# setup-ds.pl 

==============================================================================
This program will set up the 389 Directory Server.

It is recommended that you have "root" privilege to set up the software.
Tips for using this  program:
  - Press "Enter" to choose the default and go to the next screen
  - Type "Control-B" or the word "back" then "Enter" to go back to the previous screen
  - Type "Control-C" to cancel the setup program

Would you like to continue with set up? [yes]: 

==============================================================================
BY SETTING UP AND USING THIS SOFTWARE YOU ARE CONSENTING TO BE BOUND BY
AND ARE BECOMING A PARTY TO THE AGREEMENT FOUND IN THE
LICENSE.TXT FILE. IF YOU DO NOT AGREE TO ALL OF THE TERMS
OF THIS AGREEMENT, PLEASE DO NOT SET UP OR USE THIS SOFTWARE.

Do you agree to the license terms? [no]: yes

==============================================================================
Your system has been scanned for potential problems, missing patches,
etc.  The following output is a report of the items found that need to
be addressed before running this software in a production
environment.

389 Directory Server system tuning analysis version 10-AUGUST-2007.

NOTICE : System is i686-unknown-linux2.6.29.4-167.fc11.i586 (1 processor).

WARNING: 1003MB of physical memory is available on the system. 1024MB is recommended for best performance on large production system.

NOTICE : The net.ipv4.tcp_keepalive_time is set to 7200000 milliseconds
(120 minutes).  This may cause temporary server congestion from lost
client connections.

WARNING: There are only 1024 file descriptors (hard limit) available, which
limit the number of simultaneous connections.  

WARNING: There are only 1024 file descriptors (soft limit) available, which
limit the number of simultaneous connections.  

Would you like to continue? [no]: yes

==============================================================================
Choose a setup type:

   1. Express
       Allows you to quickly set up the servers using the most
       common options and pre-defined defaults. Useful for quick
       evaluation of the products.

   2. Typical
       Allows you to specify common defaults and options.

   3. Custom
       Allows you to specify more advanced options. This is 
       recommended for experienced server administrators only.

To accept the default shown in brackets, press the Enter key.

Choose a setup type [2]: 2

==============================================================================
Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: eros.example.com.

To accept the default shown in brackets, press the Enter key.



Expected results:
The program should setup a new slapd instance. 


Additional info:
I have deliberately choosen the light installation of 389 directory. 
I do not need the Administration manager.

Comment 1 Frederic Hornain 2009-10-08 10:03:15 UTC
Ok, I think we can close this ticket.
It seems that my VM was particularly slow and the stanza "Enter the fully qualified domain name of the computer" finished to appear correctly.

Maybe due to what i did before ???
Indeed I've installed all 386-ds packages with admin stuffs and so on... and renew the command setup-ds.pl and it works correctly.  

Then I remove all 386-ds packages with admin stuffs except 389-ds-base.
and renew again the setup-ds.pl command and it also works.....

No idea of what cause the problem. Maybe my impatience to see something happening on the sceen...

Sorry to have disturbed you.
Thx for your help

BR
FRed

Comment 2 Frederic Hornain 2009-10-08 10:22:33 UTC
Ok, I reopen the case cause after retarting the VM I still have the same strange behaviour. The setup-ds.pl hangs....

Comment 3 Frederic Hornain 2009-10-08 10:37:58 UTC
it seems it link to my static ip.
Strange cause when I am setting dhcp ip it works well and when I am setting it in static ip it hangs forever....

Comment 4 Frederic Hornain 2009-10-08 10:38:38 UTC
Indeed it work but it takes more time to resolve this part of the program...

Comment 5 Rich Megginson 2009-10-08 13:08:03 UTC
Whatever the reason, I don't think setup should hang.  We should do a better job of hostname/domainname detection.  We currently use the perl module Net::Domain - the function hostfqdn().  This tries many different ways to figure out what the hostname and domainname are.  I'm not sure why that would hang.  If you have the time or the inclination, you could run setup in the perl debugger like this:

perl -d /usr/sbin/setup-ds.pl

b Net::Domain::hostfqdn

to set a break point in Net::Domain::hostfqdn

Comment 6 Rich Megginson 2009-10-08 13:09:14 UTC
Can you provide steps to reproduce the problem?

Comment 7 Frederic Hornain 2009-10-08 16:04:54 UTC
Dear Rich,

I would not offend you or the 368 team in saying "the setup hangs". I wanted to say that the script took time to pass this step.
My deep apologies if I offend you or your team.

As I tried the directory facility tool in the previous version I thought it was a bug but now I do not think so.
I will send you more details about what I did tomorrow.
Sorry again. ;)

Have a nice day, afternoon or evening.
BR
Frederic

Comment 8 Rich Megginson 2009-10-08 16:09:53 UTC
No offense taken.  I believe this is a bug - setup should not hang trying to figure out what the hostname is.  Even if setup has to make a DNS request, and there is some network problem which causes it to take a long time, we need to account for that.  We need to let the user know what is happening, and set a smaller network timeout if possible.

Comment 10 Nathan Kinder 2011-01-20 21:45:01 UTC
I believe that this is due to DNS timeouts.  I have read that Net::Domain::hostfqdn can make multiple DNS queries, each of which will need to hit a DNS timeout.  It will eventually return.

I see a few things that we can do:

- Add a message that the setup script can output stating that it is trying to determine the hostname and that it could take some time.

- Switch to using something like Sys::Hostname, which doesn't use DNS (essentially the same as hostname -fqdn).

Does anyone else have a strong opinion on which of these options we should go with?

Comment 11 Rich Megginson 2011-01-20 21:59:26 UTC
(In reply to comment #10)
> I believe that this is due to DNS timeouts.  I have read that
> Net::Domain::hostfqdn can make multiple DNS queries, each of which will need to
> hit a DNS timeout.  It will eventually return.
> 
> I see a few things that we can do:
> 
> - Add a message that the setup script can output stating that it is trying to
> determine the hostname and that it could take some time.

We should probably do this, and add a message like
"If you would rather not wait, Ctrl-C, run $0 again, and specify on the command line:
$0 General.FullMachineName=your.hostname.domain.name ...otherargs..."

> 
> - Switch to using something like Sys::Hostname, which doesn't use DNS
> (essentially the same as hostname -fqdn).

If it works better, I'm all for it.  How does hostname -fqdn work without DNS?

> 
> Does anyone else have a strong opinion on which of these options we should go
> with?

Comment 12 Nathan Kinder 2011-01-20 22:11:30 UTC
(In reply to comment #11)

> If it works better, I'm all for it.  How does hostname -fqdn work without DNS?

According to the CPAN docs, Sys::Hostname uses the following logic:

"It tries the first available of the C library's gethostname(), `$Config{aphostname}`, uname(2), syscall(SYS_gethostname), `hostname`, `uname -n`, and the file /com/host. If all that fails it croaks."

I'm leaning towards the approach of just adding a message to the setup program.  This has an advantage of detecting a DNS issue and raising the issue to the Administrator.  It also won't alter our current hostname detection behavior.

Comment 13 Nathan Kinder 2011-01-20 22:30:12 UTC
I should add that this issue is easily reproducible.  To reproduce, simply comment out all valid DNS servers in /etc/resolv.conf and add a "nameserver" entry to an invalid private IP address.  This will cause setup to take a long time when trying to contact the bogus DNS server.

Comment 14 Rich Megginson 2011-01-20 22:45:39 UTC
How long does it hang?
Is there any way to timeout?

Comment 15 Nathan Kinder 2011-01-20 22:58:36 UTC
(In reply to comment #14)
> How long does it hang?
> Is there any way to timeout?

It appears to hang for 2 minutes when I configure a single bad nameserver in resolv.conf.  I I configure 2 bad nameservers, it takes 4 minutes.

I am not sure if there is any way to configure this timeout from within our setup program.

Comment 16 Nathan Kinder 2011-01-20 23:14:43 UTC
Created attachment 474563 [details]
Patch

With this patch, the setup program output will look like this just prior to prompting for the hostname:

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: eros.example.com.

To accept the default shown in brackets, press the Enter key.

Warning: This step may take a few minutes if your DNS servers
can not be reached or if DNS is not configured correctly.  If
you would rather not wait, hit Ctrl-C and run this program again
with the following command line option to specify the hostname:

    General.FullMachineName=your.hostname.domain.name

Comment 17 Nathan Kinder 2011-01-20 23:35:12 UTC
Pushed to master.  Thanks to Noriko for her review!

Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (7/7), 1.01 KiB, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   bd71726..53794a0  master -> master

Comment 20 Amita Sharma 2011-06-22 11:16:32 UTC
Hey , yes .. It halts at this point for about some seconds, but did not hang:

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: eros.example.com.

To accept the default shown in brackets, press the Enter key.

Warning: This step may take a few minutes if your DNS servers
can not be reached or if DNS is not configured correctly.  If
you would rather not wait, hit Ctrl-C and run this program again
with the following command line option to specify the hostname:

    General.FullMachineName=your.hostname.domain.name

*********************************************************************************
Directory Manager DN [cn=Directory Manager]: 
Password: 
Password (confirm): 
Your new DS instance 'amsharma1' was successfully created.
Exiting . . .
Log file is '/tmp/setup_oU0RL.log'


Hence VERIFIED.


Note You need to log in before you can comment on or make changes to this bug.