With the introduction of #19543, where available repository sets (previously called product content in UI) may be listed for enable/disable through additional options, I want these options available in hammer.
Created from redmine issue http://projects.theforeman.org/issues/19636
Upstream bug assigned to paji
Verification failed against Sat 6.3 Snap 9 => satellite-6.3.0-16.0.beta.el7sat.noarch I was able to CR & U, but no D. I lost the stack trace - but the issue was related to Foreman::Cast.
Hmm having trouble reproducing this issue. Did you run something like this ? hammer -rd activation-key content-override --id=5 --content-label=rhel-7-server-kickstart --name=enabled --remove
Here is a good link for different cases. https://github.com/Katello/hammer-cli-katello/pull/489#issuecomment-289978454
Partha, I think the command was one of: hammer -v activation-key content-override --content-label=jb-eap-7.0-for-rhel-7-server-rpms --value 0 --id=1 --organization-id=1 hammer -v activation-key content-override --content-label=jb-eap-7.0-for-rhel-7-server-rpms --value false --id=1 --organization-id=1 hammer -v activation-key content-override --content-label=jb-eap-7.0-for-rhel-7-server-rpms --value true --id=1 --organization-id=1 I also found this in my hammer logs: [ERROR 2017-08-02T19:49:32 API] 500 Internal Server Error [ERROR 2017-08-02T19:49:32 Exception] uninitialized constant Katello::Foreman::Cast Sorry - no error from the Rails log. I can try and reproduce later if you still can't.
Hmm cant reproduce this. Going to push it to on_qa . Fail it if you hit this again root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key product-content --id=1 -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|--------- 3822 | Red Hat Enterprise Linux Atomic Host (Trees) | | | | rhel-atomic-host-ostree | no | 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | 2396 | Red Hat Enterprise Linux 6 Server - RH Common (RPMs) | | | | rhel-6-server-rh-common-rpms | no | -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|--------- [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --value 0 Updated content override [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key product-content --id=1 -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- 3822 | Red Hat Enterprise Linux Atomic Host (Trees) | | | | rhel-atomic-host-ostree | no | 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | enabled:0 2396 | Red Hat Enterprise Linux 6 Server - RH Common (RPMs) | | | | rhel-6-server-rh-common-rpms | no | -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --value false Updated content override [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key product-content --id=1 -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- 3822 | Red Hat Enterprise Linux Atomic Host (Trees) | | | | rhel-atomic-host-ostree | no | 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | enabled:0 2396 | Red Hat Enterprise Linux 6 Server - RH Common (RPMs) | | | | rhel-6-server-rh-common-rpms | no | -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --value true Updated content override [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key product-content --id=1 -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|---------- 3822 | Red Hat Enterprise Linux Atomic Host (Trees) | | | | rhel-atomic-host-ostree | no | 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | enabled:1 2396 | Red Hat Enterprise Linux 6 Server - RH Common (RPMs) | | | | rhel-6-server-rh-common-rpms | no | -----|------------------------------------------------------|------|-----|---------|------------------------------|----------|----------
I managed to hit this error with this change """ [root@sat63qedev ~]# hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --remove [ERROR 2017-08-11 22:24:09 API] 500 Internal Server Error [ERROR 2017-08-11 22:24:09 Exception] uninitialized constant Katello::Foreman::Cast Could not update content override: uninitialized constant Katello::Foreman::Cast [ERROR 2017-08-11 22:24:09 Exception] RestClient::InternalServerError (500 Internal Server Error): /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:352:in `block in rest_client_call_block' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit' /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in `start' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:76:in `put' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:324:in `call_client' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:240:in `http_call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:190:in `call_action' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:185:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:21:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.2/lib/hammer_cli/apipie/command.rb:43:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.10.2/lib/hammer_cli_foreman/commands.rb:166:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.2/lib/hammer_cli/apipie/command.rb:34: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.10.2/lib/hammer_cli/abstract.rb:29: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.10.2/lib/hammer_cli/abstract.rb:29: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.10.2/lib/hammer_cli/abstract.rb:29: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.10.2/bin/hammer:147:in `<top (required)>' /bin/hammer:23:in `load' /bin/hammer:23:in `<main>' """ Stack trace """ 2017-08-11 22:24:09 d55ce8d8 [app] [E] NameError: uninitialized constant Katello::Foreman::Cast | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.14/lib/foreman_hooks/as_dependencies_hook.rb:4:in `load_missing_constant' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/concerns/api/v2/content_overrides_controller.rb:10:in `validate_content_overrides_enabled' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/activation_keys_controller.rb:231:in `block in content_override' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/activation_keys_controller.rb:230:in `map' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.4/app/controllers/katello/api/v2/activation_keys_controller.rb:230:in `content_override' | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action' | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:198:in `process_action' | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/rendering.rb:10:in `process_action' | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action' """ This has been resolved by https://github.com/Katello/katello/commit/4315142b3941c4ca1d5678012e74f7980073c77e upstream which needs to get in downstream.
Verified against Sat 6.3 Snap 14 => satellite-6.3.0-17.0.beta.el7sat.noarch hammer -u admin -p changeme -v activation-key product-content --id=1 --organization-id=1 -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|--------- 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | 2472 | Red Hat Enterprise Linux 7 Server - RH Common (RPMs) | | | | rhel-7-server-rh-common-rpms | no | 4474 | JBoss Enterprise Application Platform 7 (RHEL 7 Server) (RPMs) | | | | jb-eap-7-for-rhel-7-server-rpms | no | -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|--------- Adding content override: hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --value 1 Updated content override [vagrant@sat63-qa-rhel7 foreman]$ hammer -u admin -p changeme -v activation-key product-content --id=1 --organization-id=1 -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|---------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|---------- 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | enabled:1 2472 | Red Hat Enterprise Linux 7 Server - RH Common (RPMs) | | | | rhel-7-server-rh-common-rpms | no | 4474 | JBoss Enterprise Application Platform 7 (RHEL 7 Server) (RPMs) | | | | jb-eap-7-for-rhel-7-server-rpms | no | -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|---------- Updating: hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --value 0 Updated content override Removing the override: hammer -u admin -p changeme -v activation-key content-override --id=1 --content-label=rhel-7-server-rpms --remove Updated content override Final state: hammer -u admin -p changeme -v activation-key product-content --id=1 --organization-id=1 -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|--------- ID | NAME | TYPE | URL | GPG KEY | LABEL | ENABLED? | OVERRIDE -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|--------- 2456 | Red Hat Enterprise Linux 7 Server (RPMs) | | | | rhel-7-server-rpms | yes | 2472 | Red Hat Enterprise Linux 7 Server - RH Common (RPMs) | | | | rhel-7-server-rh-common-rpms | no | 4474 | JBoss Enterprise Application Platform 7 (RHEL 7 Server) (RPMs) | | | | jb-eap-7-for-rhel-7-server-rpms | no | -----|----------------------------------------------------------------|------|-----|---------|---------------------------------|----------|---------
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:0336