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 1447403 - hammer API cache not auto reloaded after an API call with an error response
Summary: hammer API cache not auto reloaded after an API call with an error response
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.9
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: 6.4.0
Assignee: Tomas Strachota
QA Contact: Jan Hutař
URL:
Whiteboard:
: 1447682 (view as bug list)
Depends On: 1611004
Blocks: 1122832 Sat6_Upgrades
TreeView+ depends on / blocked
 
Reported: 2017-05-02 15:57 UTC by Peter Vreman
Modified: 2019-11-05 23:05 UTC (History)
9 users (show)

Fixed In Version: apipie-bindings 0.3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:22:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github /Apipie apipie-bindings issues 66 0 None None None 2017-06-06 10:25:55 UTC
Github /Apipie apipie-bindings pull 67 0 None None None 2017-11-07 07:07:35 UTC

Description Peter Vreman 2017-05-02 15:57:04 UTC
Description of problem:
The api cache of hammer is not reloaded after upgrading 6.2.8 to 6.2.9. The new features (--validate-contents) is therefor not available:

[crash/LI] root@li-lc-1578:~# date
Tue May  2 15:54:55 UTC 2017

[crash/LI] root@li-lc-1578:~# rpm -q satellite
satellite-6.2.9-7.0.el7sat.noarch

[crash/LI] root@li-lc-1578:~# ls -l ~/.cache/apipie_bindings/https___localhost_/v2
total 868
-rw-r--r--. 1 root root 885462 Apr 19 07:56 b5f1cb2585459688a9c5de5cfaa8f420.en.json

