Bug 974306 - Check if required ports are open at start of freeipa-server-install
Check if required ports are open at start of freeipa-server-install
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: freeipa (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Rob Crittenden
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-13 18:53 EDT by David Jaša
Modified: 2015-02-18 08:56 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-18 08:56:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Jaša 2013-06-13 18:53:59 EDT
Description of problem:
Check if required ports are open at start of freeipa-server-install.

I had accidentally blocked access to freeipa ports and the only error I got was "unable to restart directory server" after few screens worth of debug output. It's quite hard to identify the real root of the problem that may be actually caused by one small typo far far away from the apparent error...

Version-Release number of selected component (if applicable):
freeipa-server-3.2.0-2.fc19.armv7hl

How reproducible:
always

Steps to Reproduce:
1. uniformly block access to port 389 (and probably other ports)
2. run ipa-server-install with correct parameters
3.

Actual results:
ipa-server-install fails with screen-long backtrace about not being able to restart directory server

Expected results:
ipa-server-install finds out that iptables configuration is plain wrong (ports can't be reached even from localhost)

Additional info:
Comment 1 Martin Kosek 2013-06-14 04:05:40 EDT
FreeIPA server installer does not interact with Firewall at the moment. Though you can check a related upstream ticket which requests it:
https://fedorahosted.org/freeipa/ticket/2110

Even when we get to this ticket (patches welcome though), I am not sure if we can easily find out the bad configuration you just pointed out. Or are you aware of some command/API which would be able to get us this information? i.e. something that would tell us - "is port X open on loopack?"

We print list of ports that need to be open after the install and we also correctly detected that there is problem with DS restart (after we checked if the port was open after the restart - it was not). Thus, I am not convinced yet if we can improve current state (besides adding firewalld handling as proposed in ticket 2110).
Comment 2 David Jaša 2013-06-14 04:52:14 EDT
(In reply to Martin Kosek from comment #1)
> FreeIPA server installer does not interact with Firewall at the moment.
> Though you can check a related upstream ticket which requests it:
> https://fedorahosted.org/freeipa/ticket/2110
> 

firewalld integration is by far the best thing to do, especially because the required port range can be different across different instances - the main ipa service could then request ports to be open dynamically just for currently running services

> Even when we get to this ticket (patches welcome though), I am not sure if
> we can easily find out the bad configuration you just pointed out. Or are
> you aware of some command/API which would be able to get us this
> information? i.e. something that would tell us - "is port X open on loopack?"
> 

I check the ports manually using nmap but I understand that this is hardly an option for the installer. You could create a threat that would bind() the required ports and try to connect() to the ports from main thread but that might be way too much work for little benefit, especially after firewalld integration. So the correct approach would be better error handling:

> We print list of ports that need to be open after the install

The problem was typo in an iptables setup so I was convinced that my firewall is OK while it wasn't...

> and we also
> correctly detected that there is problem with DS restart (after we checked
> if the port was open after the restart - it was not).

This sounds to me as two totally unrelated things - if I see the backtrace ending at not being able to restart some service, I certainly don't expect that the core reason is that the port can not be accessed.

> Thus, I am not
> convinced yet if we can improve current state (besides adding firewalld
> handling as proposed in ticket 2110).

I think you definitely can: if you fail to connect to some service that should be accessible at that point, report it and fail the installation at that very moment.
Comment 3 Martin Kosek 2013-06-14 07:55:02 EDT
(In reply to David Jaša from comment #2)
...
> I think you definitely can: if you fail to connect to some service that
> should be accessible at that point, report it and fail the installation at
> that very moment.

That's right. I reproduced your issue with following configuration on my F19 box:
# cat /etc/sysconfig/iptables
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
#-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

# ipa-server-install -p kokos123 -a kokos123
...
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv): Estimated time 1 minute
  [1/37]: creating directory server user
  [2/37]: creating directory server instance
ipa         : CRITICAL Failed to restart the directory server (). See the installation log for details.
  [3/37]: adding default schema
  [4/37]: enabling memberof plugin

#

I think I also recall screens when the installation goes much further thus loosing the original error. We should crash right when we failed to restart 389 DS. I will clone an upstream ticket.
Comment 4 Martin Kosek 2013-06-14 09:28:10 EDT
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/3720
Comment 5 Fedora End Of Life 2015-01-09 17:09:19 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 6 Fedora End Of Life 2015-02-18 08:56:30 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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