Bug 1272752 - katello-installer --katello-oauth-secret forgets to restart tomcat service
katello-installer --katello-oauth-secret forgets to restart tomcat service
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer (Show other bugs)
x86_64 Linux
low Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Katello QA List
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2015-10-18 08:58 EDT by Pavel Moravec
Modified: 2017-03-29 17:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-03-29 17:00:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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
Foreman Issue Tracker 16920 None None None 2016-10-13 12:19 EDT

  None (edit)
Description Pavel Moravec 2015-10-18 08:58:58 EDT
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

How reproducible:

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 10:06:56 EST
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}
# check tomcat PID unchanged
ps aux | grep tomcat
Comment 4 Bryan Kearney 2016-07-26 11:25:24 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 5 Bryan Kearney 2016-07-26 11:39:39 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 7 Stephen Benjamin 2016-10-13 12:19:30 EDT
Created redmine issue http://projects.theforeman.org/issues/16920 from this bug
Comment 8 pm-sat@redhat.com 2017-01-27 02:02:01 EST
Upstream bug assigned to chrobert@redhat.com
Comment 9 pm-sat@redhat.com 2017-01-27 22:02:07 EST
Upstream bug assigned to chrobert@redhat.com
Comment 10 Bryan Kearney 2017-03-29 17:00:59 EDT
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.

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