Bug 990451 - oo-admin-ctl-usage couldn't work when MongoSSL enabled
oo-admin-ctl-usage couldn't work when MongoSSL enabled
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Kubernetes (Show other bugs)
1.2.1
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: John W. Lamb
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-31 04:57 EDT by Gaoyun Pei
Modified: 2017-03-08 12 EST (History)
5 users (show)

See Also:
Fixed In Version: openshift-origin-broker-util-1.9.12-1
Doc Type: Bug Fix
Doc Text:
The oo-admin-ctl-usage command was not passing Mongo session options to the Moped::Session.new call, so some MONGO_* settings from the broker.conf file were not applied. This caused the oo-admin-ctl-usage command to fail when Mongo was configured to use SSL, even if MONGO_SSL was set to true. This issue has been fixed in the current release of OpenShift Enterprise, and the command now works correctly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-25 11:29:47 EDT
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-07-31 04:57:11 EDT
Description of problem:
When executing "oo-admin-ctl-usage --list" or "oo-admin-ctl-usage --sync" on broker, it would return an error about MongoDB for replica set. Actually, the test env was not using mongo replica set.
This same error would happen on an OSE env which is using mongo replica set.

Version-Release number of selected component (if applicable):
1.2.1-RHN-Stage

How reproducible:
Always

Steps to Reproduce:
1. Set up an OSE 1.2.1 env, run command "oo-admin-ctl-usage --list" on broker
[root@broker ~]# oo-admin-ctl-usage --list
Errors/Warnings will be logged to terminal
2013-07-31 01:32:40 -0700 INFO:: 
---------- STARTED ----------

2013-07-31 01:32:45 -0700 ERROR:: Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
2013-07-31 01:32:45 -0700 ERROR:: ["/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:261:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cluster.rb:258:in `with_secondary'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/session/context.rb:104:in `with_node'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cursor.rb:137:in `load_docs'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/cursor.rb:25:in `each'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/query.rb:77:in `each'", "/opt/rh/ruby193/root/usr/share/gems/gems/moped-1.3.2/lib/moped/query.rb:77:in `each'", "/usr/sbin/oo-admin-ctl-usage:93:in `populate_user_info'", "/usr/sbin/oo-admin-ctl-usage:309:in `process_usage_records'", "/usr/sbin/oo-admin-ctl-usage:348:in `<main>'"]
2013-07-31 01:32:45 -0700 INFO:: 
---------- ENDED, #Errors: 1, #Warnings: 0 ----------


Actual results:

Expected results:
The command should return a correct result about gears' usage.

Additional info:
Comment 2 Miciah Dashiel Butler Masters 2013-09-09 21:12:33 EDT
I have been unable to reproduce this bug:

    [root@broker ~]# oo-admin-ctl-usage --list
    Errors/Warnings will be logged to terminal
    2013-09-09 16:08:38 -0700 INFO::
    ---------- STARTED ----------
    
    User: demo
            Gear: 521cf9ab6892df1657000001, UsageType: GEAR_USAGE, Usage: 315.96563443226944
            Gear: 522a4fc36892dff7ce000001, UsageType: GEAR_USAGE, Usage: 73.18549943226944
            Gear: 522a583b6892dff7ce000041, UsageType: GEAR_USAGE, Usage: 72.58326665449167
    2013-09-09 16:08:38 -0700 INFO::
    ---------- ENDED, #Errors: 0, #Warnings: 0 ----------
    
    [root@broker ~]#

I tried with replication ('MONGO_HOST_PORT="datastore01.example.com:27017,datastore02.example.com:27017"') and without ('MONGO_HOST_PORT="datastore01.example.com:27017"') and with a local MongoDB instance ('MONGO_HOST_PORT="localhost:27017"').

In what environment were you able to reproduce the bug? Can you still reproduce it? Can you attach your broker.conf and mongodb.conf files? Did you create an admin user in MongoDB? (I did.)
Comment 4 openshift-github-bot 2013-09-12 13:12:39 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b0e5196397162c0c214adfa4bf4dc9a82ebe7e79
<oo-admin-ctl-usage> Bug 990451, use Mongo config options for Moped session
https://bugzilla.redhat.com/show_bug.cgi?id=990451

oo-admin-ctl-usage wasn't passing the Mongo session options to the
Moped::Session.new call, so certain MONGO_* settings from broker.conf
weren't applied. Thus MONGO_SSL=true had no effect, causing
oo-admin-ctl-usage to fail on systems where Mongo was configured to
use SSL.
Comment 5 John W. Lamb 2013-09-12 14:25:17 EDT
commit b0e5196397162c0c214adfa4bf4dc9a82ebe7e79
Author: dobbymoodge <jolamb@redhat.com>
Date:   Thu Sep 12 11:05:03 2013 -0400

    <oo-admin-ctl-usage> Bug 990451, use Mongo config options for Moped session
    https://bugzilla.redhat.com/show_bug.cgi?id=990451
    
    oo-admin-ctl-usage wasn't passing the Mongo session options to the
    Moped::Session.new call, so certain MONGO_* settings from broker.conf
    weren't applied. Thus MONGO_SSL=true had no effect, causing
    oo-admin-ctl-usage to fail on systems where Mongo was configured to
    use SSL.
Comment 7 Gaoyun Pei 2013-09-13 00:59:52 EDT
Verify this bug with openshift-origin-broker-util-1.9.12-1.el6op.noarch

Enable Mongo SSL :
[root@broker ~]# grep MONGO_SSL /etc/openshift/broker.conf
MONGO_SSL="true"

Create apps, then try oo-admin-ctl-usage:
[root@broker ~]# oo-admin-ctl-usage --list
Errors/Warnings will be logged to terminal
2013-09-12 21:57:45 -0700 INFO:: 
---------- STARTED ----------

User: gpei
	Gear: 52328605aeb905a2a7000006, UsageType: GEAR_USAGE, Usage: 0.05632611111111111
	Gear: 52329accaeb905a2a7000035, UsageType: GEAR_USAGE, Usage: 0.03287169655861111
2013-09-12 21:57:45 -0700 INFO:: 
---------- ENDED, #Errors: 0, #Warnings: 0 ----------

It works well now.
Comment 10 errata-xmlrpc 2013-09-25 11:29:47 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1275.html

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