Bug 985035 - frontend_httpd.rb should require openshift-origin-node/model/application_container
frontend_httpd.rb should require openshift-origin-node/model/application_cont...
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan Mace
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-07-16 11:33 EDT by Andy Grimm
Modified: 2016-11-07 22:47 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-07 18:55:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andy Grimm 2013-07-16 11:33:08 EDT
frontend_httpd.rb uses the ApplicationContainer module now, but does not "require" it, and the result is a quiet failure.  Example:

# oo-exec-ruby irb
>> require 'openshift-origin-node/model/frontend_httpd'
=> true
>> foo = OpenShift::Runtime::FrontendHttpServer.all
=> #<Enumerator: #<Enumerator::Generator:0x00000002b96610>:each>
>> foo.next
StopIteration: iteration reached an end
	from (irb):3:in `next'
	from (irb):3
	from /opt/rh/ruby193/root/usr/bin/irb:12:in `<main>'

At this point, if you look at /var/log/openshift/node/platform.log, you will see an error like this:

July 16 11:23:27 ERROR Failed to instantiate FrontendHttpServer for 51e4fdb1dbd93ce2c2000435: uninitialized constant OpenShift::Runtime::FrontendHttpServer::ApplicationContainer

Now, if we add in application_container, it works, of course:

>> require 'openshift-origin-node/model/application_container'
=> true
>> foo = OpenShift::Runtime::FrontendHttpServer.all
=> #<Enumerator: #<Enumerator::Generator:0x00000003b225c0>:each>
>> foo.next
=> #<OpenShift::Runtime::FrontendHttpServer:0x00000002b8d150 @config=#<OpenShift::Config:0x00000002b8d100 ...
Comment 1 Dan Mace 2013-07-16 11:53:11 EDT
Marking UpcomingRelease: FrontendHttpd shouldn't depend on ApplicationContainer, and using the node library as a gem from an irb session isn't a supported scenario. If the error occurs during a normal node operation, we'll treat it as a blocker.
Comment 2 Rob Millner 2013-07-16 13:00:16 EDT
I agree.  FrontendHttpd gained ApplicationContainer as a dependency during the LXC patch in order to use the root context call - but this code already runs in root context and its expected to work sanely in environments where application containers are damaged.

I've already started reverting that dependency - will kill it completely in this sprint.
Comment 3 Dan Mace 2013-07-26 10:02:04 EDT

Went ahead and fixed the require pending a refactor. This will make the class usable in other consuming scripts/classes.
Comment 4 openshift-github-bot 2013-07-26 12:08:05 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 985035: Add missing requires to frontend_httpd
Comment 5 Meng Bo 2013-07-29 02:19:06 EDT
Checked on devenv_3569, as comment#3, the dependency application_container added to the frontend_httpd.rb.

[root@ip-10-164-72-80 model]# oo-exec-ruby irb
irb(main):001:0> require 'openshift-origin-node/model/frontend_httpd'
=> true
irb(main):002:0> foo = OpenShift::Runtime::FrontendHttpServer.all
=> #<Enumerator: #<Enumerator::Generator:0x00000001df56f0>:each>
irb(main):003:0> foo.next
=> #<OpenShift::Runtime::FrontendHttpServer:0x00000001adee80 @config=#<OpenShift::Config:0x00000001adee30 @conf=#<ParseConfig:0x000000012ffac0 @config_file="/etc/openshift/node.conf"...

Move bug to fixed.

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