Bug 1634760 - "undefined method `href' for nil:NilClass" when provisioning host without --interface
Summary: "undefined method `href' for nil:NilClass" when provisioning host without --i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Compute Resources - RHEV
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: 6.7.0
Assignee: Shira Maximov
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: 1679593
TreeView+ depends on / blocked
 
Reported: 2018-10-01 14:48 UTC by Lukáš Hellebrandt
Modified: 2020-04-14 13:23 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:23:24 UTC
Target Upstream Version:


Attachments (Terms of Use)
production.log (17.92 KB, text/plain)
2018-10-01 14:48 UTC, Lukáš Hellebrandt
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 25276 Normal Closed "undefined method `href' for nil:NilClass" when provisioning host without --interface 2020-05-01 12:32:32 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:23:37 UTC

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 pm-sat@redhat.com 2018-10-23 08:01:19 UTC
Upstream bug assigned to orabin@redhat.com

Comment 10 pm-sat@redhat.com 2018-10-23 08:01:25 UTC
Upstream bug assigned to orabin@redhat.com

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

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

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


Note You need to log in before you can comment on or make changes to this bug.