Bug 2172540
Summary: | "Restoring postgresql global objects" step is buggy and not required | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sayan Das <saydas> |
Component: | Satellite Maintain | Assignee: | Evgeni Golov <egolov> |
Status: | CLOSED ERRATA | QA Contact: | Griffin Sullivan <gsulliva> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.13.0 | CC: | ahumbe, egolov, ehelms, gsulliva, pcreech, smallamp |
Target Milestone: | 6.13.0 | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | rubygem-foreman_maintain-1.2.7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-05-03 13:25:13 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
Sayan Das
2023-02-22 13:29:08 UTC
JFYI, Another colleague of mine has confirmed the issue as reproducible with online backup restoration. Also, I tested today and I had no issues while restoring the capsule 6.13 from online backup Is this a regression from Satellite 6.12? (In reply to Brad Buckingham from comment #4) > Is this a regression from Satellite 6.12? I am positive it works on 6.11 just fine but I could not test it on 6.12 recently due to a lack of resources with me. So until I am able to test it on Sat 6.12, Unfortunately, I can unable to confirm whether it's a regression from 6.12 or not. @saydas I've created a PR that just drops this code, as it is broken and unnecessary: https://github.com/theforeman/foreman_maintain/pull/691 If you have a system where you can reliably reproduce the issue, could you please try the RPM attached to that PR and see if it manages to restore a working system for you? Hello Evgeni Sure. Let me try it out by EOD today\tomorrow and then get back to you. ( Keeping the needinfo flag enabled ) -- Sayan Before I tried the RPM from the PR , Evgeni had look a peek at my latest reproducer and the only conclusion was that something had changed the DB password while the restoration was still in progress but no idea who and how ( as I was the sole admin working on that system ). So I rebuilt that system, Installed a fresh instance of 6.13, Installed rubygem-foreman_maintain-1.2.6-1.20230301111458534583.pr691.1.g53dac01.el8.noarch.rpm from the PR and now I could successfully restore the online backup without any issues. The Satellite UI looked healthy as well. # rpm -q satellite rubygem-foreman_maintain satellite-6.13.0-6.el8sat.noarch rubygem-foreman_maintain-1.2.6-1.20230301111458534583.pr691.1.g53dac01.el8.noarch Restore : ... Confirm dropping databases and running restore: WARNING: This script will drop and restore your database. Your existing installation will be replaced with the backup database. Once this operation is complete there is no going back. Do you want to proceed? (assuming yes) [OK] -------------------------------------------------------------------------------- Setting file security: - Restoring SELinux context [OK] -------------------------------------------------------------------------------- Restore configs from backup: \ Restoring configs [OK] -------------------------------------------------------------------------------- Run installer reset: / Installer reset [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-api.socket, pulpcore-content.socket, pulpcore-worker, pulpcore-worker, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, foreman.socket, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy / All services stopped [OK] -------------------------------------------------------------------------------- Drop postgresql databases: - Dropping pulpcore database [OK] -------------------------------------------------------------------------------- Start applicable services: Starting the following service(s): postgresql - All services started [OK] -------------------------------------------------------------------------------- Restore candlepin postgresql dump from backup: - Restoring candlepin dump [OK] -------------------------------------------------------------------------------- Restore foreman postgresql dump from backup: \ Restoring foreman dump [OK] -------------------------------------------------------------------------------- Restore pulpcore postgresql dump from backup: \ Restoring pulpcore dump [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): postgresql - All services stopped [OK] -------------------------------------------------------------------------------- Migrate pulpcore db: / Migrating pulpcore database [OK] -------------------------------------------------------------------------------- Ensure Candlepin runs all migrations after restoring the database: [OK] -------------------------------------------------------------------------------- Start applicable services: Starting the following service(s): redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-worker, pulpcore-worker, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy | All services started [OK] -------------------------------------------------------------------------------- Run daemon reload: [OK] -------------------------------------------------------------------------------- Procedures::Installer::Upgrade: [OK] -------------------------------------------------------------------------------- Execute upgrade:run rake task: [OK] -------------------------------------------------------------------------------- # hammer ping database: Status: ok Server Response: Duration: 0ms candlepin: Status: ok Server Response: Duration: 29ms candlepin_auth: Status: ok Server Response: Duration: 32ms candlepin_events: Status: ok message: 0 Processed, 0 Failed Server Response: Duration: 0ms katello_events: Status: ok message: 0 Processed, 0 Failed Server Response: Duration: 0ms pulp3: Status: ok Server Response: Duration: 62ms pulp3_content: Status: ok Server Response: Duration: 51ms foreman_tasks: Status: ok Server Response: Duration: 3ms Updating the "real" description of this bug to: The "Restoring postgresql global objects" step in "foreman-maintain restore" is buggy: - it's executing the restore as the "foreman" user who has not the sufficient permissions to perform the actions (modifying global objects requires superuser permission) - it sometimes fails with 'password authentication failed for user "foreman"' as the password of the user is changed during the overall restore procedure However, it's also not required, as the only thing it's supposed to do is to (re-)create the users in the database, but that's already handled by the Installer run that happens before the Globals Restore. To avoid any further issues, we can drop this step completely and rely on the Installer for the management of the database users. Created redmine issue https://projects.theforeman.org/issues/36152 from this bug Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36152 has been resolved. Verified on 6.13 snap 15 Backup and restore works without the "Restoring postgresql global objects" step Steps to Reproduce: 1) Setup whatever content on Satellite 2) # satellite-maintain backup online -s -y /mnt/online/ 3) # satellite-maintain restore -y /mnt/online/<backup-name> 4) Check /var/log/foreman-maintain/foreman-maintain.log and verify pg_globals.dump was not ran Results: Backup and restore run successfully and pg_globals.dump is not present in the logs 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 (Important: Satellite 6.13 Release), 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-2023:2097 The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |