Bug 823851

Summary: rhc-chk and "rhc domain status"will return failure message even if all the files are matched in win7
Product: OKD Reporter: yquan <yquan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.xCC: bmeng, ccoleman, nduong, qgong, rmillner, xtian
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhc-0.96.5-1+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:42:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The massage of rhc-chk none

Description yquan 2012-05-22 10:10:41 UTC
Created attachment 585986 [details]
The massage of rhc-chk

Description of problem:
The rhc-chk will return failure message even if all the files are matched.
And I uploaded the output of rhc-chk to the attachment.

Version-Release number of selected component (if applicable):
devenv_1785
rhc-0.93.3
ruby-1.9.3

How reproducible:
always

Steps to Reproduce:
1.Create an domain in win7
2.rhc-chk
3.
  
Actual results:
Will return the message like the attachment.

Expected results:
The result of rhc-chk should 100% passed.

Additional info:

Comment 1 yquan 2012-05-23 09:32:58 UTC
I run the rhc-chk on mac os, the output is like below.

Analyzing system
..EF.Could not open a connection to your authentication agent.
F.
=================================================
||  Your system did not pass all of the tests  ||
=================================================
1) Local /var/root/.ssh/id_rsa does not match remote pub key, SSH auth will not work
	Perhaps you should regenerate your public key, or run 'rhc sshkey add' to add your new key.
2) Either ssh-agent is not running or you do not have any keys loaded.

=========================================================
||  Something went wrong, and not all tests completed  ||
=========================================================
1) test_01_ssh_private_key(Test3_SSH):
	NoMethodError: undefined method `load_data_public_key' for Net::SSH::KeyFactory:Class
	    /Library/Ruby/Gems/1.8/gems/rhc-0.93.6/lib/rhc-common.rb:309:in `get_ssh_keys'
	    /Library/Ruby/Gems/1.8/gems/rhc-0.93.6/bin/rhc-chk:290:in `test_01_ssh_private_key'

Comment 2 Fabiano Franz 2012-05-30 19:42:39 UTC
Right now failing only on Mac, lowering severity so this doesn't block the build and because we now have rhc setup to configure what's missing.

Comment 3 Xiaoli Tian 2012-06-13 09:56:58 UTC
Tested on Mac again with rhc-0.93.19, it works

dhcp-8-149:test root# rhc domain status -p 1
Loaded suite /usr/bin/rhc-chk
Started
......

Finished in 4.716513 seconds.

6 tests, 18 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

1.27 tests/s, 3.82 assertions/s

Comment 4 Meng Bo 2012-06-13 10:09:52 UTC
still cannot pass the rhc-chk on Windows paltform by the following failures for rhc-0.93.19.


Loaded suite C:/Ruby193/bin/rhc-chk
Started
..F
===============================================================================
Failure:
test_01_ssh_private_key(Test3_SSH)
C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.19/bin/rhc-chk:349:in `check_permis
sions'
     346:
     347:     perms = sprintf('%o',File.stat(file).mode)[-3..-1]
     348:
  => 349:     assert_match permission, perms, error_for(:bad_permissions,file,pe
rms,permission.source)
     350:   end
     351: end
     352:
C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.19/bin/rhc-chk:282:in `test_01_ssh_
private_key'
<> expected but was
<>

diff:
  nil
===============================================================================
F
===============================================================================
Failure:
test_02_ssh_public_key(Test3_SSH)
C:/ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.93.19/bin/rhc-chk:312:in `test_02_ssh_
public_key'
     309:
     310:     # Test public key and remote key
     311:     assert_not_nil $user_info, error_for(:no_account)
  => 312:     assert $remote_ssh_pubkeys.include?(@@local_ssh_pubkey), error_for
(:no_match_pub, @libra_kfile)
     313:   ensure
     314:     fp.close if fp
     315:   end
<> expected but was
<>

diff:
  nil
===============================================================================

Private key id_rsa has wrong permission on Windows (-rw-r--r--), and cannot change it by chmod.

BTW, rhc-chk will always check the ssh-agent even if user dose not start it. And only start it and load the key to it can pass the check point.

Comment 5 Nam Duong 2012-07-19 03:47:56 UTC
Increasing severity on this bug since we're so dependent upon this status check to work in order to have a healthy rhc environment and overall user experience.  Hoping to increase severity/priority of  https://bugzilla.redhat.com/show_bug.cgi?id=836483 in the process.  


I ran into this today while trying to debug a user's environment (Win) as well as my own (Mac OSX-Lion).  Both were on version 0.95.13 based on yesterday's upgrade.  Even after running rhc setup, things weren't working and we were dependent upon this status check to detect actual problems rather than throwing errors of it's own.

Some things to catch:  When GIT_SSH env variable is set, ssh may work, but git clone won't work.  

Hope that helps;
~Nam

Comment 6 Xiaoli Tian 2012-07-19 04:08:34 UTC
Most part about domain status failure have been fixed in this bug :https://bugzilla.redhat.com/show_bug.cgi?id=836483 on rhc-0.95.14

We should release rhc-0.95.14 in this sprint but not rhc-0.95.13.

Comment 7 John Poelstra 2012-07-31 17:21:34 UTC
Related to fix for 841170 and working on today.

Comment 8 Fabiano Franz 2012-08-01 15:31:31 UTC
I think I got all issues related to rhc-chk in the Windows platform.
When there is no pageant running users can still see a failure in rhc domain status, but it's not blocker (user will have to input the key password, the test failure message is explanatory).

Comment 9 Rony Gong 🔥 2012-08-03 10:21:20 UTC
verified on rhc-0.96.8, and the unfixed issue will tracked by 841170