Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1921295 - f-m restore expects packages which are missing in the external/remote db setup
Summary: f-m restore expects packages which are missing in the external/remote db setup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.9.0
Assignee: Amit Upadhye
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks: 1889927
TreeView+ depends on / blocked
 
Reported: 2021-01-27 20:54 UTC by Vladimír Sedmík
Modified: 2023-09-15 00:59 UTC (History)
5 users (show)

Fixed In Version: rubygem-foreman_maintain-0.7.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 14:48:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31886 0 Normal Closed f-m restore expects packages which are missing in the external/remote db setup 2021-03-02 17:43:10 UTC
Foreman Issue Tracker 32033 0 Normal Closed Fix mongo command check 2021-03-08 15:05:00 UTC
Red Hat Product Errata RHBA-2021:1312 0 None None None 2021-04-21 14:48:29 UTC

Description Vladimír Sedmík 2021-01-27 20:54:00 UTC
Description of problem:

When running foreman-maintain restore, foreman-maintain checks for DB connections ('Make sure Candlepin DB is up' and 'Make sure Foreman DB is up'), which is done through 'psql' command (https://github.com/theforeman/foreman_maintain/blob/eb981e85a7b723382f5d48f054bf402065051616/lib/foreman_maintain/concerns/base_database.rb#L166-L174)

However, during cloning of the external DB setup, this checks fail because the packages providing that command are missing on the target server.

I'm not sure where the fix shall be done, if in foreman-maintain to avoid usage of those packages or in the installer to install those packages or in the satellite-clone to handle the installation instead of the installer. Please assign the proper component when triaged.


Version-Release number of selected component (if applicable):
6.8.2


How reproducible:
always


Steps to Reproduce:
1. have target external db setup (sat host + db host) with backup from source external db setup (sat host + db host)
2. run satellite-clone


Actual results:
clone fails because foreman-maintain restore fails to check the DB connection


Expected results:
successful restore and successful clone


Additional info:
The workaround is to install the missing packages on the target satellite server before running the satellite-clone:
# yum -y install rh-mongodb34-syspaths rh-postgresql12-syspaths rh-postgresql12-postgresql-evr

Comment 1 Amit Upadhye 2021-02-16 10:58:25 UTC
Hello,

The satellite-clone should take care of installing this packages on new system. The package installation on target system using foreman-maintain can complicate the restore procedure. Considering this, if packages are missing foreman-maintain will throw error and fail the check explicitly.

https://github.com/theforeman/foreman_maintain/pull/447
_
Amit Upadhye.

Comment 2 Bryan Kearney 2021-03-02 16:01:33 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31886 has been resolved.

Comment 4 Brad Buckingham 2021-03-08 13:41:15 UTC
Hi Vlad, do you happen to know if the failure mentioned in comment 3 would impact verification of bug 1889927?   If not, we may be able to get that one to go back through verification.  That bug had failed due to missing packages and referenced this one.

Comment 5 Vladimír Sedmík 2021-03-08 15:49:06 UTC
Hello Brad, the fix for comment#3 was already merged (https://github.com/theforeman/foreman_maintain/pull/453) and will be released today.

Regarding the BZ#1889927, I supposed the 'missing packages issue' will be fixed by this BZ and then cherrypicked into 6.8, which will allow me to verify #1889927. However, it seems this can't be done on the foreman-maintain side (see the comment#1). So we need to fix it in sat-clone or at least in docs to let the user know he needs to install those packages manually.

Comment 6 John Mitsch 2021-03-08 16:40:38 UTC
Just catching up on the conversation - What are the expectations for foreman-maintain restoring a backup on a Satellite remote db install? Sat-clone mostly installs a fresh Satellite with some of the user's configuration and then restores using foreman-maintain.

In theory, a fresh remote db install and a foreman-maintain restore would cause the same errors seen here. If the packages foreman-maintain is using for db checks aren't on a Satellite w/ remote db install, that seems like something we will need to address.

Comment 7 Vladimír Sedmík 2021-03-15 17:21:25 UTC
Using satellite-clone-2.0.1-1.el7sat.noarch and rubygem-foreman_maintain-0.7.7-1.el7sat.noarch (from 6.9.0 snap 17) I was able to verify that the output of the foreman-maintain restore informs the user properly about the missing commands when cloning the remote DB setup:

stdout: Running preparation steps required to run the next scenarios
================================================================================
Make sure Candlepin DB is up:                                         [FAIL]
The psql command not found. Make sure system has psql utility installed.
--------------------------------------------------------------------------------
Make sure Foreman DB is up:                                           [FAIL]
The psql command not found. Make sure system has psql utility installed.
--------------------------------------------------------------------------------
Make sure Mongo DB is up:                                             [FAIL]
The mongo command not found. Make sure system has mongo utility installed.
--------------------------------------------------------------------------------
Checks whether the tools for Mongo DB are installed:                  [OK]
--------------------------------------------------------------------------------
Scenario [preparation steps required to run the next scenarios] failed.

The following steps ended up in failing state:

  [candlepin-db-up]
  [foreman-db-up]
  [mongo-db-up]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="candlepin-db-up,foreman-db-up,mongo-db-up"


At the same time, the underlying issue is being fixed at the satellite-clone side (see BZ#1889927).

Comment 11 errata-xmlrpc 2021-04-21 14:48:24 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 (Satellite 6.9 Satellite Maintenance 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/RHBA-2021:1312

Comment 12 Red Hat Bugzilla 2023-09-15 00:59:21 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


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