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 1447682 - Post upgrade 6.2.9 on rhel6 a few newly added cmd options only available after reloading of Apipie cache
Summary: Post upgrade 6.2.9 on rhel6 a few newly added cmd options only available afte...
Keywords:
Status: CLOSED DUPLICATE of bug 1447403
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.2.9
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: Sat6_Upgrades
TreeView+ depends on / blocked
 
Reported: 2017-05-03 13:21 UTC by Sachin Ghai
Modified: 2017-05-05 16:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-05 16:19:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sachin Ghai 2017-05-03 13:21:04 UTC
Description of problem:

In 6.2.9, a few options added to hammer repository synchronize sub-cmd:

--skip-metadata-check SKIP_METADATA_CHECK 
--validate-contents VALIDATE_CONTENTS  

These options are visible only after running "hammer -r". thanks Justin for pointing this.

However, I can see such options directly after upgrade to 6.2.9 on rhel7 as well as on fresh install of 6.2.9 on rhel6 (without running hammer -r)


Ideally, user should be able to see such options directly after upgrade.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Post upgrade 6.2.9 on rhel6 a few newly added cmd options only available after reloading of Apipie cache

Expected results:
user should be able to see newly added cmd options directly after upgrade, w/o running hammer -r explicitly.

Additional info:

Comment 1 Sachin Ghai 2017-05-03 13:23:55 UTC
on rhel6, sat6.2.9, before running hammer -r:
===============================================

Usage:
    hammer repository synchronize [OPTIONS]

Options:
 --async                                 Do not wait for the task
 --id ID                                 repository ID
 --incremental INCREMENTAL               perform an incremental import
                                         One of true/false, yes/no, 1/0.
 --name NAME                             Repository name to search by
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --product PRODUCT_NAME                  Product name to search by
 --product-id PRODUCT_ID                 product numeric identifier
 --source-url SOURCE_URL                 temporarily override feed URL for sync
 -h, --help                              print help



after running hammer -r:
========================

Usage:
    hammer repository synchronize [OPTIONS]

Options:
 --async                                   Do not wait for the task
 --id ID                                   repository ID
 --incremental INCREMENTAL                 perform an incremental import
                                           One of true/false, yes/no, 1/0.
 --name NAME                               Repository name to search by
 --organization ORGANIZATION_NAME          Organization name to search by
 --organization-id ORGANIZATION_ID         organization ID
 --organization-label ORGANIZATION_LABEL   Organization label to search by
 --product PRODUCT_NAME                    Product name to search by
 --product-id PRODUCT_ID                   product numeric identifier
 --skip-metadata-check SKIP_METADATA_CHECK Force sync even if no upstream changes are detected. Only used with yum
                                           repositories.
                                           One of true/false, yes/no, 1/0.
 --source-url SOURCE_URL                   temporarily override feed URL for sync
 --validate-contents VALIDATE_CONTENTS     Force a sync and validate the checksums of all content. Only used with yum
                                           repositories.
                                           One of true/false, yes/no, 1/0.
 -h, --help                                print help

Comment 3 Martin Bacovsky 2017-05-04 13:37:33 UTC
I was able to reproduce this scenario. However the behavior is expected and I didn't found any deviations from the expected behavior.

Hammer is using description of the API to generate options for its commands. The description is cached on the hammer client. The description has a checksum and the actual checksum is sent in server response headers for Hammer to compare. The problem is that Hammer knows the description changed just *after* the server call. 

So immediately after the upgrade Hammer needs to perform one server call to see the checksum changed and refresh it.

I'll explain how the cache expiration works here:

* hammer has the 6.2.8 cache stored in e.g. /.cache/apipie_bindings/https___localhost_/v2/91ac4f4181da276b56e543c3a19148b9.en.json. The cache contains description of all the API params.
* during the upgrade the API is updated and the Satellite's internal cache rebuilt with foreman-rake apipie:cache and a new checksum is generated 
* hammer repository synchronize --help uses the old cache and has no reason to contact the server
* after first actual call to the Satellite server hammer gets the new cache checksum and refresh the old cache
* following --help will use the updated cache to generate the options

There are two ways how to avoid using the outdated cache:

1/ in /etc/hammer/cli.modules.d/foreman.yml set foreamen: refresh_cache:true to let hammer perform cache check request to the server before each hammer invocation. The cache is refreshed when found outdated. This works also for --help. The price is extra call to Satellite and slower hammer loading

2/ hammer -r option to force cache refresh

Comment 5 Andrew Kofink 2017-05-05 16:19:08 UTC
This looks like a duplicate, reported just one day before.

*** This bug has been marked as a duplicate of bug 1447403 ***


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