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 .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2040706 - Leapp cannot upgrade with a custom https repo
Summary: Leapp cannot upgrade with a custom https repo
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: leapp-repository
Version: 7.9
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Leapp Notifications Bot
QA Contact: upgrades-and-conversions
URL:
Whiteboard:
: 1917469 (view as bug list)
Depends On:
Blocks: 1818088
TreeView+ depends on / blocked
 
Reported: 2022-01-14 15:21 UTC by Christophe Besson
Modified: 2024-03-25 18:18 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-03 11:39:14 UTC
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OAMG-6388 0 None None None 2022-01-14 15:32:20 UTC
Red Hat Issue Tracker   RHEL-11347 0 None Migrated None 2024-03-15 23:33:46 UTC
Red Hat Issue Tracker RHELPLAN-108196 0 None None None 2022-01-14 15:32:25 UTC
Red Hat Knowledge Base (Article) 6648051 0 None None None 2024-03-15 23:33:46 UTC

Description Christophe Besson 2022-01-14 15:21:58 UTC
Description of problem:
Customer uses custom repositories hosted behind an HTTPS server.
They use a dedicated certificate which is not copied into the target userspace, leading to an error while trying to retrieve the metadata.

Version-Release number of selected component (if applicable):
leapp-upgrade-el7toel8-0.15.0-6.el7_9

How reproducible:
Always

Steps to Reproduce:
1. Setup an HTTPS server hosting your repositories
2. Specify the certificate in sslcacert in the repo file

Actual results:
[MIRROR] libcgroup-0.41-19.el8.x86_64.rpm: Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://<HIDDEN_HOSTNAME>/pulp/content/ci-rhel8-baseos2/Packages/l/libcgroup-0.41-19.el8.x86_64.rpm [SSL certificate problem: unable to get local issuer certificate]

Additional info:
- Setting sslverify=0 is a workaround, but this is not what the customer wants.

- The issue was workarounded by bind-mounting the /etc/pki/ca-trust directory into the container (by modifying ALWAYS_BIND in mounting.py).

- I think something allowing to simply add files into the target userspace could help. With the below patch, a user can execute the following command to move forward:
# for f in $(find /etc/pki/ca-trust -type f); do echo $f:$f >> /etc/leapp/filesfortargetuserspace.conf; done

--- /usr/share/leapp-repository/repositories/system_upgrade/common/actors/scanfilesfortargetuserspace/libraries/scanfilesfortargetuserspace.py.orig	2022-01-14 15:55:58.698593070 +0100
+++ /usr/share/leapp-repository/repositories/system_upgrade/common/actors/scanfilesfortargetuserspace/libraries/scanfilesfortargetuserspace.py	2022-01-14 16:08:35.738180885 +0100
@@ -8,6 +8,8 @@
     '/etc/hosts': '/etc/hosts'
 }
 
+FILES_FOR_TARGET_USERSPACE_CFG = '/etc/leapp/filesfortargetuserspace.conf'
+
 
 def scan_files_to_copy():
     """
@@ -21,6 +23,17 @@
             dst_path = FILES_TO_COPY_IF_PRESENT[src_path]
             files_to_copy.append(CopyFile(src=src_path, dst=dst_path))
 
+    if os.path.exists(FILES_FOR_TARGET_USERSPACE_CFG):
+        try:
+            with open(FILES_FOR_TARGET_USERSPACE_CFG, "r") as f:
+                additional_files = f.readlines()
+            for line in additional_files:
+                src_path, dst_path = line.split(':')
+                files_to_copy.append(CopyFile(src=src_path, dst=dst_path))
+        except:
+            # silence any error (EACCES, EPERM, bad file format, ...)
+            pass
+
     preupgrade_task = TargetUserSpacePreupgradeTasks(copy_files=files_to_copy)
 
     api.produce(preupgrade_task)

Comment 10 Petr Stodulka 2023-07-26 07:56:32 UTC
*** Bug 1917469 has been marked as a duplicate of this bug. ***

Comment 11 Petr Stodulka 2023-08-22 15:13:14 UTC
This is fixed by upstream PR:
* https://github.com/oamg/leapp-repository/pull/1106

which is going to be part of the next release.

Comment 16 Petr Stodulka 2023-10-03 09:16:50 UTC
Dropping from the errata as the delivered fix is incomplete. Current solution protects files in the target userspace container installed by RPMs (which is wanted behaviour) however, the testing uncovered 2 flaws:
  a) the files installed via RPMs that have been originally symlinks, are switched to standard files
  b) lists of trusted CAs are not updated (missing update-ca-trust call inside the container)

Even when update-ca-trust is called, the problem is still present as the scripts updates files only under /etc/pki/ca-trust/extracted/ directory tree. As the original symlinks are switched to std files, the changes are not propagated e.g. for TLS (under /etc/pki/tls/certs) which leads to the original issue. At least in cases when SSL certs are not defined explicitely in a repofile (a repo definition), where pointing to a specific certificate file /etc/pki works now as expected. The set of machines that are able to upgrade should be now extended, however, regarding the discovered problems, we do not consider this fix to be complete. Moving back for the development. Regarding the time, the proper fix will not be delivered in the upcoming release, but in a future one instead.

Comment 17 RHEL Program Management 2023-10-03 10:59:01 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 18 RHEL Program Management 2023-10-03 11:39: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 "RHEL-" 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.