Bug 1101652

Summary: Apache crashes when replica is restarted when installing
Product: Red Hat Enterprise Linux 6 Reporter: Rob Crittenden <rcritten>
Component: mod_wsgiAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: jkaluza, nsoman, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1099811 Environment:
Last Closed: 2014-05-28 12:41:42 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:
Bug Depends On: 1099811    
Bug Blocks:    

Description Rob Crittenden 2014-05-27 17:01:23 UTC
+++ This bug was initially created as a clone of Bug #1099811 +++

Description of problem:
Apache crashes when installing 6.5 master+replica and 5.11 Client.

In discussing with Rob and team, it was decided to remove extra restart

Version-Release number of selected component (if applicable):
ipa-server-3.0.0-37.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Used beaker to install the environment using quickinstall for QE tests


Actual results:
Crash is detetcted


Expected results:
No crash


Additional info:
Email from Rob:

I found this in /var/log/messages

May 19 09:13:34 pogolinux-01 setsebool: The httpd_can_network_connect
policy boolean was changed to on by root
May 19 09:13:34 pogolinux-01 setsebool: The httpd_manage_ipa policy
boolean was changed to on by root
May 19 09:13:35 pogolinux-01 kernel: httpd[19488]: segfault at 30 ip
00007f333682a7c7 sp 00007fffe606d050 error 4 in
libapr-1.so.0.3.9[7f3336816000+2b000]
May 19 09:13:35 pogolinux-01 kernel: httpd[19489]: segfault at 30 ip
00007f333682a7c7 sp 00007fffe606f6d0 error 4 in
libapr-1.so.0.3.9[7f3336816000+2b000]
May 19 09:13:35 pogolinux-01 kernel:
May 19 09:13:35 pogolinux-01 abrt[19523]: Not saving repeating crash in
'/usr/sbin/httpd'
May 19 09:13:36 pogolinux-01 abrt[19524]: Saved core dump of pid 19488
(/usr/sbin/httpd) to /var/spool/abrt/ccpp-2014-05-19-09:13:35-19488
(73166848 bytes)
May 19 09:13:36 pogolinux-01 abrtd: Directory
'ccpp-2014-05-19-09:13:35-19488' creation detected

My initial thought was that Apache was restarted in the middle of
initialization. Based on the core it looked like it blew up on a python
import. The ipareplica-install.log doesn't confirm this though. We
restart the server after configuring SELinux and that is what is
failing. Fortunately we restart it again a few steps later and that is
fine which is why the install is successful. While I wonder why it is
blowing up, it may mean we can drop an HTTP restart and save a few seconds.

--- Additional comment from RHEL Product and Program Management on 2014-05-21 05:22:11 EDT ---

Since this bug report was entered in bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Namita Soman on 2014-05-21 05:27:25 EDT ---

Beaker job: https://beaker.engineering.redhat.com/jobs/655062

--- Additional comment from Martin Kosek on 2014-05-27 06:34:59 EDT ---

Upstream ticket:
https://fedorahosted.org/freeipa/ticket/4352

--- Additional comment from Rob Crittenden on 2014-05-27 12:42:47 EDT ---



--- Additional comment from Rob Crittenden on 2014-05-27 13:00:37 EDT ---

Comment 1 Rob Crittenden 2014-05-27 17:04:24 UTC
This is the sequence of events from the replica install log:

[ Enable SSL booleans ]

2014-05-27T16:24:19Z DEBUG   [11/12]: restarting httpd
2014-05-27T16:24:19Z DEBUG args=/sbin/service httpd status
2014-05-27T16:24:19Z DEBUG stdout=httpd is stopped

2014-05-27T16:24:19Z DEBUG stderr=
2014-05-27T16:24:19Z DEBUG Saving StateFile to '/var/lib/ipa/sysrestore/sysrestore.state'
2014-05-27T16:24:20Z DEBUG args=/sbin/service httpd restart
2014-05-27T16:24:20Z DEBUG stdout=Stopping httpd: [FAILED]^M
Starting httpd: [  OK  ]^M

2014-05-27T16:24:20Z DEBUG stderr=
2014-05-27T16:24:20Z DEBUG args=/sbin/service httpd status
2014-05-27T16:24:20Z DEBUG stdout=httpd dead but subsys locked

2014-05-27T16:24:20Z DEBUG stderr=
2014-05-27T16:24:20Z DEBUG   duration: 0 seconds

The stop failed because it was already dead. This is the first time we poke at the service, so this may be normal, but the subsys lock is confusing. The start is successful.

In the same second according to the logs there is another restart to pick up a new certificate we load:

2014-05-27T16:24:20Z DEBUG stderr=
2014-05-27T16:24:23Z DEBUG args=/sbin/service httpd restart
2014-05-27T16:24:23Z DEBUG stdout=Stopping httpd: [  OK  ]^M
Starting httpd: [  OK  ]^M

2014-05-27T16:24:23Z DEBUG stderr=
2014-05-27T16:24:23Z DEBUG args=/sbin/service httpd status
2014-05-27T16:24:23Z DEBUG stdout=httpd dead but subsys locked

I can only assume it is blowing up during the second start, in the same second. Since this is a WSGI app it gets loaded after the core httpd modules which is why startup appears successful to /sbin/service.

So in IPA we can address this by re-evaluating our restarts. I imagine we can get rid of at least one of them, especially considering that we blow Apache up and the installer doesn't even notice.

But I'm concerned about the underlying cause. Is this a bug in mod_wsgi not handling the signal properly while in the middle of imports, or an Apache bug shutting down the fd's too quickly, or something else?

Comment 3 Jan Kaluža 2014-05-28 07:16:30 UTC
What version of mod_wsgi do you use? From sosreport in original Bug 1099811, it looks like it's RHEL6 machine (not RHEL7 as you stated in this bugzilla) and mod_wsgi-3.2 is installed.

In RHEL7 (mod_wsgi-3.4), this should be fixed. If it's RHEL6 machine (and mod_wsgi-3.2), this bug is duplicate of Bug 1008018.

Comment 4 Rob Crittenden 2014-05-28 12:41:42 UTC
Yes, this looks like the same issue. Sorry for the confusion over releases, this was RHEL 6.

Closing as duplicate.

*** This bug has been marked as a duplicate of bug 1008018 ***