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 WONTFIX
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer
Version: 6.1.4
Hardware: All
OS: Linux
medium
medium vote
Target Milestone: Unspecified
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: 2019-08-12 14:53 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-01 18:35:39 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 15932 None None None 2016-08-01 14:00:15 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.


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