Bug 1226061 - Lack of raising exception and error logging for the ssh and scp commands while copying keys and certs from broker to F5 LTM
Summary: Lack of raising exception and error logging for the ssh and scp commands whil...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Miciah Dashiel Butler Masters
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-28 21:26 UTC by Miheer Salunke
Modified: 2019-08-15 04:38 UTC (History)
8 users (show)

Fixed In Version: rubygem-openshift-origin-routing-daemon-0.25.1.2-1.el6op
Doc Type: Bug Fix
Doc Text:
The routing daemon previously did not check the exit status of `ssh` and `scp` commands for copying certificates and keys to and deleting the same from the F5 BIG-IP host. This caused some errors in copying keys to F5 BIG-IP to be ignored. This bug fix updates the routing daemon, and the F5 iControl REST API model now checks the exit status of `ssh` and `scp` commands and raises an exception if the exit status is not 0. As a result, the routing daemon now logs errors from the `ssh` and `scp` commands.
Clone Of:
Environment:
Last Closed: 2015-09-30 16:37:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1844 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.7 security, bug fix and enhancement update 2015-09-30 20:35:28 UTC

Description Miheer Salunke 2015-05-28 21:26:58 UTC
Description of problem:

When the key and cert transfers from the broker to the F5 LTM via ssh/scp do not work an exception is not raised.
We should also be able to log, and handle errors from the ssh and scp commands.

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

Steps to reproduce-

1.Set up BIG LTM env
2.Set up ose all-in-one env, and install routing-daemon, configure it to use BIGIP as external LB.
3.Create a scalable app, add alias, and update ssl cert for this alias

How reproducible-
Always

Actual results:
1.Exceptions are not raised
2.Logging and handling of error is not done


Expected results:
1.Exceptions shall be raised
2.Logging and handling of error shall be done

Additional info:

https://github.com/calfonso/origin-server/commit/33860aaa9807b7f19f654104d6fc44fcff7c86bb here the result var can be used to log and handle errors

Comment 2 Miciah Dashiel Butler Masters 2015-05-28 21:36:00 UTC
PR: https://github.com/openshift/origin-server/pull/6154

I will need to perform some manual testing and get the PR merged before I can mark this report ON_QA.

Comment 3 openshift-github-bot 2015-08-31 20:47:37 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ef08acd4d00f7d7c87dc57fdfe17a21206cf5cbd
routing-daemon: F5: check for and log SSH errors

F5IControlRestLoadBalancerModel: Add run method that runs the given
command, captures stdout and stderr, and raises an exception if the
command fails.

F5IControlRestLoadBalancerModel#add_ssl: Use the new run method to check
for, log, and handle errors from the ssh and scp commands.  Modify the
logging output to be neater and more consistent.

This commit fixes bug 1226061.

Comment 7 Anping Li 2015-09-22 07:11:10 UTC
Block by the following error. waiting response in https://bugzilla.redhat.com/show_bug.cgi?id=1217572.
[root@broker log]# cat /var/log/openshift-routing-daemon.output 
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.25.1.1/lib/openshift/routing/models/f5-icontrol-rest.rb:63:in `rescue in rest_request': undefined method `wrap_exceptions' for #<Hash:0x00000002796998> (NoMethodError)

Comment 10 Anping Li 2015-09-24 05:04:43 UTC
Verified and pass.
We can see the exception once there isn't permission.

W, [2015-09-24T05:02:52.196433 #766]  WARN -- : Got an exception: Command `scp -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o VerifyHostKeyDNS=no -o UserKnownHostsFile=/dev/null -i "/etc/openshift/bigip.key" /tmp/bigip-ssl-cert20150924-766-xs345p ose.88.53:/var/tmp/www.appsphpalias.com.crt` returned exit code 1, output: Warning: Permanently added '10.3.88.53' (RSA) to the list of known hosts.^M
Permission denied (publickey,keyboard-interactive,hostbased).^M
lost connection

Comment 12 errata-xmlrpc 2015-09-30 16:37:44 UTC
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/RHSA-2015-1844.html


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