Bug 1272568 - Command to search for bad gears in DB. Gears that have nil for server_identiy or uid
Command to search for bad gears in DB. Gears that have nil for server_identiy...
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Rory Thrasher
Wei Sun
Depends On:
Blocks: 1273542 1279584
  Show dependency treegraph
Reported: 2015-10-16 14:58 EDT by Ryan Howe
Modified: 2016-02-01 11:24 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1279584 (view as bug list)
Last Closed: 2016-01-13 17:11:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ryan Howe 2015-10-16 14:58:56 EDT
Description of problem: When a gear somehow has server_identity = nil  ose does not like it. We need to add some function that searches for this so that we can ID what gears are invalid. 

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


Gear in application has nil set for uid and server_identity 


Additional info:
Script to search db for nil value in server_identiy. 

require '/var/www/openshift/broker/config/environment'
bad_gears = []
Application.all.each do |app|
        app.gears.select {|g| !defined?(g.server_identity) or g.server_identity == nil }.each do |bad_gear|
                bad_gears << bad_gear
puts "No bad gears found" if bad_gears.empty?
bad_gears.each do |gear|
        puts "Bad gear found: #{gear.uuid}"
        puts "Bad gear object: #{gear.inspect}"
        puts ""
Comment 2 Rory Thrasher 2015-12-17 11:46:27 EST
Whats the current result of oo-admin-chk in this situation?  When I create an app and set the server_identity=nil, oo-admin-chk is able to correctly identify the server_identity mismatch.

# oo-admin-chk
Started at: 2015-12-17 16:34:41 UTC

User data populated in 0 seconds

Domain data populated in 0 seconds

District data populated in 0 seconds

Total gears found in mongo: 2
Application data populated in 0 seconds

Usage data populated in 0 seconds

Fetched all gears in 20 seconds
Total gears found on the nodes: 2
Total nodes that responded: 1
Checked application gears on nodes in 0 seconds

Checked application gears on nodes (reverse match) in 0 seconds

Finished at: 2015-12-17 16:35:02 UTC
Total time: 20.448s
Gear 5672e18c95cabf165700001f exists but node 'ip-172-18-15-60' does not match DB server_identity ''
Please refer to the oo-admin-repair tool man page to resolve some of these inconsistencies if no suggestion was provided with any error message(s).

If oo-admin-chk is not coming back with a similar result, then there may be a combination of things going on.  In addition to server_identity being nil, there may be something missing from the gear.
Comment 4 Rory Thrasher 2016-01-13 17:11:18 EST
I'm going to close this as oo-admin-chk should already catch gears that have a server_identity of nil.  If it comes up again, feel free to reopen so I can take a deeper look.

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