Project

General

Profile

Bug #25098

`hammer host create ...` returns ISE instead of an error message when LibVirt compute-resource is not in correct organization

Added by Marek Hulán about 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources - libvirt
Target version:
-
Difficulty:
Triaged:
Yes
Bugzilla link:

Description

The error is still reproducible:

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>'

Related issues

Copied from Foreman - Bug #24348: hammer host create returns ISE when LibVirt compute-resource is not in correct organizationClosed

Associated revisions

Revision 15b08c41 (diff)
Added by Sebastian Gräßl 9 months ago

Fixes #25098 - Validate compute resource taxonomy on NIC creation

In cases where the compute resource is not in the same taxonomy as
the host, creating NICs is raising an error when trying to get to
the compute resource, which is out of scope, to ask for attributes
provided by it.

Revision 67f0fec4 (diff)
Added by Sebastian Gräßl 9 months ago

Refs #25098 - Adjust tests to provide taxed compute resource

History

#1 Updated by Marek Hulán about 1 year ago

  • Copied from Bug #24348: hammer host create returns ISE when LibVirt compute-resource is not in correct organization added

#2 Updated by The Foreman Bot 9 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6402 added

#3 Updated by Marek Hulán 9 months ago

  • Fixed in Releases 1.22.0 added

#4 Updated by Sebastian Gräßl 9 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by The Foreman Bot 9 months ago

  • Pull request https://github.com/theforeman/foreman/pull/6431 added

Also available in: Atom PDF