Red Hat Bugzilla – Bug 1096333
Internal server error when trying to delete a template using hammer template delete command
Last modified: 2017-02-23 16:17:33 EST
Created attachment 894106 [details] foreman-debug tarball Description of problem: When trying to delete a template hammer template delete command show a internal server error and the template is not deleted. Version-Release number of selected component (if applicable): # hammer --version hammer (0.1.0) * hammer_cli_foreman (0.1.0) * hammer_cli_katello (0.0.3) How reproducible: Aways Steps to Reproduce: 1. LANG=en_US hammer -v -u admin -p password template delete --id=<template_id> Actual results: The command gives an internal server error and does not delete the template Expected results: The command runs without any error and deletes the template Additional info: Console session related to the problem: # LANG=en_US hammer -v -u admin -p password --output csv template create --type='PXEGrub' --name='KFFakFlqHs' --file='/tmp/apa0epb3' Message,Id,Name Config template created,45,KFFakFlqHs # LANG=en_US hammer -v -u admin -p password template info --id='45' Id: 45 Name: KFFakFlqHs Type: PXEGrub OS ids: # LANG=en_US hammer -v -u admin -p password template delete --id='45' [ERROR 2014-05-08 20:09:44 API] 500 Internal Server Error { "error" => { "message" => "resource have no errors" } } [ERROR 2014-05-08 20:09:44 Exception] resource have no errors Could not delete the config template: resource have no errors [ERROR 2014-05-08 20:09:44 Exception] RestClient::InternalServerError (500 Internal Server Error): /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit' /usr/lib/ruby/1.8/net/http.rb:543:in `start' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:97:in `delete' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `send' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:151:in `call' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/command.rb:42:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:108:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/command.rb:33:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/bin/hammer:100 /usr/bin/hammer:19:in `load' /usr/bin/hammer:19 # LANG=en_US hammer -v -u admin -p password template info --id='45' Id: 45 Name: KFFakFlqHs Type: PXEGrub OS ids:
Should be resolved with the update of ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el6sat.
Verified with sat6 beta snap6 * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.7-1.el6_5.noarch * candlepin-scl-1-5.el6_4.noarch * candlepin-scl-quartz-2.1.5-5.el6_4.noarch * candlepin-scl-rhino-1.7R3-1.el6_4.noarch * candlepin-scl-runtime-1-5.el6_4.noarch * candlepin-selinux-0.9.7-1.el6_5.noarch * candlepin-tomcat6-0.9.7-1.el6_5.noarch * elasticsearch-0.90.10-4.el6sat.noarch * foreman-1.6.0.13-1.el6sat.noarch * foreman-compute-1.6.0.13-1.el6sat.noarch * foreman-gce-1.6.0.13-1.el6sat.noarch * foreman-libvirt-1.6.0.13-1.el6sat.noarch * foreman-ovirt-1.6.0.13-1.el6sat.noarch * foreman-postgresql-1.6.0.13-1.el6sat.noarch * foreman-proxy-1.6.0.6-1.el6sat.noarch * foreman-selinux-1.6.0-2.el6sat.noarch * foreman-vmware-1.6.0.13-1.el6sat.noarch * katello-1.5.0-24.el6sat.noarch * katello-ca-1.0-1.noarch * katello-certs-tools-1.5.5-1.el6sat.noarch * katello-installer-0.0.44-1.el6sat.noarch * openldap-2.4.23-32.el6_4.1.x86_64 * pulp-katello-plugins-0.3-1.el6sat.noarch * pulp-nodes-common-2.4.0-0.18.beta.el6sat.noarch * pulp-nodes-parent-2.4.0-0.18.beta.el6sat.noarch * pulp-puppet-plugins-2.4.0-0.18.beta.el6sat.noarch * pulp-puppet-tools-2.4.0-0.18.beta.el6sat.noarch * pulp-rpm-plugins-2.4.0-0.18.beta.el6sat.noarch * pulp-selinux-2.4.0-0.18.beta.el6sat.noarch * pulp-server-2.4.0-0.18.beta.el6sat.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch * ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch * rubygem-hammer_cli-0.1.0-13.el6sat.noarch * rubygem-hammer_cli_foreman-0.1.0-15.el6sat.noarch * rubygem-hammer_cli_foreman_tasks-0.0.2-6.el6sat.noarch * rubygem-hammer_cli_katello-0.0.3-26.el6sat.noarch # hammer template create --type='PXEGrub' --name='test_temp' --file=/root/test Config template created [root@dhcp207-xx ~]# hammer template info --id='41' Id: 41 Name: test_temp Type: PXEGrub Operating systems: [root@dhcp207-xx ~]# hammer template delete --id='41' Config template deleted [root@dhcp207-xx ~]# hammer template info --id='41' Resource config_template not found by id '41'
This was delivered with 6.0.3, which is the Satellite 6 Beta.
# hammer -v -d -u admin -p changeme template delete --id='62' [ INFO 2014-09-05 09:17:39 Init] Initialization of Hammer CLI (0.1.1) has started... [DEBUG 2014-09-05 09:17:39 Init] Running at ruby 2.0.0-p353 [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [DEBUG 2014-09-05 09:17:39 Connection] Registered: foreman [DEBUG 2014-09-05 09:17:39 API] Global headers: { :content_type => "application/json", :accept => "application/json;version=2", "Accept-Language" => "en" } [ INFO 2014-09-05 09:17:39 Modules] Extension module hammer_cli_foreman (0.1.1) loaded [ INFO 2014-09-05 09:17:39 Modules] Extension module hammer_cli_import (0.10.4) loaded [ INFO 2014-09-05 09:17:39 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2014-09-05 09:17:39 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [ INFO 2014-09-05 09:17:40 Modules] Extension module hammer_cli_katello (0.0.4) loaded [DEBUG 2014-09-05 09:17:40 Init] Using locale 'en' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.1/locale' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.1/locale' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.4/locale' [ INFO 2014-09-05 09:17:40 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"} [ INFO 2014-09-05 09:17:40 HammerCLIForeman::Template] Called with options: {} [ INFO 2014-09-05 09:17:40 HammerCLIForeman::Template::DeleteCommand] Called with options: {"option_id"=>"62"} [ INFO 2014-09-05 09:17:40 API] DELETE /api/config_templates/62 [DEBUG 2014-09-05 09:17:40 API] Params: {} [DEBUG 2014-09-05 09:17:40 API] Headers: { :params => {} } [ERROR 2014-09-05 09:17:40 API] 500 Internal Server Error { "error" => { "message" => "resource have no errors" } } [ERROR 2014-09-05 09:17:40 Exception] resource have no errors Could not delete the config template: resource have no errors [ERROR 2014-09-05 09:17:40 Exception] RestClient::InternalServerError (500 Internal Server Error): /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' /usr/share/ruby/net/http.rb:852:in `start' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:94:in `delete' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:150:in `call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/apipie/command.rb:42:in `send_request' /usr/share/gems/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:164:in `send_request' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/apipie/command.rb:33:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/bin/hammer:102:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>'
# hammer -v -d -u admin -p **** template delete --id='62' [ INFO 2014-09-05 09:17:39 Init] Initialization of Hammer CLI (0.1.1) has started... [DEBUG 2014-09-05 09:17:39 Init] Running at ruby 2.0.0-p353 [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded [ INFO 2014-09-05 09:17:39 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [DEBUG 2014-09-05 09:17:39 Connection] Registered: foreman [DEBUG 2014-09-05 09:17:39 API] Global headers: { :content_type => "application/json", :accept => "application/json;version=2", "Accept-Language" => "en" } [ INFO 2014-09-05 09:17:39 Modules] Extension module hammer_cli_foreman (0.1.1) loaded [ INFO 2014-09-05 09:17:39 Modules] Extension module hammer_cli_import (0.10.4) loaded [ INFO 2014-09-05 09:17:39 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2014-09-05 09:17:39 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [ INFO 2014-09-05 09:17:40 Modules] Extension module hammer_cli_katello (0.0.4) loaded [DEBUG 2014-09-05 09:17:40 Init] Using locale 'en' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.1/locale' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.1/locale' [DEBUG 2014-09-05 09:17:40 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.4/locale' [ INFO 2014-09-05 09:17:40 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"} [ INFO 2014-09-05 09:17:40 HammerCLIForeman::Template] Called with options: {} [ INFO 2014-09-05 09:17:40 HammerCLIForeman::Template::DeleteCommand] Called with options: {"option_id"=>"62"} [ INFO 2014-09-05 09:17:40 API] DELETE /api/config_templates/62 [DEBUG 2014-09-05 09:17:40 API] Params: {} [DEBUG 2014-09-05 09:17:40 API] Headers: { :params => {} } [ERROR 2014-09-05 09:17:40 API] 500 Internal Server Error { "error" => { "message" => "resource have no errors" } } [ERROR 2014-09-05 09:17:40 Exception] resource have no errors Could not delete the config template: resource have no errors [ERROR 2014-09-05 09:17:40 Exception] RestClient::InternalServerError (500 Internal Server Error): /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' /usr/share/ruby/net/http.rb:852:in `start' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:94:in `delete' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:150:in `call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/apipie/command.rb:42:in `send_request' /usr/share/gems/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:164:in `send_request' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/apipie/command.rb:33:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/bin/hammer:102:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>'
Is this the same as bug #1138543, only on EL7? If so, let's use that, as we're already tracking it.
This failure is in Cli this bz #1138543 is filed for UI but basically we cannot delete template in cli also
That's irrelevant. Is the Sat6 server on EL7?
it sat6 server installed on rhel7 so EL7
*** Bug 1138543 has been marked as a duplicate of this bug. ***
For some reason the fix was apparently only applied to foreman_bootdisk on EL6, not EL7. Needs following commit, or a later version of bootdisk to match EL6 (2.0.6 or higher). https://github.com/theforeman/foreman_bootdisk/commit/74ccf55a49197e6fd5d292b5c010c9982c64a602
also noted that we are not facing this issues on rhel 6.5
Would it be possible to get bootdisk 3.x into the z-Stream? That is the right bootdisk version for Foreman 1.6 anyway, right? It would also address the issue that boot disk templates aren't seeded by default, and it would put them under the same locking mechanism instead of it's own. If not, we should try for 6.1 then.
Please do not carry out a major rebase of bootdisk to fix this bug. Such a request should be filed separately.
Verified in Satellite-6.0.4-RHEL-7-20140915.0 (assuring we are using a RHEL7 compose) [root@cloud-qe-15 ~]# hammer -u admin -p changeme template delete --id 23 Config template deleted
Moving back to ONQA to make sure this gets tested in next compose as well.
Changing strate to put into the errata.
Verified in Satellite-6.0.4-RHEL-7-20140916.0
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. http://rhn.redhat.com/errata/RHBA-2014-1279.html
> http://rhn.redhat.com/errata/RHBA-2014-1279.html Correct url: https://access.redhat.com/errata/RHBA-2014:1279