Bug 1172323

Summary: watchman cleans up frontend config dirs but not files referencing them
Product: OpenShift Online Reporter: Andy Grimm <agrimm>
Component: ContainersAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.xCC: jgoulding, jokerman, mmccomas, yadu
Target Milestone: ---   
Target Release: 2.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1173026 (view as bug list) Environment:
Last Closed: 2015-03-05 19:56:39 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: 1169306    
Bug Blocks: 1173026    

Description Andy Grimm 2014-12-09 20:26:08 UTC
Description of problem:

in commit ef1e1cf2 (which was written to fix BZ 1169306), code was added to the watchman frontend plugin which removes empty config directories.  However, this code does not remove the conf files which reference those directories.  The result is a broken apache configuration.


Version-Release number of selected component (if applicable):
openshift-origin-node-util-1.32.2-1.el6oso.noarch

How reproducible:
Always

Steps to Reproduce:
1. Restart watchman on a node with empty config directories for secondary gears
2. Restart apache

Actual results:

Starting httpd: httpd.worker: Syntax error on line 222 of /etc/httpd/conf/httpd.conf: Syntax error on line 75 of /etc/httpd/conf.d/000000_default.conf: Syntax error on line 72 of /etc/httpd/conf.d/openshift/52a00fa7e0b8cde0c70003ee_lara_0_52a00fa7e0b8cde0c70003ee.conf: Include directory '/etc/httpd/conf.d/openshift/52a00fa7e0b8cde0c70003ee_lara_52a00fa7e0b8cde0c70003ee' not found

Expected results:

A working apache configuration

Comment 1 Andy Grimm 2014-12-09 20:29:37 UTC
I should have actually read BZ 1169306 before I wrote this report.  I suppose the problem should be stated differently -- the issue should probably be stated as "frontend plugin is remove conf directories for secondary gears which have not yet been deleted", or something to that effect.

Comment 2 openshift-github-bot 2014-12-10 23:18:30 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/057462d055d6443dc89213866d5b5f7c1f51e644
Bug 1172323 - Only remove unreferenced empty directories from the frontend configuration

Comment 3 Yan Du 2014-12-11 07:28:36 UTC
Test on devenv_5350

Issue have been fixed. openshift-watchman and apache
can be restart normally on a node with empty config directories for secondary gears. and after restart openshift-watchman restart, the conf directories for secondary gears will be removed.

[root@ip-10-81-188-254 ~]# service openshift-watchman restart
Stopping Watchman
Starting Watchman
[root@ip-10-81-188-254 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: [Thu Dec 11 07:24:11 2014] [warn] module php5_module is already loaded, skipping
[Thu Dec 11 07:24:11 2014] [warn] module passenger_module is already loaded, skipping
[Thu Dec 11 07:24:11 2014] [warn] module passenger_module is already loaded, skipping
Warning: DocumentRoot [/var/www/html/binaryartifacts] does not exist
[Thu Dec 11 07:24:11 2014] [warn] NameVirtualHost *:443 has no VirtualHosts
[Thu Dec 11 07:24:11 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
                                                           [  OK  ]

Comment 4 Yan Du 2014-12-11 08:52:38 UTC
Steps to verified:

1. Create a scalable app with db embedded
2. Scale up once
3. Manually mpty the config files in scale up gear  
4. service openshift-watchman restart
5. service httpd restart

After step4, the empty db config directory will be removed, but the empty scale up gear directory will not be removed. 

And in Step5, apache service can be restart normally without any error.