This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2173235 - satellite-maintain backup offline does not collect custom certificates and thus can't restore by passing katello-cert-check
Summary: satellite-maintain backup offline does not collect custom certificates and th...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.10.7
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-24 23:02 UTC by Ricardo Santamaria
Modified: 2024-06-06 16:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 16:09:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   SAT-16155 0 None Migrated None 2024-06-06 16:09:13 UTC

Description Ricardo Santamaria 2023-02-24 23:02:37 UTC
Description of problem:


Version-Release number of selected component (if applicable):
satellite-6.10.7.1-1.el7sat.noarch
on RHEL 7.9 (3.10.0-1160.59.1)

How reproducible:
Generate backup of Satellite 6.10 with custom certificates



Steps to Reproduce:
1. Generate backup of Satellite with customer certificates 

# satellite-maintain backup offline --skip-pulp-content /var/backup_directory

2. On reproducer/restore target attempt to restore using backup files:

# satellite-maintain restore /var/backup_directory

3. Restore fails:

<SNIP>
Checking to see if the private key matches the certificate: Error opening Private Key /etc/pki/tls/private/satellite-wildcard.example.com.key
140094951200656:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('/etc/pki/tls/private/satellite-wildcard.example.com.key','r')
140094951200656:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
unable to load Private Key
 
[FAIL]
</SNIP>

Actual results:
If custom certs are present satellite-maintain does not collect  

Expected results:
Expected satellite-maintain backup to collected needed /etc/pki/tls/* certs to properly restore database

Additional info:

Comment 5 Eric Helms 2023-03-01 18:05:20 UTC
I think the root cause of the issue is that the files are either not present during backup or not readable by foreman-maintain during the backup process (permissions? selinux?). This part would have to be confirmed on the user's system by looking closer.


Here is my reasoning for this after doing some testing. The foreman-maintain code around backups does not check that every file marked to be included in the backup actually exists at the time of the backup. Well, I should say, it does check for their existence but it does not throw an error if they do not exist, instead it omits them from the file set that is included in the backup:


https://github.com/evgeni/foreman_maintain/blob/53dac01cb8d1bc6da382562d9b4449cec732da9c/definitions/procedures/backup/config_files.rb#L58

That line is effectively saying -- only keep the ones that exist, see example logic:


irb(main):008:0> File.exist?('/root/custom_certificates/certs/test.key')
=> false
irb(main):009:0> configs = ['/root/custom_certificates/certs/test.key']
=> ["/root/custom_certificates/certs/test.key"]
irb(main):010:0> configs.compact.select { |path| Dir.glob(path).any? }
=> []

Comment 8 Eric Helms 2024-06-06 16:09:14 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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