Bug 1272568 - Command to search for bad gears in DB. Gears that have nil for server_identiy or uid
Summary: Command to search for bad gears in DB. Gears that have nil for server_identiy...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Rory Thrasher
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks: 1273542 1279584
TreeView+ depends on / blocked
 
Reported: 2015-10-16 18:58 UTC by Ryan Howe
Modified: 2019-10-10 10:21 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1279584 (view as bug list)
Environment:
Last Closed: 2016-01-13 22:11:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ryan Howe 2015-10-16 18:58:56 UTC
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):
2.2.6

Reproduce:

Gear in application has nil set for uid and server_identity 

"server_identity"=>nil
"uid"=>nil

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
        end
end
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 ""
end

Comment 2 Rory Thrasher 2015-12-17 16:46:27 UTC
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 ''
FAILED
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 22:11:18 UTC
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.