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 1300211 - capsule-certs-generate failed to increment release number when generating certificate rpm for foreman-proxy
Summary: capsule-certs-generate failed to increment release number when generating cer...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Certificates
Version: 6.1.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-20 09:30 UTC by Nagoor Shaik
Modified: 2024-02-28 20:32 UTC (History)
11 users (show)

Fixed In Version: katello-certs-tools-2.7.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 12:57:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15932 0 Normal Closed capsule-certs-generate failed to increment release number when generating certificate rpm for foreman-proxy 2020-12-10 21:19:38 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:57:53 UTC

Description Nagoor Shaik 2016-01-20 09:30:59 UTC
Description of problem:
capsule-certs-generate failed to increment release number when generating certificate rpm for foreman-proxy

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

How reproducible:
100% 

Steps to Reproduce:
1. Execute capsule-certs-generate command for the fist time and extract the contents of the 
    # capsule-certs-generate --capsule-fqdn capsule.example.com --certs-tar /tmp/capsule.tar.gz
    # tar -xvzf /tmp/capsule.tar.gz
ssl-build/katello-default-ca-1.0-1.noarch.rpm
ssl-build/katello-server-ca-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-apache-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-apache-1.0-2.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-proxy-1.0-2.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-proxy-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-puppet-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-broker-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-client-cert-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-router-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-router-server-1.0-1.noarch.rpm

2. Re-run the capsule installer with the --certs-update-server option Which would only update the apache package, but not the foreman-proxy

    # capsule-certs-generate --capsule-fqdn capsule.example.com --certs-tar /tmp/capsule.tar.gz --certs-update-server
    # tar -xvzf capsule.tar.gz
ssl-build/katello-default-ca-1.0-1.noarch.rpm
ssl-build/katello-server-ca-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-apache-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-apache-1.0-3.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-proxy-1.0-2.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-foreman-proxy-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-puppet-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-broker-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-client-cert-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-router-client-1.0-1.noarch.rpm
ssl-build/capsule.example.com/capsule.example.com-qpid-router-server-1.0-1.noarch.rpm
  
  
Actual results:
foreman-proxy related RPMs gets updated correctly with the new CA, but fails to update the version that gets appended to the RPM causing the confusion.

Expected results:
RPMs should be appened with correct version

Additional info:
Problem seems to from the code of /bin/katello-ssl-tool
    #find RPMs in the directory as well.
    filenames = glob.glob("%s-*.noarch.rpm" % server_rpm)
    if filenames:
        filename = sortRPMs(filenames)[-1]
        h = get_package_header(filename)
        if hdr is None:
            hdr = h
        else:
            comp = hdrLabelCompare(h, hdr)
            if comp > 0:
                hdr = h

It grabs rpms like this "capsule.example.com-foreman-proxy-*.noarch.rpm" in that dir, sort it, and reckons the last one is the latest one.

But the satellite also has a rpm called "capsule.example.com-foreman-proxy-client-1.0-*.noarch.rpm" in the same directory!!

glob.glob("%s-*.noarch.rpm" % server_rpm) matches that perfectly as well. Since it always sits at the bottom of the sorted list:

(i.e.)
...
xxx-foreman-proxy-1.xxx
xxx-foreman-proxy-client-1.xxx

the release # the code fetched is always wrong.

As a result, the capsule.example.com-foreman-proxy rpm is generated with the right content, but wrong release number. 

Since we have a capsule.example.com-foreman-proxy-client-1.0-1.noarch.rpm in the same folder,  the generated capsule.example.com-foreman-proxy rpm will always be 1.0-2.

Comment 2 Neil Miao 2016-04-27 03:44:17 UTC
Any movement on this bug at all?

The issue still exist in v6.1.8 and v6.2 beta

katello-certs-tools-2.2.1-1.el7sat.noarch
katello-certs-tools-2.4.0-1.el7sat.noarch

/usr/lib/python2.7/site-packages/katello_certs_tools/katello_ssl_tool.py

 826     #find RPMs in the directory as well.
 827     filenames = glob.glob("%s-*.noarch.rpm" % server_rpm)
 828     if filenames:
 829         filename = sortRPMs(filenames)[-1]
 830         h = get_package_header(filename)
 831         if hdr is None:
 832             hdr = h
 833         else:
 834             comp = hdrLabelCompare(h, hdr)
 835             if comp > 0:
 836                 hdr = h

