Description of problem: After run oo-snapshot I get this error: # oo-snapshot invalid command. Use --help for more information /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.34.1.1/lib/openshift-origin-node/model/application_container.rb:112:in `getpwnam': can't convert nil into String (TypeError) from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.34.1.1/lib/openshift-origin-node/model/application_container.rb:112:in `block in initialize' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.34.1.1/lib/openshift-origin-node/model/application_container.rb:110:in `each' from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.34.1.1/lib/openshift-origin-node/model/application_container.rb:110:in `initialize' from /usr/bin/gear:61:in `new' from /usr/bin/gear:61:in `<main>' Version-Release number of selected component (if applicable): OpenShift Enterprise 2.2 How reproducible: Always you run oo-snapshot Steps to Reproduce: 1. ssh to a Node host 2. run oo-snapshot Actual results: The command returns an error Expected results: The command should print the possible options to use with it. Additional info:
Looks like it's a problem with /usr/bin/gear.
oo-snapshot works when run inside a gear. The reason it fails outside of a gear is that the environment variables that '/usr/bin/gear' uses are not set: @container = OpenShift::Runtime::ApplicationContainer.new(ENV['OPENSHIFT_APP_UUID'], ENV['OPENSHIFT_GEAR_UUID'], Etc.getpwuid.uid, ENV['OPENSHIFT_APP_NAME'], ENV['OPENSHIFT_GEAR_NAME'], ENV['OPENSHIFT_NAMESPACE']) The error seen occurs any time /usr/bin/gear is run outside of a gear: # gear invalid command. Use --help for more information /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.35.4.2/lib/openshift-origin-node/model/application_container.rb:113:in `getpwnam': can't convert nil into String (TypeError) I think the bigger problem here is that we don't document the use of oo-snapshot, which is just a wrapper for '/usr/bin/gear snapshot'. I could see adding some logic in /usr/bin/gear to give a better error when it is run outside of a gear though. If we want to take this path: https://github.com/openshift/origin-server/pull/6133
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/5054607c088762892498cbce7f7dd1f73dc950df BZ1216220 - oo-snapshot fails when run outside of a gear Bug 1216220 Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1216220 oo-snapshot and gear fail when run outside of a gear. Instead, these will fail gracefully with an error stating that they should not be run outside of a gear.
There isn't package rubygem-openshift-origin-node-1.36.1.1-1 in puddle-2-2-2015-05-04 . We need to rebuild a puddle. thanks
oo-snapshot provide clear message on node now. I will run extend testing (app snapshot save/restore ) once 1218872 is fixed. [root@node1 ~]# oo-snapshot This command should only be run inside of a gear. The environment variables 'OPENSHIFT_APP_UUID' and 'OPENSHIFT_GEAR_UUID' are not set. invalid command. Use --help for more information
On puddle-2-2-2015-05-06. snapshot save/restore works. so move bug to verified. [anli@broker ~]$ rhc snapshot save sphp Pulling down a snapshot of application 'sphp' to sphp.tar.gz ... done [anli@broker ~]$ rhc snapshot restore sphp Restoring from snapshot sphp.tar.gz to application 'sphp' ... done
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. https://rhn.redhat.com/errata/RHBA-2015-1463.html