Bug 1027629 - Failed to create application when using vhost as frontend http server
Failed to create application when using vhost as frontend http server
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
2.0.0
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
:
Depends On:
Blocks: 1058849
  Show dependency treegraph
 
Reported: 2013-11-07 03:49 EST by Gaoyun Pei
Modified: 2017-03-08 12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1058849 (view as bug list)
Environment:
Last Closed: 2013-12-16 04:11:13 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 Gaoyun Pei 2013-11-07 03:49:31 EST
Description of problem:
When using vhost as frontend http server on node, app creation would be failed.

Version-Release number of selected component (if applicable):
2.0/2013-11-05.1

How reproducible:
always

Steps to Reproduce:
1.Configure vhost as the $node_apache_frontend in the installation script

2.After setting up env using script, check the configuration in node.conf:
[root@node ~]# grep OPENSHIFT_FRONTEND /etc/openshift/node.conf
OPENSHIFT_FRONTEND_HTTP_PLUGINS=openshift-origin-frontend-apache-vhost,openshift-origin-frontend-nodejs-websocket

3. Try to create apps


Actual results:
[root@broker ~]# rhc app create app5 php 
Using php-5.3 (PHP 5.3) for 'php'

Application Options
-------------------
  Domain:     1
  Cartridges: php-5.3
  Gear Size:  default
  Scaling:    no

Creating application 'app5' ... Unexpected error: no block given (yield)

Expected results:
Apps should be created successfully

Additional info:
Error logs in /var/log/ruby193-mcollective.log on node.
I, [2013-11-07T01:04:28.912345 #18981]  INFO -- : openshift.rb:353:in `rescue in oo_app_destroy' no block given (yield)
I, [2013-11-07T01:04:28.912607 #18981]  INFO -- : openshift.rb:354:in `rescue in oo_app_destroy' ["/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-frontend-apache-vhost-0.2.1/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb:413:in `block (2 levels) in with_lock_and_reload'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:38:in `block in open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:36:in `open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:36:in `open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-frontend-apache-vhost-0.2.1/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb:407:in `block in with_lock_and_reload'", "<internal:prelude>:10:in `synchronize'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-frontend-apache-vhost-0.2.1/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb:406:in `with_lock_and_reload'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-frontend-apache-vhost-0.2.1/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb:423:in `with_lock_and_reload'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-frontend-apache-vhost-0.2.1/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb:116:in `destroy'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/frontend_httpd.rb:579:in `block in call_plugins'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/frontend_httpd.rb:575:in `map'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/frontend_httpd.rb:575:in `call_plugins'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/frontend_httpd.rb:226:in `destroy'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.4.0/lib/openshift/runtime/containerization/selinux_container.rb:115:in `destroy'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/application_container.rb:266:in `block in destroy'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:38:in `block in open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:36:in `open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-common-1.17.0/lib/openshift-origin-common/utils/file_needs_sync.rb:36:in `open'", "/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.17.0/lib/openshift-origin-node/model/application_container.rb:251:in `destroy'", "/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:350:in `oo_app_destroy'", "/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:139:in `execute_action'", "/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:104:in `cartridge_do_action'", "/opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/agent.rb:86:in `handlemsg'", "/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:126:in `block (2 levels) in dispatch'", "/opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'", "/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:125:in `block in dispatch'"]
I, [2013-11-07T01:04:28.912714 #18981]  INFO -- : openshift.rb:150:in `execute_action' Finished executing action [app-destroy] (1)
I, [2013-11-07T01:04:28.921120 #18981]  INFO -- : openshift.rb:114:in `cartridge_do_action' cartridge_do_action failed (1)
------
no block given (yield)
------)
Comment 2 Brenton Leanhardt 2013-11-07 08:56:01 EST
This might be a configuration error.  I'll test later today with a new puddle.  For an OpenShift Online devenv I had to do the following:

https://github.com/openshift/origin-server/blob/master/plugins/frontend/README.frontend_httpd_plugins.md#changing-configuration

oo-frontend-plugin-modify --save > file
oo-frontend-plugin-modify --delete
# --nodeps won't be required for OSE
rpm -e --nodeps rubygem-openshift-origin-frontend-apache-mod-rewrite
yum install rubygem-openshift-origin-frontend-apache-vhost
# remove all the lines that have 'include conf.d/openshift_route.include'
vim /etc/httpd/conf.d/000000_default.conf
service httpd restart
# change the OPENSHIFT_FRONTEND_HTTP_PLUGINS setting and swap mod-rewrite for vhost
vim /etc/openshift/node.conf
service ruby193-mcollective restart
oo-frontend-plugin-modify --restore < file
service httpd restart

Those are the exact commands I ran.  Afterwards both my previously created apps still worked as well as new app creations.
Comment 4 Brenton Leanhardt 2013-11-07 14:06:50 EST
This is odd.  I'm getting a similar error on OSE when I followed the commands in Comment #2.  The following patch works around the issue:

diff --git a/plugins/frontend/apache-vhost/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb b/plugins/frontend/apache-vhost/lib
index 1c24977..a4d7cb1 100644
--- a/plugins/frontend/apache-vhost/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb
+++ b/plugins/frontend/apache-vhost/lib/openshift/runtime/frontend/http/plugins/apache-vhost.rb
@@ -419,8 +419,8 @@ module OpenShift
               ::OpenShift::Runtime::Frontend::Http::Plugins::reload_httpd
             end
 
-            def with_lock_and_reload
-              self.class.with_lock_and_reload
+            def with_lock_and_reload(&block)
+              self.class.with_lock_and_reload(&block)
             end
 
           end
Comment 5 Brenton Leanhardt 2013-11-07 14:22:33 EST
Just so anyone testing this is aware, if you are running an environment with a Broker and Node on the same machine you will have to do the following:

cd /etc/httpd/conf.d
mv 000001_openshift_origin_frontend_vhost.conf 000003_openshift_origin_frontend_vhost.conf

mv 000001_openshift_origin_node_servername.conf 000003_openshift_origin_node_servername.conf
Comment 7 Gaoyun Pei 2013-11-08 00:02:39 EST
Test this on puddle 2.0/2013-11-07.2, vhost configuration could work well on both all-in-one env and independent broker/node env.

Plugin switch could also be done successfully on the two env.

After changing frontend http server from mod-rewrite to vhost, or from vhost to mod-rewrite, old apps could be accessed, and new apps could be created.

So move it to VERIFIED.

Thanks for the detailed description.

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