Comment 6 Stephen Benjamin 2016-08-01 14:00:13 UTC
Created redmine issue http://projects.theforeman.org/issues/15932 from this bug

Comment 9 Alexey Masolov 2017-02-03 06:19:03 UTC
The bug still exists in v.6.2.7/

Comment 10 hprakash 2017-05-31 06:05:12 UTC
results seems the same in v 6.2.9 as well

Comment 13 Ivan Necas 2017-08-01 10:54:25 UTC
The is difference between --certs-update-server and --certs-update-server-ca. 

The --certs-update-server updates only the SSL certificate of the server, while keeping the CA untouched. The --certs-update-server-ca is additional to update the CA of the server itself. The documentation mentions both commands.

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.2/html/installation_guide/installing_satellite_server#run_the_satellite_installer_with_custom_certificate_parameters

We could try to detect, if the ca cert provided by customer is different than that is already installed. The reason why we didn't go this way was preventing accidental update of the ca cert. On the other hand, there is probably low chance it would happen. We need to take a look at this in context of other bugs to see how it goes in terms of prioritization.

Comment 14 Mike McCune 2018-04-24 18:10:29 UTC
This bug can cause downstream effects that make debugging more difficult and add to the already complicated condition induced by Satellite's multiple certificates required for operations.

Comment 15 Bryan Kearney 2018-09-04 18:01:12 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 16 Chris Roberts 2019-04-03 08:43:41 UTC
This needs to be fixed, reopening. This causes a lot of issues with failed capsule SSL deployments.

Comment 17 Bryan Kearney 2019-05-02 19:07:00 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 18 Bryan Kearney 2019-06-03 12:05:53 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.

Comment 19 Bryan Kearney 2019-07-02 18:02:09 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 20 Bryan Kearney 2019-08-01 18:35:39 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.

Comment 21 Chris Roberts 2020-04-16 22:39:07 UTC
This needs to be fixed, reopening. This causes a lot of issues with failed capsule SSL deployments.

Comment 23 Ewoud Kohl van Wijngaarden 2020-05-19 18:50:45 UTC
Moving it to certificates since this is actually in katello-certs-tools. In https://github.com/Katello/katello-certs-tools/pull/26 I've tried to come up with a reproducer.

Comment 24 Bryan Kearney 2020-05-29 20:03:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/15932 has been resolved.

Comment 25 Devendra Singh 2020-09-09 14:22:46 UTC
Verfied on 6.8 Snap14

Verification points:

1- updated katello-certs-tools version is available.
# rpm -q katello-certs-tools
katello-certs-tools-2.7.1-1.el7sat.noarch

2- Run capsule-certs-generate command first time.
# capsule-certs-generate --foreman-proxy-fqdn XYZ.com --certs-tar /tmp/XYZ.com.tar.gz

# tar -xvzf /tmp/XYZ.com.tar.gz 
ssl-build/katello-default-ca-1.0-1.noarch.rpm
ssl-build/katello-server-ca-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-puppet-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-broker-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-client-cert-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-server-1.0-1.noarch.rpm

Run capsule-certs-generate command second time.
#capsule-certs-generate --foreman-proxy-fqdn XYZ.com --certs-tar /tmp/XYZ.com.tar.gz --certs-update-server

ssl-build/katello-default-ca-1.0-1.noarch.rpm
ssl-build/katello-server-ca-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-2.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-2.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-puppet-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-broker-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-client-cert-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-server-1.0-1.noarch.rpm

Run capsule-certs-generate command third time.
#capsule-certs-generate --foreman-proxy-fqdn XYZ.com --certs-tar /tmp/XYZ.com.tar.gz --certs-update-server

# tar -xvzf /tmp/XYZ.com.tar.gz 
ssl-build/katello-default-ca-1.0-1.noarch.rpm
ssl-build/katello-server-ca-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-2.noarch.rpm
ssl-build/XYZ.com/XYZ.com-apache-1.0-3.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-2.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-1.0-3.noarch.rpm
ssl-build/XYZ.com/XYZ.com-foreman-proxy-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-puppet-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-broker-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-client-cert-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-client-1.0-1.noarch.rpm
ssl-build/XYZ.com/XYZ.com-qpid-router-server-1.0-1.noarch.rpm

Each time the version of foreman-proxy and apache rpm gets incremented

Comment 28 errata-xmlrpc 2020-10-27 12:57:17 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 (Important: Satellite 6.8 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-2020:4366


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