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:
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.)
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.
commit b0e5196397162c0c214adfa4bf4dc9a82ebe7e79 Author: dobbymoodge <jolamb> 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.
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.
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