[crash/LI] root@li-lc-1578:~# hammer -d repository synchronize --help
[ INFO 2017-05-02 15:53:34 Init] Initialization of Hammer CLI (0.5.1.13) has started...
[DEBUG 2017-05-02 15:53:34 Init] Running at ruby 2.2.2-p95
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2017-05-02 15:53:34 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2017-05-02 15:53:34 Connection] Registered: foreman
[DEBUG 2017-05-02 15:53:34 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2017-05-02 15:53:34 API] Follow redirects: never
[ INFO 2017-05-02 15:53:34 Modules] Extension module hammer_cli_foreman (0.5.1.10) loaded
[ INFO 2017-05-02 15:53:34 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2017-05-02 15:53:34 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2017-05-02 15:53:34 Modules] Extension module hammer_cli_foreman_discovery (0.0.2.3) loaded
[ INFO 2017-05-02 15:53:34 Modules] Extension module hammer_cli_import (0.11.2) loaded
[ INFO 2017-05-02 15:53:34 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2017-05-02 15:53:34 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2017-05-02 15:53:35 Modules] Extension module hammer_cli_katello (0.0.22.29) loaded
[DEBUG 2017-05-02 15:53:35 Init] Using locale 'en'
[DEBUG 2017-05-02 15:53:35 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/locale'
[DEBUG 2017-05-02 15:53:35 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.10/locale'
[DEBUG 2017-05-02 15:53:35 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.2.1.1/locale'
[DEBUG 2017-05-02 15:53:35 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'
[DEBUG 2017-05-02 15:53:35 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.29/locale'
[ INFO 2017-05-02 15:53:35 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2017-05-02 15:53:35 HammerCLIKatello::Repository] Called with options: {}
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


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


How reproducible:


Steps to Reproduce:
1. Upgrade 6.2.8 to 6.2.9
2. Check help of repository synchronize
3.

Actual results:
New feature --validate-contents is not listsed

Expected results:
New feature --validate-contents is available

Additional info:

Comment 1 Marek Hulan 2017-05-03 09:37:38 UTC
Thanks for the report. Did you run satellite-installer as part of upgrading the satellite rpm? It should happen as part of package update too. To enforce rendering the new version of cache, you can run the following command

> foreman-rake apipie:cache

It might be also caused by hammer using old cache, to refresh it, run the hammer with -r, e.g.

> hammer -r repository synchronize --help

I hope this helps.

Comment 2 Peter Vreman 2017-05-03 11:05:44 UTC
Marek

Using the 'hammer -r' to rebuild the cache works.

As i user i expect that caches are expired&refreshed during a (mior)release upgrade without human interaction

Comment 3 Marek Hulan 2017-05-03 11:50:41 UTC
Sure, I agree. Every change in apipie cache should generate new checksum which is sent to hammer in form of HTTP header. Hammer should detect it and refresh the cache when the checksum differs. For some reason that didn't happen and seems to be valid hammer bug.

Comment 4 Marek Hulan 2017-05-03 12:10:06 UTC
Did you try to run also other hammer commands without --help? When hammer is invoked with --help it does not talk to the server and hence does not get any new checksum. Running 

> hammer user list

for example might have refresh the cache. If you still have some reproducing environment (another box where you have hammer installed), could you please check whether that would work in your case?

Comment 5 Peter Vreman 2017-05-03 12:14:17 UTC
Marek

Below is the command and output i tried directly after the upgrade to 6.2.9:

[crash/LI] root@li-lc-1578:/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124# sudo hammer repository synchronize --validate-contents=true --id=31062
Could not synchronize the repository:
  Error: Unrecognised option '--validate-contents'

  See: 'hammer repository synchronize --help'

Comment 6 Andrew Kofink 2017-05-05 16:19:08 UTC
*** Bug 1447682 has been marked as a duplicate of this bug. ***

Comment 7 Tomas Strachota 2017-05-10 08:47:51 UTC
When the apidoc is changed, hammer recognizes it with the first request that is sent to the server. When it finds the checksum is different, it fetches a new version of the apidoc. This happens after options are parsed so it's possible that first command after an upgrade fails. The next one should work correctly.

Note that --help doesn't perform any API request and therefore it has no power to refresh the cache.

Peter, can you please confirm whether this is the case and the cache is renewed when you trigger the command twice?

Since hammer can be installed on any remote machine, not just the satellite server, there's no generic way of refreshing the cache without human interaction, other than checking the checksum aggressively before each option parsing. I'm afraid this would have negative impact on performance.

Comment 8 Peter Vreman 2017-05-10 14:49:12 UTC
It does not work. See below. I installed an old apipie binding cache file from 6.2.7.
The i run the --help to verfiy the new 6.2.9options are not avialable.
The i force an API call by running repo sync with a fake id
Then i verified the --help and it was not updated.


[crash/LI] hoici@li-lc-1578:~$ shasum .cache/apipie_bindings/https___localhost_/v2/da09298af6c8ad86ce01b88d7197d245.en.json
a62243736fef77b52692236433c61c3dbcfdae05  .cache/apipie_bindings/https___localhost_/v2/da09298af6c8ad86ce01b88d7197d245.en.json

[crash/LI] hoici@li-lc-1578:~$ hammer -d -c /opt/hoici/etc/sat6/hammer-hoici.yaml repository synchronize --help
[ INFO 2017-05-10 14:44:00 Init] Initialization of Hammer CLI (0.5.1.13) has started...
[DEBUG 2017-05-10 14:44:00 Init] Running at ruby 2.2.2-p95
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2017-05-10 14:44:00 Init] Configuration from the file /opt/hoici/etc/sat6/hammer-hoici.yaml has been loaded
[DEBUG 2017-05-10 14:44:01 Connection] Registered: foreman
[DEBUG 2017-05-10 14:44:01 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2017-05-10 14:44:01 API] Follow redirects: never
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_foreman (0.5.1.10) loaded
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_foreman_discovery (0.0.2.3) loaded
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_import (0.11.2) loaded
[ INFO 2017-05-10 14:44:01 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2017-05-10 14:44:01 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2017-05-10 14:44:01 Modules] Extension module hammer_cli_katello (0.0.22.29) loaded
[DEBUG 2017-05-10 14:44:01 Init] Using locale 'en'
[DEBUG 2017-05-10 14:44:01 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/locale'
[DEBUG 2017-05-10 14:44:01 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.10/locale'
[DEBUG 2017-05-10 14:44:01 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.2.1.1/locale'
[DEBUG 2017-05-10 14:44:01 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'
[DEBUG 2017-05-10 14:44:01 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.29/locale'
[ INFO 2017-05-10 14:44:01 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_config"=>"/opt/hoici/etc/sat6/hammer-hoici.yaml"}
[ INFO 2017-05-10 14:44:01 HammerCLIKatello::Repository] Called with options: {}
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

[crash/LI] hoici@li-lc-1578:~$ hammer -d -c /opt/hoici/etc/sat6/hammer-hoici.yaml repository synchronize --id=4444444444
[ INFO 2017-05-10 14:44:20 Init] Initialization of Hammer CLI (0.5.1.13) has started...
[DEBUG 2017-05-10 14:44:20 Init] Running at ruby 2.2.2-p95
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2017-05-10 14:44:20 Init] Configuration from the file /opt/hoici/etc/sat6/hammer-hoici.yaml has been loaded
[DEBUG 2017-05-10 14:44:20 Connection] Registered: foreman
[DEBUG 2017-05-10 14:44:20 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2017-05-10 14:44:20 API] Follow redirects: never
[ INFO 2017-05-10 14:44:20 Modules] Extension module hammer_cli_foreman (0.5.1.10) loaded
[ INFO 2017-05-10 14:44:20 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2017-05-10 14:44:20 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2017-05-10 14:44:20 Modules] Extension module hammer_cli_foreman_discovery (0.0.2.3) loaded
[ INFO 2017-05-10 14:44:20 Modules] Extension module hammer_cli_import (0.11.2) loaded
[ INFO 2017-05-10 14:44:21 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2017-05-10 14:44:21 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2017-05-10 14:44:21 Modules] Extension module hammer_cli_katello (0.0.22.29) loaded
[DEBUG 2017-05-10 14:44:21 Init] Using locale 'en'
[DEBUG 2017-05-10 14:44:21 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/locale'
[DEBUG 2017-05-10 14:44:21 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.10/locale'
[DEBUG 2017-05-10 14:44:21 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.2.1.1/locale'
[DEBUG 2017-05-10 14:44:21 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'
[DEBUG 2017-05-10 14:44:21 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.29/locale'
[ INFO 2017-05-10 14:44:21 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_config"=>"/opt/hoici/etc/sat6/hammer-hoici.yaml"}
[ INFO 2017-05-10 14:44:21 HammerCLIKatello::Repository] Called with options: {}
[ INFO 2017-05-10 14:44:21 HammerCLIKatello::Repository::SyncCommand] Called with options: {"option_id"=>"4444444444"}
[ INFO 2017-05-10 14:44:21 API] Server: https://localhost/
[ INFO 2017-05-10 14:44:21 API] POST /katello/api/repositories/4444444444/sync
[DEBUG 2017-05-10 14:44:21 API] Params: {}
[DEBUG 2017-05-10 14:44:21 API] Headers: {}
[DEBUG 2017-05-10 14:44:21 API] 500 Internal Server Error
{
    "displayMessage" => "ERROR:  value \"4444444444\" is out of range for type integer\n",
            "errors" => [
        [0] "ERROR:  value \"4444444444\" is out of range for type integer\n"
    ]
}
[ERROR 2017-05-10 14:44:21 Exception] ERROR:  value "4444444444" is out of range for type integer

Could not synchronize the repository:
  ERROR:  value "4444444444" is out of range for type integer
[ERROR 2017-05-10 14:44:21 Exception]

RestClient::InternalServerError (500 Internal Server Error):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:308:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
    /opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:295:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:224:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:174:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:169:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.16/lib/apipie_bindings/resource.rb:14:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.10/lib/hammer_cli_foreman/commands.rb:190:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_tasks-0.0.10.3/lib/hammer_cli_foreman_tasks/async_command.rb:14:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/abstract.rb:24:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/abstract.rb:24:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/lib/hammer_cli/abstract.rb:24:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/bin/hammer:125:in `<top (required)>'
    /bin/hammer:23:in `load'
    /bin/hammer:23:in `<main>'


[crash/LI] hoici@li-lc-1578:~$ hammer -d -c /opt/hoici/etc/sat6/hammer-hoici.yaml repository synchronize --help
[ INFO 2017-05-10 14:44:29 Init] Initialization of Hammer CLI (0.5.1.13) has started...
[DEBUG 2017-05-10 14:44:29 Init] Running at ruby 2.2.2-p95
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/csv.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_core.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_admin_logging_katello.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_remote_execution.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[ INFO 2017-05-10 14:44:29 Init] Configuration from the file /opt/hoici/etc/sat6/hammer-hoici.yaml has been loaded
[DEBUG 2017-05-10 14:44:29 Connection] Registered: foreman
[DEBUG 2017-05-10 14:44:29 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[DEBUG 2017-05-10 14:44:29 API] Follow redirects: never
[ INFO 2017-05-10 14:44:29 Modules] Extension module hammer_cli_foreman (0.5.1.10) loaded
[ INFO 2017-05-10 14:44:29 Modules] Extension module hammer_cli_foreman_admin (0.0.5) loaded
[ INFO 2017-05-10 14:44:29 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3.3) loaded
[ INFO 2017-05-10 14:44:29 Modules] Extension module hammer_cli_foreman_discovery (0.0.2.3) loaded
[ INFO 2017-05-10 14:44:29 Modules] Extension module hammer_cli_import (0.11.2) loaded
[ INFO 2017-05-10 14:44:29 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2017-05-10 14:44:29 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2017-05-10 14:44:30 Modules] Extension module hammer_cli_katello (0.0.22.29) loaded
[DEBUG 2017-05-10 14:44:30 Init] Using locale 'en'
[DEBUG 2017-05-10 14:44:30 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.13/locale'
[DEBUG 2017-05-10 14:44:30 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.10/locale'
[DEBUG 2017-05-10 14:44:30 Init] 'mo' files for locale domain 'hammer-cli-csv' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_csv-2.2.1.1/locale'
[DEBUG 2017-05-10 14:44:30 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.6/locale'
[DEBUG 2017-05-10 14:44:30 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.29/locale'
[ INFO 2017-05-10 14:44:30 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_config"=>"/opt/hoici/etc/sat6/hammer-hoici.yaml"}
[ INFO 2017-05-10 14:44:30 HammerCLIKatello::Repository] Called with options: {}
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
[crash/LI] hoici@li-lc-1578:~$

Comment 10 Tomas Strachota 2017-06-06 10:09:44 UTC
I'm sorry for my late answer. I managed to reproduce the issue. The cache isn't refreshed when the api call fails. The problem is on apipie binding's side where the cache refresh is skipped when the http call raises an exception.

The path that works is:
1) api doc on the server is changed
2) hammer performs an api call with successful result
3) hammer notices the cache checksum is different and reloads it
4) next hammer run will have correct cache

Comment 12 Tomas Strachota 2017-06-07 07:07:55 UTC
Switching to assigned as there's https://github.com/Apipie/apipie-bindings/pull/67 ready for review.

Comment 13 Marek Hulan 2017-11-07 07:06:45 UTC
Tomas, the linked PR was merged, what are the next steps? Should we just bump apipie-bindings dependency to fix this BZ?

Comment 14 Tomas Strachota 2017-11-07 09:26:06 UTC
Since it's a minor issue I don't think it's worth cherry-picking. I set fixed in version to apipie-bindings 0.3.0 which hasn't been released yet. Once it's out we should bump it in our repos.

Comment 19 Bryan Kearney 2018-10-16 19:22:27 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, 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-2018:2927


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