Bug 1595126
Summary: | `hammer host create ...` returns ISE instead of an error message when LibVirt compute-resource is not in correct organization | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Jan Hutař <jhutar> | |
Component: | Compute Resources - libvirt | Assignee: | Sebastian Gräßl <sgraessl> | |
Status: | CLOSED WONTFIX | QA Contact: | Sanket Jagtap <sjagtap> | |
Severity: | medium | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.4 | CC: | egolov, mhulan, mmccune, oprazak, sgraessl, sjagtap | |
Target Milestone: | Unspecified | Keywords: | Regression, Triaged | |
Target Release: | Unused | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | foreman-1.18.0.24-1 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1666700 (view as bug list) | Environment: | ||
Last Closed: | 2020-05-01 13:31:25 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1666700 |
Description
Jan Hutař
2018-06-26 08:08:02 UTC
Ondrej, could you please take a quick look if this is that same as BZ 1595120 and the same fix helps? Or does this needs to be fixed in host form so that we don't display compute resources unavailable in org/loc combination selected for the host? Created redmine issue http://projects.theforeman.org/issues/24348 from this bug This is something different, cloning upstream. Build: Satellite 6.4.0 snap22 I am still able to re-produce the error. All the entities are in Default org and location, expect the Compute resource which is in ORG "abc" hammer> compute-resource info --id 4 Id: 4 Name: sjagtap_libvirt Provider: Libvirt Url: qemu+tcp://<libvirt>/system Description: User: Locations: Default Location Organizations: Default Organization Created at: 2018/09/20 12:26:38 Updated at: 2018/09/20 12:26:38 hammer> host create --name host1 --architecture-id=1 --compute-resource-id=4 --domain-id=1 --environment-id=1 --ip="148.172.224.43" --location-id="2" --mac="94:e3:d9:06:72:48" --medium-id="1" --operatingsystem-id=3 --organization-id="1" --partition-table-id=94 --puppet-proxy-id="1" --root-password=dog8code Host created. compute-resource update --id 4 --organizations abc Compute resource updated. hammer> compute-resource info --id 4 Id: 4 Name: sjagtap_libvirt Provider: Libvirt Url: qemu+tcp://<libvirt>/system Description: User: Locations: Default Location Organizations: abc Created at: 2018/09/20 12:26:38 Updated at: 2018/09/20 12:26:38 hammer -v host create --name host2 --architecture-id=1 --compute-resource-id=4 --domain-id=1 --environment-id=1 --ip="148.172.224.43" --location-id="2" --mac="94:e3:d9:06:72:48" --medium-id="1" --operatingsystem-id=3 --organization-id="1" --partition-table-id=94 --puppet-proxy-id="1" --root-password=dog8code [ERROR 2018-09-20T08:30:45 API] 500 Internal Server Error [ERROR 2018-09-20T08:30:45 Exception] Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs. Could not create the host: Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs. [ERROR 2018-09-20T08:30:45 Exception] RestClient::InternalServerError (500 Internal Server Error): /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit' /opt/rh/rh-ruby24/root/usr/share/ruby/net/http.rb:877:in `start' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:67:in `post' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/lib/hammer_cli/apipie/command.rb:51:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2/lib/hammer_cli_foreman/commands.rb:168:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/lib/hammer_cli/apipie/command.rb:34:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/lib/hammer_cli/abstract.rb:29:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1/bin/hammer:143:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>' Can it be that the actual issue is trying to create another host, but with the same MAC and IPv4 address? Looking at the logs it seems that there is an issue validating the NIC, which too should not error and show a validation instead, but it would be good to verify first that this is the cause. Mind trying to do the same, but change MAC as well as IP for the second host when trying to create in a different Org/Loc. Sorry for the delay, I tested this on 6.4.1. This time using a different Mac-address and IP , I was still able to reproduce the issue. In the logs I see this, 2018-12-14T01:24:53 [I|app|] Started POST "/api/hosts" for 10.16.64.253 at 2018-12-14 01:24:53 -0500 2018-12-14T01:24:53 [I|app|b6d5e] Processing by Api::V2::HostsController#create as JSON 2018-12-14T01:24:53 [I|app|b6d5e] Parameters: {"location_id"=>2, "organization_id"=>1, "host"=>{"name"=>"host1", "location_id"=>2, "organization_id"=>1, "environment_id"=>1, "ip"=>"148.172.224.44", "mac"=>"94:e3:d9:06:72:49", "architecture_id"=>1, "domain_id"=>1, "puppet_proxy_id"=>"1", "puppetclass_ids"=>[], "operatingsystem_id"=>3, "medium_id"=>1, "ptable_id"=>94, "compute_resource_id"=>4, "compute_attributes"=>{"volumes_attributes"=>{}}, "content_facet_attributes"=>{}, "subscription_facet_attributes"=>{}, "build"=>true, "managed"=>true, "enabled"=>true, "overwrite"=>true, "interfaces_attributes"=>[], "root_pass"=>"[FILTERED]"}, "apiv"=>"v2"} 2018-12-14T01:24:53 [I|app|b6d5e] Current user: foreman_admin (administrator) 2018-12-14T01:24:53 [I|app|b6d5e] Authorized user admin(Admin User) 2018-12-14T01:24:53 [I|app|b6d5e] Current user: admin (administrator) 2018-12-14T01:24:54 [W|app|b6d5e] Action failed NoMethodError: undefined method `provided_attributes' for nil:NilClass /usr/share/foreman/app/models/concerns/orchestration/compute.rb:30:in `compute_provides?' /usr/share/foreman/app/models/nic/base.rb:173:in `compute_provides_ip?' /usr/share/foreman/app/services/nic_ip_required/base.rb:58:in `compute_provides_ip?' /usr/share/foreman/app/services/nic_ip_required/base.rb:20:in `required?' /usr/share/foreman/app/models/nic/base.rb:157:in `require_ip4_validation?' /usr/share/foreman/app/models/nic/base.rb:35:in `block in <class:Base>' Satellite 6.4 is now End of Life. These bus will not be fixed on the 6.4 stream. Users of Satellite should upgrade to the latest version of Satellite to get access to the most current set of bugfixes and feature improvements. |