Bug 1634760

Summary: "undefined method `href' for nil:NilClass" when provisioning host without --interface
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: Compute Resources - RHEVAssignee: Shira Maximov <mshira>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: apatel, dhlavacd, inecas, kgaikwad, mbacovsk, mhulan, mshira, orabin, pcreech, rabajaj
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:23:24 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: 1679593    
Attachments:
Description Flags
production.log none

Description Lukáš Hellebrandt 2018-10-01 14:48:18 UTC
Created attachment 1489063 [details]
production.log

Description of problem:
Running 'hammer host create ...' without --interface specification leads to error in $SUBJ

I tried it with Sat 6.3 and didn't reproduce it (got a nice message "Could not create the host: Could not find virtual machine network interface matching 192.168.1.116") => seems like regression

Version-Release number of selected component (if applicable):
Reproduced on Sat 6.4 snap 24

How reproducible:
Deterministic

Steps to Reproduce:
1. Run 'hammer host create' command without specifying --interface parameter

Actual results:
[DEBUG 2018-10-01T16:19:57 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_unprocessable_entity
[ERROR 2018-10-01T16:19:57 Exception] Failed to create a compute rhev4 (RHV) instance fish.example.com: Ovirt client returned an error: undefined method `href' for nil:NilClass
 
Could not create the host:
  Failed to create a compute rhev4 (RHV) instance fish.example.com: Ovirt client returned an error: undefined method `href' for nil:NilClass


Expected results:
Host created successfully

Additional info:
Traceback attached

Comment 2 Lukáš Hellebrandt 2018-10-01 14:53:53 UTC
This only happens with APIv4.

Comment 3 Marek Hulan 2018-10-01 16:44:32 UTC
This is not hammer related, when tou see 500 in production.log, it's server side bug. When you specify it correctly, does it work as expected?

Comment 5 Lukáš Hellebrandt 2018-10-02 09:47:00 UTC
I wasn't able to reproduce this in WebUI.

In Hammer, it works with correct specification.

Comment 6 Marek Hulan 2018-10-02 15:46:04 UTC
Hammer is CLI tool that uses API provided by the server. The very same server that runs WebUI. Hammer component is only used for things on the CLI tool itself, when you see a bug on server side, please choose more specific component. In fact, try to avoid WebUI/API/Hammer components as much as possible. If it's not clear, I'm happy to explain in more details.

Comment 7 Lukáš Hellebrandt 2018-10-03 09:10:41 UTC
I think this is NOT a 6.4 blocker as APIv4 seems to work in other cases and the feature is marked as experimental.

Comment 8 orabin 2018-10-23 06:04:35 UTC
Created redmine issue https://projects.theforeman.org/issues/25276 from this bug

Comment 9 Satellite Program 2018-10-23 08:01:19 UTC
Upstream bug assigned to orabin

Comment 10 Satellite Program 2018-10-23 08:01:25 UTC
Upstream bug assigned to orabin

Comment 11 Bryan Kearney 2019-08-14 12:00:50 UTC
Upstream bug assigned to mshira

Comment 12 Bryan Kearney 2019-08-14 12:00:52 UTC
Upstream bug assigned to mshira

Comment 13 Bryan Kearney 2019-10-21 14:00:56 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25276 has been resolved.

Comment 14 Lukáš Hellebrandt 2020-02-13 14:03:34 UTC
Verified with Sat 6.7 snap 11 as per OP and comment 2.
When no interface specified by --interface, the command passes, using the interface from image. With PXE boot, default settings is used. This behavior is different to APIv3 which in both cases says "Could not create the host: Could not find virtual machine network interface matching <FQDN>" - reporting a followup BZ about this inconsistency.

Comment 17 errata-xmlrpc 2020-04-14 13:23:24 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-2020:1454