Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1422236 - Bootstrap fails with traceback if it cannot find the Foreman SSH Key
Bootstrap fails with traceback if it cannot find the Foreman SSH Key
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Bootstrap (Show other bugs)
6.2.7
Unspecified Unspecified
medium Severity medium (vote)
: 6.2.9
: Unused
Assigned To: Rich Jerrido
Sanket Jagtap
: Triaged
Depends On:
Blocks: 1426421
  Show dependency treegraph
 
Reported: 2017-02-14 15:01 EST by Rich Jerrido
Modified: 2017-05-01 10:00 EDT (History)
6 users (show)

See Also:
Fixed In Version: katello-client-bootstrap-1.3.0-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1426421 (view as bug list)
Environment:
Last Closed: 2017-05-01 10:00:01 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
Github https://github.com/Katello/katello-client-bootstrap/pull/157 None None None 2017-02-14 19:25 EST
Red Hat Product Errata RHBA-2017:1191 normal SHIPPED_LIVE Satellite 6.2.9 Async Bug Release 2017-05-01 13:49:42 EDT

  None (edit)
Description Rich Jerrido 2017-02-14 15:01:48 EST
Description of problem:


When running bootstrap.py with the --rex switches against a Capsule without the SSH feature, bootstrap fails with a traceback. 

Version-Release number of selected component (if applicable):
katello-client-bootstrap-1.2.2

How reproducible:
100%




Steps to Reproduce:

Run bootstrap with the --rex options against a capsule without the SSH feature

example: 

bootstrap.py -v -s capsule-1.example.com -o Example -a ak_Reg_To_Dev_EL7 --skip-foreman --enablerepos=rhel-7-server-satellite-tools-6.2-rpms --rex --rex-user=root --force


Actual results:
traceback similar to:

[NOTIFICATION], [2017-02-14 17:02:48], [The server was unable to fulfill the request. Error: 404] Traceback (most recent call last): File "./bootstrap.py", line 874, in install_foreman_ssh_key() File "./bootstrap.py", line 360, in install_foreman_ssh_key if foreman_ssh_key in open(foreman_ssh_authfile, 'r').read(): UnboundLocalError: local variable 'foreman_ssh_key' referenced before assignment

Expected results:

installing the remote execution key is an optional function of the bootstrap script. In the event that the key is unable to be downloaded, it should notify the user, but continue. 


Additional info:
Comment 3 pm-sat@redhat.com 2017-02-23 16:11:53 EST
Please add verifications steps for this bug to help QE verify
Comment 4 Rich Jerrido 2017-02-27 05:33:58 EST
Verification Steps for QE:


Overview
========

As per the description of this BZ, bootstrap.py previously failed if the user provided the --rex & --rex-user options when run against a Capsule without the REX/SSH feature enabled. 

Setup
=====

* You must have an activation key to register the client
* You must have a Satellite Server. 
* You must have a Capsule without the REX/SSH feature enabled. 


Verification Steps
==================

* On the capsule, confirm that REX isn't installed

- hammer --output json capsule list

* on a client download the bootstrap.py script from the Satellite or Capsule and make executable

  wget http://satellite.example.com/pub/bootstrap.py
  chmod +x bootstrap.py

* on the client, run bootstrap to register the client via the capsule (that doesn't have REX enabled) with the --rex & --rex-user switch
n
./bootstrap.py -v -s capsule-1.example.com -o Example -a ak_Reg_To_Dev_EL7 --skip-foreman --enablerepos=rhel-7-server-satellite-tools-6.2-rpms --rex --rex-user=root

Expected behavior
=================

* bootstrap.py doesn't provide the traceback as listed in the description. 

* bootstrap.py informs the user that the REX keys could not be downloaded but continues with the other setup steps, similar to the following:

[NOTIFICATION], [2017-02-27 05:30:38], [The server was unable to fulfill the request. Error: 404 - Not Found] 
[NOTIFICATION], [2017-02-27 05:30:38], [Please ensure the Remote Execution feature is configured properly] 
[WARNING], [2017-02-27 05:30:38], NON-FATAL: [Installing Foreman SSH key] failed to execute properly
Comment 5 Rich Jerrido 2017-03-13 17:07:17 EDT
We may want to rebase to katello-client-bootstrap-1.3.0 (https://github.com/Katello/katello-client-bootstrap/releases/tag/1.3.0) to address this.
Comment 6 Sanket Jagtap 2017-04-04 02:07:51 EDT
Build: Satellite 6.2.9 snap2

[root@sjagtap-client ~]# ./bootstrap.py -s intel.asdas.com -o Default_Organization -a ak-rhel-7 --enablerepos=rhel-7-server-satellite-tools-6.2-rpms --skip-foreman --force --rex --rex-user=root

Log:

Complete!
[SUCCESS], [2017-04-03 11:58:15], [/usr/bin/yum -y install katello-agent], completed successfully.

[RUNNING], [2017-04-03 11:58:15], [/sbin/chkconfig goferd on]
Note: Forwarding request to 'systemctl enable goferd.service'.
[SUCCESS], [2017-04-03 11:58:15], [/sbin/chkconfig goferd on], completed successfully.

[RUNNING], [2017-04-03 11:58:15], [/sbin/service goferd restart]
Redirecting to /bin/systemctl restart  goferd.service
[SUCCESS], [2017-04-03 11:58:15], [/sbin/service goferd restart], completed successfully.

[NOTIFICATION], [2017-04-03 11:58:15], [Removing old RHN packages]
[RUNNING], [2017-04-03 11:58:15], [/usr/bin/yum -y remove rhn-setup rhn-client-tools yum-rhn-plugin rhnsd rhn-check rhnlib spacewalk-abrt spacewalk-oscap osad 'rh-*-rhui-client']
Loaded plugins: package_upload, product-id, search-disabled-repos, subscription-
              : manager
No Match for argument: rhn-setup
No Match for argument: rhn-client-tools
No Match for argument: yum-rhn-plugin
No Match for argument: rhnsd
No Match for argument: rhn-check
No Match for argument: rhnlib
No Match for argument: spacewalk-abrt
No Match for argument: spacewalk-oscap
No Match for argument: osad
No Match for argument: rh-*-rhui-client
No Packages marked for removal
[SUCCESS], [2017-04-03 11:58:19], [/usr/bin/yum -y remove rhn-setup rhn-client-tools yum-rhn-plugin rhnsd rhn-check rhnlib spacewalk-abrt spacewalk-oscap osad 'rh-*-rhui-client'], completed successfully.

[NOTIFICATION], [2017-04-03 11:58:19], [The server was unable to fulfill the request. Error: 404 - Not Found]
[NOTIFICATION], [2017-04-03 11:58:19], [Please ensure the Remote Execution feature is configured properly]
[WARNING], [2017-04-03 11:58:19], NON-FATAL: [Installing Foreman SSH key] failed to execute properly.
Comment 8 errata-xmlrpc 2017-05-01 10:00:01 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://access.redhat.com/errata/RHBA-2017:1191

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