Bug 1272752

Summary: katello-installer --katello-oauth-secret forgets to restart tomcat service
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DEFERRED QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1.1CC: bkearney, chrobert, stbenjam
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-29 21:00:59 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:

Description Pavel Moravec 2015-10-18 12:58:58 UTC
Description of problem:
Running katello-installer --katello-oauth-secret=.. updates pulp oauth and candlepin oauth. While pulp services are restarted to apply the change, tomcat service running tomcat application is not restarted.

This causes problems when e.g. registering a new content host that fails with error

Invalid oauth unit or secret

when running subscription-manager on the Host. (the error is quite confusing, since sub-man can auth to Satellite/Capsule itself properly - the error comes from Satellite internals..)

Checking katello-installer logs, candlepin.conf is updated properly, but tomcat service (or tomcat6 for RHEL6) is not restarted.

Please add the hook to restart tomcat once the candlepin.conf is updated ;-)


Version-Release number of selected component (if applicable):
Sat 6.1.3
katello-installer-base-2.3.20-1.el7sat.noarch
katello-installer-2.3.20-1.el7sat.noarch


How reproducible:
100%


Steps to Reproduce:
1. Have Sat6.1.3 installed (might be RHEL7 relevant only, havent tried on RHEL6)
2. katello-installer --katello-oauth-secret=whateverSecretYouWant
3. Try to register a content host to Sat or Caps


Actual results:
- subscription-manager register fails with:
Invalid oauth unit or secret

- production.log having:

2015-10-17 22:53:57 [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#get as JSON
2015-10-17 22:53:57 [I]   Parameters: {"id"=>"a8425d40-0f42-49ac-a5c7-2d797a3e7050"}
2015-10-17 22:53:57 [D] Setting current user thread-local variable to
2015-10-17 22:53:57 [E] RestClient::Unauthorized: 401 Unauthorized
Body: {"displayMessage":"Invalid oauth unit or secret","requestUuid":"6ac311ca-c60d-4f96-8136-1b58d0fa9cc9"}
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/rh/ruby193/root/usr/share/gems/gems/rbovirt-0.0.29/lib/restclient_ext/request.rb:50:in `block in transmit'
/opt/rh/ruby193/root/usr/share/ruby/net/http.rb:746:in `start'
..
2015-10-17 22:53:58 [I]   Rendered text template (0.0ms)
2015-10-17 22:53:58 [I] Completed 401 Unauthorized in 243ms (Views: 9.6ms | ActiveRecord: 0.0ms)
2015-10-17 22:53:58 [D] With body: {"displayMessage":"Invalid oauth unit or secret","requestUuid":"6ac311ca-c60d-4f96-8136-1b58d0fa9cc9"}

- restarting tomcat service gets rid of the problem


Expected results:
- subscription-manager register succeeds


Additional info:
katello-installer from such test case to be provided

Comment 3 Pavel Moravec 2015-12-22 15:06:56 UTC
Basically *no* action generating or modifying /etc/candlepin/candlepin.conf triggers tomcat restart.

Try e.g.:
#  see what tomcat PID was running
ps aux | grep tomcat
# manually force installer to generate candlepin.conf:
mv /etc/candlepin/candlepin.conf{,.back}
katello-installer
# check tomcat PID unchanged
ps aux | grep tomcat

Comment 4 Bryan Kearney 2016-07-26 15:25:24 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 5 Bryan Kearney 2016-07-26 15:39:39 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 7 Stephen Benjamin 2016-10-13 16:19:30 UTC
Created redmine issue http://projects.theforeman.org/issues/16920 from this bug

Comment 8 Satellite Program 2017-01-27 07:02:01 UTC
Upstream bug assigned to chrobert

Comment 9 Satellite Program 2017-01-28 03:02:07 UTC
Upstream bug assigned to chrobert

Comment 10 Bryan Kearney 2017-03-29 21:00:59 UTC
Thank you for reporting this. The issue is being tracked upstream, and will no longer be tracked in the downstream product. When the upstream issue is fixed, the next Satellite release will contain the fix. I am closing this out as deferred. If you feel this is not correct, please feel free to open with additional information.  We aprpeciate your interest in Red Hat Satellite.