Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1216220 - oo-snapshot is not working
oo-snapshot is not working
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
2.2.0
Unspecified Unspecified
high Severity unspecified
: ---
: ---
Assigned To: Timothy Williams
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-28 15:34 EDT by Ricardo Martinelli de Oliveira
Modified: 2015-07-21 15:12 EDT (History)
9 users (show)

See Also:
Fixed In Version: rubygem-openshift-origin-node-1.36.1.1-1
Doc Type: Bug Fix
Doc Text:
The oo-snapshot command, which is a wrapper for '/usr/bin/gear snapshot', reports an unhelpful error when used outside of a gear environment. This bug fix updates /usr/bin/gear to report an error stating it should only be run inside of a gear when necessary environment variables are not defined. As a result, oo-snapshot reports the same error when run outside of a gear.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-21 15:12:24 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1463 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.6 bug fix and enhancement update 2015-07-21 19:11:33 EDT

  None (edit)
Description Ricardo Martinelli de Oliveira 2015-04-28 15:34:16 EDT
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:
Comment 2 Brenton Leanhardt 2015-04-28 16:27:55 EDT
Looks like it's a problem with /usr/bin/gear.
Comment 3 Timothy Williams 2015-04-30 09:52:11 EDT
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
Comment 4 openshift-github-bot 2015-04-30 17:20:18 EDT
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.
Comment 7 Anping Li 2015-05-04 23:00:08 EDT
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
Comment 11 Anping Li 2015-05-06 02:21:45 EDT
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
Comment 12 Anping Li 2015-05-06 22:36:36 EDT
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
Comment 14 errata-xmlrpc 2015-07-21 15:12:24 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.

https://rhn.redhat.com/errata/RHBA-2015-1463.html

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