Hide Forgot
Description of problem: If you try to run StickShift SDK based commands in either sudo or cron you get the error below. This significantly hampers our ability to write monitoring scripts around StickShift sdk itself, or around any commands that use it. Version-Release number of selected component (if applicable): rubygem-stickshift-common-0.7.2-1.el6_2.noarch How reproducible: every time Steps to Reproduce: 1. sudo rhc-admin-ctl-district 2. wait for the command to run (takes about 1 minute) 3. notice the error as below Actual results: # sudo rhc-admin-ctl-district /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:282:in `get_valid_seed_node': Cannot connect to a replica set using seeds localhost:27017, : (Mongo::ConnectionFailure) from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:158:in `connect_to_members' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:30:in `connect' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:160:in `connect' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:500:in `setup' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:144:in `initialize' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:121:in `new' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:121:in `db' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:114:in `district_collection' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:22:in `find_all_districts' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.7.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:168:in `rescue_con_failure' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:21:in `find_all_districts' from /var/www/stickshift/broker/app/models/district.rb:37:in `find_all' from /usr/bin/rhc-admin-ctl-district:180 Expected results: The command should run as it runs normally
Unable to reproduce on dev.
I've tried to test this on devenv_1757. Since only root user have sudo permission, create another user and try to sudo will get "bash: /usr/bin/sudo: Permission denied" [root@ip-10-100-211-171 ~]# ls -lh /usr/bin/sudo ---x--x---. 2 root wheel 208K Jul 21 2011 /usr/bin/sudo And sudo with root user itself, can not reproduce it as well #sudo rhc-admin-ctl-district -h == Synopsis rhc-admin-ctl-district: Control districts == Usage rhc-admin-ctl-district OPTIONS Options: -u|--uuid <district uuid> District uuid (alphanumeric) -c|--command <command> (add-node|remove-node|deactivate-node|activate-node|add-capacity|remove-capacity|create|destroy) -n|--name <district name> District name (Used on create or in place of uuid on other commands) -p|--node_profile <profile_size> (small(default)|jumbo|exlarge|large|medium|micro) Only needed for create -i|--server_identity Hi, Thomas Can you help to check if that's what you want and if it works for you now? Thanks
Yeah, I tried this out on Krishna's devenv on Friday and it seems to be working now. I believe whoever fixed the ruby CONST errors also fixed this problem. NOTE: this still fails in STG and PROD right now, so I'll double check this once we push the next release to STG.
Hi, Thomas Does this work for you on STG and PROD? Thanks
Unfortunately it still doesn't work in STG and PROD. I worked with Krishna on this, and I tested it in his devenv and it worked fine. So there is something different between STG/PROD and the devenvs. Note: Another difference is that when we run commands in STG and PROD, we still get those annoying "warning: already initialized constant" messages from the rhc-admin-* commands. We don't get those in the devenv anymore. So whatever fixed those messages in the devenv might be what fixed this problem too. Moving back to assigned. [root@REDACTED ~]# sudo rhc-admin-ctl-district /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:282:in `get_valid_seed_node': Cannot connect to a replica set using seeds localhost:27017, : (Mongo::ConnectionFailure) from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:158:in `connect_to_members' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/util/pool_manager.rb:30:in `connect' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:160:in `connect' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:500:in `setup' from /usr/lib/ruby/gems/1.8/gems/mongo-1.5.2/lib/mongo/repl_set_connection.rb:144:in `initialize' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.10.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:121:in `new' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.10.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:121:in `db' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:114:in `district_collection' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:22:in `find_all_districts' from /usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.10.8/lib/stickshift-controller/lib/stickshift/mongo_data_store.rb:168:in `rescue_con_failure' from /var/www/stickshift/broker/lib/express/broker/mongo_data_store.rb:21:in `find_all_districts' from /var/www/stickshift/broker/app/models/district.rb:37:in `find_all' from /usr/bin/rhc-admin-ctl-district:180 [root@REDACTED ~]#
FYI, if I edit the /etc/sudoers and change: Defaults env_reset to Defaults !env_reset It seems the command starts working fine.
(In reply to comment #6) > > It seems the command starts working fine. Moving to On_QA
Hi Thomas, Since the issue occurs on STG and PROD only, and for QE, we do not have permission to test the bug. Could you help test this on STG and PROD. Thanks.
Yep, this is working now. Closing bug.