Bug 1444188 - --reset should stop workers or it will fail on pulp-manage-db
Summary: --reset should stop workers or it will fail on pulp-manage-db
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.3.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: Jitendra Yejare
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-20 19:21 UTC by Chris Roberts
Modified: 2019-04-01 20:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 19276 0 Normal Closed --reset should stop workers or it will fail on pulp-manage-db 2020-06-12 03:17:43 UTC

Description Chris Roberts 2017-04-20 19:21:29 UTC
If you do not do katello-service stop before --reset you hit this:

[ WARN 2017-04-14 04:04:41 verbose] /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: The following processes are still running, please stop the running workers before retrying the pulp-manage-db command.
[ WARN 2017-04-14 04:04:41 verbose] /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: scheduler.lan
[ WARN 2017-04-14 04:04:41 verbose] /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: reserved_resource_worker-0.lan
[ WARN 2017-04-14 04:04:41 verbose] /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: resource_manager.lan
[ WARN 2017-04-14 04:04:41 verbose] /Stage[main]/Pulp::Database/Exec[migrate_pulp_db]/returns: reserved_resource_worker-1.lan
[ERROR 2017-04-14 04:04:41 verbose] pulp-manage-db && touch /var/lib/pulp/init.flag returned 70 instead of one of [0]
[ERROR 2017-04-14 04:04:41 verbose] /usr/share/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
[ERROR 2017-04-14 04:04:41 verbose] /usr/share/ruby/vendor_ruby/puppet/type/exec.rb:160:in `sync'

Comment 2 Jitendra Yejare 2017-12-12 11:23:40 UTC
Verified !

@ Satellite 6.3 snap 28

Steps:

Reset satellite.

Behavior:

The reset script is now stopping the services itself and hence no error as stated in description observed.


Logs:
# satellite-installer --scenario satellite --reset
Are you sure you want to continue? This will drop the databases, reset all configurations that you have made and bring the server back to a fresh install. [y/n]
y
/usr/sbin/service-wait foreman-tasks stop
Redirecting to /bin/systemctl stop foreman-tasks.service

/usr/sbin/service-wait httpd stop
Redirecting to /bin/systemctl stop httpd.service

/usr/sbin/service-wait pulp_celerybeat stop
Redirecting to /bin/systemctl stop pulp_celerybeat.service

/usr/sbin/service-wait foreman-proxy stop
Redirecting to /bin/systemctl stop foreman-proxy.service

/usr/sbin/service-wait pulp_streamer stop
Redirecting to /bin/systemctl stop pulp_streamer.service

/usr/sbin/service-wait pulp_resource_manager stop
Redirecting to /bin/systemctl stop pulp_resource_manager.service

/usr/sbin/service-wait smart_proxy_dynflow_core stop
Redirecting to /bin/systemctl stop smart_proxy_dynflow_core.service

/usr/sbin/service-wait pulp_workers stop
Redirecting to /bin/systemctl stop pulp_workers.service

/usr/sbin/service-wait tomcat stop
Redirecting to /bin/systemctl stop tomcat.service

/usr/sbin/service-wait squid stop
Redirecting to /bin/systemctl stop squid.service

/usr/sbin/service-wait qdrouterd stop
Redirecting to /bin/systemctl stop qdrouterd.service

/usr/sbin/service-wait qpidd stop
Redirecting to /bin/systemctl stop qpidd.service

/usr/sbin/service-wait mongod stop
Redirecting to /bin/systemctl stop mongod.service

Success!
katello-service stop --exclude postgresql finished successfully!
foreman-rake db:drop 2>&1 finished successfully!
rm -f /var/lib/candlepin/cpdb_done finished successfully!
rm -f /var/lib/candlepin/cpinit_done finished successfully!
Redirecting to /bin/systemctl stop tomcat.service
service tomcat stop finished successfully!
could not change directory to "/root"
sudo su postgres -c "dropdb candlepin" finished successfully!
rm -f /var/lib/pulp/init.flag finished successfully!
Redirecting to /bin/systemctl stop httpd.service
service-wait httpd stop finished successfully!
Redirecting to /bin/systemctl stop mongod.service
service-wait mongod stop finished successfully!
rm -f /var/lib/mongodb/pulp_database* finished successfully!
Redirecting to /bin/systemctl start mongod.service
service-wait mongod start finished successfully!
rm -rf /var/lib/pulp/{distributions,published,repos}/* finished successfully!
Installing             Done                                               [100%] [................................................................................................................................]
  Success!
  * Satellite is running at https://xyz.redhat.com

  * To install an additional Capsule on separate machine continue by running:

      capsule-certs-generate --foreman-proxy-fqdn "$CAPSULE" --certs-tar "/root/$CAPSULE-certs.tar"

  * To upgrade an existing 6.2 Capsule to 6.3:
      Please see official documentation for steps and parameters to use when upgrading a 6.2 Capsule to 6.3.

  The full log is at /var/log/foreman-installer/satellite.log

Comment 3 Satellite Program 2018-02-21 16:54:37 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://access.redhat.com/errata/RHSA-2018:0336


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